summaryrefslogtreecommitdiffstats
path: root/src/target/firmware/Makefile.inc
diff options
context:
space:
mode:
authorSylvain Munaut <tnt@246tNt.com>2012-12-10 20:50:53 +0100
committerSylvain Munaut <tnt@246tNt.com>2013-01-02 20:44:11 +0100
commit3ee1beb8bf4c1ca87c88d12a8cd1f24d096aee88 (patch)
tree7e4acf158e7bb4a279e6fe915808685db7050dad /src/target/firmware/Makefile.inc
parentd9f6921c020af4c53d6507ed271886e24855a5df (diff)
fw/build: Add ENV_ APP_ BOARD_ prefix to variables to cleanup namespace
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
Diffstat (limited to 'src/target/firmware/Makefile.inc')
-rw-r--r--src/target/firmware/Makefile.inc38
1 files changed, 19 insertions, 19 deletions
diff --git a/src/target/firmware/Makefile.inc b/src/target/firmware/Makefile.inc
index 844da692..cb2374e0 100644
--- a/src/target/firmware/Makefile.inc
+++ b/src/target/firmware/Makefile.inc
@@ -78,7 +78,7 @@ default: all
define APPLICATION_BOARD_ENVIRONMENT_template
# define set of objects for this binary
-$(1)_$(2)_$(3)_OBJS := apps/$(1)/main.o $(ANY_APP_OBJS) $$($(1)_OBJS) $$($(2)_OBJS) $$($(3)_OBJS)
+$(1)_$(2)_$(3)_OBJS := apps/$(1)/main.o $(ANY_APP_OBJS) $$(APP_$(1)_OBJS) $$(BOARD_$(2)_OBJS) $$(ENV_$(3)_OBJS)
$(1)_$(2)_$(3)_LIBS := $(ANY_APP_LIBS)
# define manifest compilation
@@ -93,8 +93,8 @@ board/$(2)/$(1).$(3).manifest.p: board/manifest.c
$(1)_$(2)_$(3)_OBJS+=board/$(2)/$(1).$(3).manifest.o
# define compilation rule, also generates map file
-board/$(2)/$(1).$(3).elf board/$(2)/$(1).$(3).map: $$($(1)_$(2)_$(3)_OBJS) $$($(1)_$(2)_$(3)_LIBS) $$($(3)_LDS)
- $$(Q_LD)$(CROSS_COMPILE)$(LD) $(LDFLAGS) -T $$($(3)_LDS) -Bstatic \
+board/$(2)/$(1).$(3).elf board/$(2)/$(1).$(3).map: $$($(1)_$(2)_$(3)_OBJS) $$($(1)_$(2)_$(3)_LIBS) $$(ENV_$(3)_LDS)
+ $$(Q_LD)$(CROSS_COMPILE)$(LD) $(LDFLAGS) -T $$(ENV_$(3)_LDS) -Bstatic \
-Map board/$(2)/$(1).$(3).map -o board/$(2)/$(1).$(3).elf \
--start-group $$($(1)_$(2)_$(3)_OBJS) $$($(1)_$(2)_$(3)_LIBS) --end-group
@@ -108,33 +108,33 @@ ALL_OBJS+=board/$(2)/$(1).$(3).manifest.o
endef
define BOARD_template
-ALL_OBJS+=$$($(1)_OBJS)
+ALL_OBJS+=$$(BOARD_$(1)_OBJS)
endef
define BOARD_ENVIRONMENT_template
-ALL_OBJS+=$$($(1)_OBJS)
+ALL_OBJS+=$$(ENV_$(1)_OBJS)
endef
define APPLICATION_template
-$(1)_SRCS_REL=$$(patsubst %,$$($(1)_DIR)/%,$$($(1)_SRCS))
-$(1)_OBJS:=$$($(1)_SRCS_REL:.c=.o)
-$(1)_OBJS:=$$($(1)_OBJS:.S=.o)
+APP_$(1)_SRCS_REL=$$(patsubst %,$$(APP_$(1)_DIR)/%,$$(APP_$(1)_SRCS))
+APP_$(1)_OBJS:=$$(APP_$(1)_SRCS_REL:.c=.o)
+APP_$(1)_OBJS:=$$(APP_$(1)_OBJS:.S=.o)
-ALL_OBJS+=$$($(1)_OBJS) apps/$(1)/main.o
+ALL_OBJS+=$$(APP_$(1)_OBJS) apps/$(1)/main.o
endef
# define rules for all defined applications
$(foreach brd,$(BOARDS), \
$(eval $(call BOARD_template,$(brd)) \
- $(foreach env,$($(brd)_ENVIRONMENTS), \
- $(eval $(call BOARD_ENVIRONMENT_template,$(env))))))
+ $(foreach env,$(BOARD_$(brd)_ENVIRONMENTS), \
+ $(eval $(call BOARD_ENVIRONMENT_template,$(env))))))
$(foreach app,$(APPLICATIONS), \
$(eval $(call APPLICATION_template,$(app))))
$(foreach app,$(APPLICATIONS), \
$(foreach brd,$(BOARDS), \
- $(foreach env,$($(brd)_ENVIRONMENTS), \
+ $(foreach env,$(BOARD_$(brd)_ENVIRONMENTS), \
$(eval $(call APPLICATION_BOARD_ENVIRONMENT_template,$(app),$(brd),$(env))))))
@@ -146,16 +146,16 @@ ALL_OBJS+=$(ANY_APP_OBJS)
# template for library rules
define LIBRARY_template
-$(1)_SRCS_REL=$$(patsubst %,$$($(1)_DIR)/%,$$($(1)_SRCS))
-$(1)_OBJS:=$$($(1)_SRCS_REL:.c=.o)
-$(1)_OBJS:=$$($(1)_OBJS:.S=.o)
+LIB_$(1)_SRCS_REL=$$(patsubst %,$$(LIB_$(1)_DIR)/%,$$(LIB_$(1)_SRCS))
+LIB_$(1)_OBJS:=$$(LIB_$(1)_SRCS_REL:.c=.o)
+LIB_$(1)_OBJS:=$$(LIB_$(1)_OBJS:.S=.o)
-$$($(1)_DIR)/lib$(1).a: $$($(1)_OBJS)
- $$(Q_AR)$(CROSS_COMPILE)$(AR) cru $$($(1)_DIR)/lib$(1).a $$($(1)_OBJS)
+$$(LIB_$(1)_DIR)/lib$(1).a: $$(LIB_$(1)_OBJS)
+ $$(Q_AR)$(CROSS_COMPILE)$(AR) cru $$(LIB_$(1)_DIR)/lib$(1).a $$(LIB_$(1)_OBJS)
-ALL_LIBS+=$$($(1)_DIR)/lib$(1).a
+ALL_LIBS+=$$(LIB_$(1)_DIR)/lib$(1).a
-ALL_OBJS+=$$($(1)_OBJS)
+ALL_OBJS+=$$(LIB_$(1)_OBJS)
endef