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/weld.mk b/weld/weld.mk
new file mode 100644
index 0000000..94b47a2
--- /dev/null
+++ b/weld/weld.mk
@@ -0,0 +1,86 @@
+# 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 is the entry point into the weld build system. This file should
+# be included by a project's root level makefile'
+
+
+# Weld doesn't use implicit rules so turn them off
+.SUFFIXES :
+
+
+# Figure out the path of this makefile
+weld_makefile := $(lastword $(MAKEFILE_LIST))
+weld_path := $(dir $(weld_makefile))
+
+
+# If a config file is specified, include it
+-include $(config_file)
+
+# Set the defaults
+include $(weld_path)/config.mk
+
+# Verify the config file has set all the necessary variables
+ifeq ($(source_path),)
+ $(error csdk_path is not set)
+endif
+
+ifeq ($(build_path),)
+ $(error build_path is not set)
+endif
+
+ifeq ($(arch),)
+ $(error arch is not set)
+endif
+
+ifeq ($(mode),)
+ $(error mode is not set)
+endif
+
+ifeq ($(shell_name),)
+ $(error shell_name is not set)
+endif
+
+ifeq ($(platform),)
+ $(error platform is not set)
+endif
+
+ifeq ($(c_toolchain),)
+ $(error c_toolchain is not set)
+endif
+
+
+# Set derived path values
+include $(weld_path)/paths.mk
+
+# Include shell functions and standard utility functions
+include $(weld_path)/shell/$(shell_name).mk
+include $(weld_path)/utils.mk
+
+# Discover and include all the specified component definitions found
+# for this project
+include $(weld_path)/def.mk
+include $(weld_path)/disc.mk
+
+
+# Define the top level targets
+.DEFAULT_GOAL := build
+
+
+.PHONY : build
+build : $(build_target_list)
+
+.PHONE : headers
+headers : $(headers_target_list)
+
+.PHONY : clean
+clean : $(clean_target_list)
+
+.PHONE : clean_headers
+clean_headers : $(clean_headers_target_list)
+
+$(sort $(directory_list)) :
+ $(call make_directory,$@)