git subrepo clone https://github.com/agottem/weld.git weld

subrepo:
  subdir:   "weld"
  merged:   "d0cd07b"
upstream:
  origin:   "https://github.com/agottem/weld.git"
  branch:   "master"
  commit:   "d0cd07b"
git-subrepo:
  version:  "0.3.1"
  origin:   "???"
  commit:   "???"

Change-Id: I109553651e97fd93e00aa555d171ca9d04ce8585
diff --git a/weld/shell/cmd.mk b/weld/shell/cmd.mk
new file mode 100644
index 0000000..01e01b8
--- /dev/null
+++ b/weld/shell/cmd.mk
@@ -0,0 +1,34 @@
+# Copyright 2015 Andrew Gottemoller.
+#
+# This software is a copyrighted work licensed under the terms of the
+# Weld license.  Please consult the file "WELD_LICENSE" for
+# details.
+
+# This makefile defines cmd specific functionality used throughout weld
+
+
+# Convert a native path name to a universal representation
+path_to_universal = $(subst \,/,$(1))
+
+# Convert a universtal path name to the native representation
+path_to_native = $(subst /,\,$(1))
+
+# Find all files of the specified name beneath the specified path
+find_files = $(strip $(call path_to_universal,$(shell dir /B /S $(call path_to_native,$(1)/$(2)))))
+
+# Windows doesn't support symlinking so soft and hard copy both
+# make copies'
+soft_copy = $(strip copy /V $(call path_to_native,$(1) $(2)) 1>NUL)
+hard_copy = $(strip copy /V $(call path_to_native,$(1) $(2)) 1>NUL)
+
+# Remove files which exist
+remove_files  = $(strip $(if $(wildcard $(1)),del /Q /F $(call path_to_native,$(wildcard $(1))),))
+
+# Create a directory tree
+make_directory = $(strip $(if $(wildcard $(1)),,mkdir $(call path_to_native,$(1))))
+
+# Remove directory that exists
+remove_directory  = $(strip $(if $(wildcard $(1)),rmdir /Q /S $(call path_to_native,$(wildcard $(1))),))
+
+# Print to stdout
+print  = echo $(1)
diff --git a/weld/shell/sh.mk b/weld/shell/sh.mk
new file mode 100644
index 0000000..1c1ae71
--- /dev/null
+++ b/weld/shell/sh.mk
@@ -0,0 +1,36 @@
+# Copyright 2015 Andrew Gottemoller.
+#
+# This software is a copyrighted work licensed under the terms of the
+# Weld license.  Please consult the file "WELD_LICENSE" for
+# details.
+
+# This makefile defines sh specific functionality used throughout weld
+
+
+# Convert a native path name to a universal representation
+path_to_universal = $(1)
+
+# Convert a universtal path name to the native representation
+path_to_native = $(1)
+
+# Find all files of the specified name beneath the specified path
+find_files = $(strip $(call path_to_universal,$(shell find $(call path_to_native,$(1)) -name $(call path_to_native,$(2)))))
+
+# Create a symlink to a file (requires passing --check-symlink-times on make command line)
+# soft_copy = $(strip ln -s -f $(call path_to_native,$(abspath $(1)) $(abspath $(2))))
+soft_copy = $(strip cp $(call path_to_native,$(1) $(2)))
+
+# Make an actual copy of a file
+hard_copy = $(strip cp $(call path_to_native,$(1) $(2)))
+
+# Remove files which exist
+remove_files = $(strip $(if $(wildcard $(1)),rm -f $(call path_to_native,$(wildcard $(1))),))
+
+# Create a directory tree
+make_directory = $(strip $(if $(wildcard $(1)),,mkdir -p $(call path_to_native,$(1))))
+
+# Remove directory that exists
+remove_directory = $(strip $(if $(wildcard $(1)),rm -rf $(call path_to_native,$(wildcard $(1))),))
+
+# Print to stdout
+print = echo $(1)