aboutsummaryrefslogtreecommitdiffstats
path: root/support
diff options
context:
space:
mode:
Diffstat (limited to 'support')
-rw-r--r--support/make/footer.mk18
-rw-r--r--support/make/header.mk4
-rw-r--r--support/make/target-config.mk6
3 files changed, 26 insertions, 2 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)
diff --git a/support/make/target-config.mk b/support/make/target-config.mk
index ea5dfd9..278ca3f 100644
--- a/support/make/target-config.mk
+++ b/support/make/target-config.mk
@@ -32,8 +32,10 @@ ifeq ($(MCU_SERIES), stm32f1)
LD_SERIES_PATH := $(LD_SERIES_PATH)/$(MCU_F1_LINE)
endif
-TARGET_LDFLAGS += -T$(LD_SCRIPT_PATH) -L $(LD_SERIES_PATH) \
- -L $(LD_MEM_PATH) -L$(LDDIR)
+TARGET_LDFLAGS += -Xlinker -T$(LD_SCRIPT_PATH) \
+ -Xlinker -L $(LD_SERIES_PATH) \
+ -Xlinker -L $(LD_MEM_PATH) \
+ -Xlinker -L$(LDDIR)
TARGET_FLAGS += -DBOARD_$(BOARD) -DMCU_$(MCU) \
-DERROR_LED_PORT=$(ERROR_LED_PORT) \
-DERROR_LED_PIN=$(ERROR_LED_PIN) \