2
0
mirror of https://github.com/xcat2/xNBA.git synced 2025-02-02 12:01:50 +00:00

[build] Provide mechanism for listing per-target source files

You can now type e.g.

  make bin/rtl8139.rom.deps

to see a list of the source files included in the build of
bin/rtl8139.rom.  This is intended to assist with copyright vetting.

Other new debugging targets include

  make bin/rtl8139.rom.objs

to see a list of object files linked in to bin/rtl8139.rom, and

  make bin/rtl8139.rom.nodeps

to see a list of the source files that are *not* required for the
build of bin/rtl8139.rom.
This commit is contained in:
Michael Brown 2009-04-17 12:38:44 +01:00
parent b4a87daeb9
commit f79608b376

View File

@ -664,6 +664,34 @@ $(BIN)/%.tmp : $(BLIB) $(MAKEDEPS) $(LDSCRIPT)
$(BIN)/%.map : $(BIN)/%.tmp
@less $(BIN)/$*.tmp.map
# Get objects list for the specified target
#
define objs_list
$(sort $(foreach OBJ_SYMBOL,\
$(filter obj_%,$(shell $(NM) $(1) | cut -d" " -f3)),\
$(patsubst obj_%,%,$(OBJ_SYMBOL))))
endef
$(BIN)/%.objs : $(BIN)/%.tmp
$(Q)$(ECHO) $(call objs_list,$<)
# Get dependency list for the specified target
#
define deps_list
$(sort $(foreach OBJ,$(call objs_list,$(1)),$($(OBJ)_DEPS)))
endef
$(BIN)/%.deps : $(BIN)/%.tmp
$(Q)$(ECHO) $(call deps_list,$<)
# Get unneeded source files for the specified target
#
define nodeps_list
$(sort $(filter-out $(call deps_list,$<),\
$(foreach BOBJ,$(BOBJS),\
$($(basename $(notdir $(BOBJ)))_DEPS))))
endef
$(BIN)/%.nodeps : $(BIN)/%.tmp
$(Q)$(ECHO) $(call nodeps_list,$<)
# Extract compression information from intermediate object file
#
$(BIN)/%.zinfo : $(BIN)/%.tmp