aboutsummaryrefslogtreecommitdiffstats
path: root/support/make
diff options
context:
space:
mode:
Diffstat (limited to 'support/make')
-rw-r--r--support/make/footer.mk18
-rw-r--r--support/make/header.mk4
2 files changed, 22 insertions, 0 deletions
diff --git a/support/make/footer.mk b/support/make/footer.mk
new file mode 100644
index 0000000..2242416
--- /dev/null
+++ b/support/make/footer.mk
@@ -0,0 +1,18 @@
+sFILES_$(d) := $(sSRCS_$(d):%=$(d)/%)
+cFILES_$(d) := $(cSRCS_$(d):%=$(d)/%)
+cppFILES_$(d) := $(cppSRCS_$(d):%=$(d)/%)
+
+OBJS_$(d) := $(sFILES_$(d):%.S=$(BUILD_PATH)/%.o) \
+ $(cFILES_$(d):%.c=$(BUILD_PATH)/%.o) \
+ $(cppFILES_$(d):%.cpp=$(BUILD_PATH)/%.o)
+DEPS_$(d) := $(OBJS_$(d):%.o=%.d)
+
+$(OBJS_$(d)): TGT_CFLAGS := $(CFLAGS_$(d))
+$(OBJS_$(d)): TGT_CXXFLAGS := $(CXXFLAGS_$(d))
+$(OBJS_$(d)): TGT_ASFLAGS := $(ASFLAGS_$(d))
+
+TGT_BIN += $(OBJS_$(d))
+
+-include $(DEPS_$(d))
+d := $(dirstack_$(sp))
+sp := $(basename $(sp))
diff --git a/support/make/header.mk b/support/make/header.mk
new file mode 100644
index 0000000..c85594a
--- /dev/null
+++ b/support/make/header.mk
@@ -0,0 +1,4 @@
+sp := $(sp).x
+dirstack_$(sp) := $(d)
+d := $(dir)
+BUILDDIRS += $(BUILD_PATH)/$(d)