mirror of
https://github.com/ARM-software/arm-trusted-firmware.git
synced 2025-04-24 13:55:56 +00:00
make: support libraries in MAKE_BL macro
Add support for BLx stages to use libraries in MAKE_BL macro. This change does not affect BL stages that do not have BL_LIBS variable defined in their makefiles. However in case that BL wants to use external library (for instance vendor-specific DDR initialization code supplied as a library), this patch will allow to build BL image linked with such library. Change-Id: Ife29069a72dc4aff833db6ef8b828736d6689b78 Signed-off-by: Konstantin Porotchkin <kostap@marvell.com>
This commit is contained in:
parent
255f5c8f88
commit
23e0fe52de
1 changed files with 3 additions and 2 deletions
|
@ -290,6 +290,7 @@ define MAKE_BL
|
||||||
$(eval DUMP := $(call IMG_DUMP,$(1)))
|
$(eval DUMP := $(call IMG_DUMP,$(1)))
|
||||||
$(eval BIN := $(call IMG_BIN,$(1)))
|
$(eval BIN := $(call IMG_BIN,$(1)))
|
||||||
$(eval BL_LINKERFILE := $(BL$(call uppercase,$(1))_LINKERFILE))
|
$(eval BL_LINKERFILE := $(BL$(call uppercase,$(1))_LINKERFILE))
|
||||||
|
$(eval BL_LIBS := $(BL$(call uppercase,$(1))_LIBS))
|
||||||
# We use sort only to get a list of unique object directory names.
|
# We use sort only to get a list of unique object directory names.
|
||||||
# ordering is not relevant but sort removes duplicates.
|
# ordering is not relevant but sort removes duplicates.
|
||||||
$(eval TEMP_OBJ_DIRS := $(sort $(dir ${OBJS} ${LINKERFILE})))
|
$(eval TEMP_OBJ_DIRS := $(sort $(dir ${OBJS} ${LINKERFILE})))
|
||||||
|
@ -312,7 +313,7 @@ bl${1}_dirs: | ${OBJ_DIRS}
|
||||||
$(eval $(call MAKE_OBJS,$(BUILD_DIR),$(SOURCES),$(1)))
|
$(eval $(call MAKE_OBJS,$(BUILD_DIR),$(SOURCES),$(1)))
|
||||||
$(eval $(call MAKE_LD,$(LINKERFILE),$(BL_LINKERFILE),$(1)))
|
$(eval $(call MAKE_LD,$(LINKERFILE),$(BL_LINKERFILE),$(1)))
|
||||||
|
|
||||||
$(ELF): $(OBJS) $(LINKERFILE) | bl$(1)_dirs
|
$(ELF): $(OBJS) $(LINKERFILE) | bl$(1)_dirs $(BL_LIBS)
|
||||||
@echo " LD $$@"
|
@echo " LD $$@"
|
||||||
ifdef MAKE_BUILD_STRINGS
|
ifdef MAKE_BUILD_STRINGS
|
||||||
$(call MAKE_BUILD_STRINGS, $(BUILD_DIR)/build_message.o)
|
$(call MAKE_BUILD_STRINGS, $(BUILD_DIR)/build_message.o)
|
||||||
|
@ -322,7 +323,7 @@ else
|
||||||
$$(CC) $$(TF_CFLAGS) $$(CFLAGS) -xc -c - -o $(BUILD_DIR)/build_message.o
|
$$(CC) $$(TF_CFLAGS) $$(CFLAGS) -xc -c - -o $(BUILD_DIR)/build_message.o
|
||||||
endif
|
endif
|
||||||
$$(Q)$$(LD) -o $$@ $$(TF_LDFLAGS) $$(LDFLAGS) -Map=$(MAPFILE) \
|
$$(Q)$$(LD) -o $$@ $$(TF_LDFLAGS) $$(LDFLAGS) -Map=$(MAPFILE) \
|
||||||
--script $(LINKERFILE) $(BUILD_DIR)/build_message.o $(OBJS) $(LDLIBS)
|
--script $(LINKERFILE) $(BUILD_DIR)/build_message.o $(OBJS) $(LDLIBS) $(BL_LIBS)
|
||||||
|
|
||||||
$(DUMP): $(ELF)
|
$(DUMP): $(ELF)
|
||||||
@echo " OD $$@"
|
@echo " OD $$@"
|
||||||
|
|
Loading…
Add table
Reference in a new issue