mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-22 12:34:19 +00:00
Add compilation macro for each BL stage
This patch defines a compile time macro for each boot loader stage which allows compilation of code only for a specific stage. Change-Id: I3a4068404cd3dc26d652556ca9ca7afea8dd28ef
This commit is contained in:
parent
c1efc4c066
commit
27905d0a10
2 changed files with 10 additions and 5 deletions
10
Makefile
10
Makefile
|
@ -300,7 +300,7 @@ $(eval PREREQUISITES := $(patsubst %.o,%.d,$(OBJ)))
|
||||||
|
|
||||||
$(OBJ) : $(2)
|
$(OBJ) : $(2)
|
||||||
@echo " CC $$<"
|
@echo " CC $$<"
|
||||||
$$(Q)$$(CC) $$(CFLAGS) -c $$< -o $$@
|
$$(Q)$$(CC) $$(CFLAGS) -DIMAGE_BL$(3) -c $$< -o $$@
|
||||||
|
|
||||||
|
|
||||||
$(PREREQUISITES) : $(2)
|
$(PREREQUISITES) : $(2)
|
||||||
|
@ -322,7 +322,7 @@ $(eval PREREQUISITES := $(patsubst %.o,%.d,$(OBJ)))
|
||||||
|
|
||||||
$(OBJ) : $(2)
|
$(OBJ) : $(2)
|
||||||
@echo " AS $$<"
|
@echo " AS $$<"
|
||||||
$$(Q)$$(AS) $$(ASFLAGS) -c $$< -o $$@
|
$$(Q)$$(AS) $$(ASFLAGS) -DIMAGE_BL$(3) -c $$< -o $$@
|
||||||
|
|
||||||
$(PREREQUISITES) : $(2)
|
$(PREREQUISITES) : $(2)
|
||||||
@echo " DEPS $$@"
|
@echo " DEPS $$@"
|
||||||
|
@ -359,11 +359,11 @@ endef
|
||||||
define MAKE_OBJS
|
define MAKE_OBJS
|
||||||
$(eval C_OBJS := $(filter %.c,$(2)))
|
$(eval C_OBJS := $(filter %.c,$(2)))
|
||||||
$(eval REMAIN := $(filter-out %.c,$(2)))
|
$(eval REMAIN := $(filter-out %.c,$(2)))
|
||||||
$(eval $(foreach obj,$(C_OBJS),$(call MAKE_C,$(1),$(obj))))
|
$(eval $(foreach obj,$(C_OBJS),$(call MAKE_C,$(1),$(obj),$(3))))
|
||||||
|
|
||||||
$(eval S_OBJS := $(filter %.S,$(REMAIN)))
|
$(eval S_OBJS := $(filter %.S,$(REMAIN)))
|
||||||
$(eval REMAIN := $(filter-out %.S,$(REMAIN)))
|
$(eval REMAIN := $(filter-out %.S,$(REMAIN)))
|
||||||
$(eval $(foreach obj,$(S_OBJS),$(call MAKE_S,$(1),$(obj))))
|
$(eval $(foreach obj,$(S_OBJS),$(call MAKE_S,$(1),$(obj),$(3))))
|
||||||
|
|
||||||
$(and $(REMAIN),$(error Unexpected source files present: $(REMAIN)))
|
$(and $(REMAIN),$(error Unexpected source files present: $(REMAIN)))
|
||||||
endef
|
endef
|
||||||
|
@ -387,7 +387,7 @@ define MAKE_BL
|
||||||
$(eval DUMP := $(BUILD_DIR)/bl$(1).dump)
|
$(eval DUMP := $(BUILD_DIR)/bl$(1).dump)
|
||||||
$(eval BIN := $(BUILD_PLAT)/bl$(1).bin)
|
$(eval BIN := $(BUILD_PLAT)/bl$(1).bin)
|
||||||
|
|
||||||
$(eval $(call MAKE_OBJS,$(BUILD_DIR),$(SOURCES)))
|
$(eval $(call MAKE_OBJS,$(BUILD_DIR),$(SOURCES),$(1)))
|
||||||
$(eval $(call MAKE_LD,$(LINKERFILE),$(BL$(1)_LINKERFILE)))
|
$(eval $(call MAKE_LD,$(LINKERFILE),$(BL$(1)_LINKERFILE)))
|
||||||
|
|
||||||
$(BUILD_DIR) :
|
$(BUILD_DIR) :
|
||||||
|
|
|
@ -1226,6 +1226,11 @@ categories. Based upon the above, the code layout looks like this:
|
||||||
lib Yes Yes Yes
|
lib Yes Yes Yes
|
||||||
services No No Yes
|
services No No Yes
|
||||||
|
|
||||||
|
The build system provides a non configurable build option IMAGE_BLx for each
|
||||||
|
boot loader stage (where x = BL stage). e.g. for BL1 , IMAGE_BL1 will be
|
||||||
|
defined by the build system. This enables the Trusted Firmware to compile
|
||||||
|
certain code only for specific boot loader stages
|
||||||
|
|
||||||
All assembler files have the `.S` extension. The linker source files for each
|
All assembler files have the `.S` extension. The linker source files for each
|
||||||
boot stage have the extension `.ld.S`. These are processed by GCC to create the
|
boot stage have the extension `.ld.S`. These are processed by GCC to create the
|
||||||
linker scripts which have the extension `.ld`.
|
linker scripts which have the extension `.ld`.
|
||||||
|
|
Loading…
Add table
Reference in a new issue