build system: support for CUSTOM_TARGET_DEPS

This commit is contained in:
Tomasz Gajewski 2021-04-01 00:31:39 +02:00 committed by Norman Feske
parent 99f4b3cd07
commit f3f8d9a6de
3 changed files with 24 additions and 0 deletions

View File

@ -362,6 +362,20 @@ in its 'LIBS' declaration and refers to the tools relative to
'$(BUILD_BASE_DIR)'. '$(BUILD_BASE_DIR)'.
Building additional custom targets accompanying library or program
==================================================================
There are cases when it is important to build additional targets
besides standard files built for library or program. Of course there
is no problem with writing specific make rules for commands that
generate those target files but for them to be built a proper
dependency must be specified. To achieve it those additional targets
should be added to 'CUSTOM_TARGET_DEPS' variable like e.g. in
iwl_firmware library from dde_linux repository:
! CUSTOM_TARGET_DEPS += $(addprefix $(BIN_DIR)/,$(IMAGES))
Automated integration and testing Automated integration and testing
################################# #################################

View File

@ -165,6 +165,11 @@ all: $(LIB_TAG)
# #
$(LIB_TAG) $(OBJECTS): $(HOST_TOOLS) $(LIB_TAG) $(OBJECTS): $(HOST_TOOLS)
#
# Trigger build of additional library specific targets
#
$(LIB_TAG): $(CUSTOM_TARGET_DEPS)
$(LIB_TAG): $(LIB_A) $(LIB_SO) $(LIB_CHECKED) $(ABI_SO) $(INSTALL_SO) $(DEBUG_SO) $(LIB_TAG): $(LIB_A) $(LIB_SO) $(LIB_CHECKED) $(ABI_SO) $(INSTALL_SO) $(DEBUG_SO)
@touch $@ @touch $@

View File

@ -180,6 +180,11 @@ LINK_ITEMS_BRIEF := $(subst $(LIB_CACHE_DIR),$$libs,$(LINK_ITEMS))
# #
$(LINK_ITEMS) $(TARGET): $(HOST_TOOLS) $(LINK_ITEMS) $(TARGET): $(HOST_TOOLS)
#
# Trigger build of additional program specific targets
#
$(TARGET): $(CUSTOM_TARGET_DEPS)
LD_CMD += -Wl,--whole-archive -Wl,--start-group LD_CMD += -Wl,--whole-archive -Wl,--start-group
LD_CMD += $(LINK_ITEMS_BRIEF) LD_CMD += $(LINK_ITEMS_BRIEF)
LD_CMD += $(EXT_OBJECTS) LD_CMD += $(EXT_OBJECTS)