diff options
author | Michael Brown | 2009-04-17 13:38:44 +0200 |
---|---|---|
committer | Michael Brown | 2009-04-17 13:38:44 +0200 |
commit | f79608b37626ed7a2a93c03044c6cdcc1cc1c119 (patch) | |
tree | a3e16220956656097c3540f78f092f1af335d17b /src/Makefile.housekeeping | |
parent | [build] Simplify use of Getopt::Long in padimg.pl (diff) | |
download | ipxe-f79608b37626ed7a2a93c03044c6cdcc1cc1c119.tar.gz ipxe-f79608b37626ed7a2a93c03044c6cdcc1cc1c119.tar.xz ipxe-f79608b37626ed7a2a93c03044c6cdcc1cc1c119.zip |
[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.
Diffstat (limited to 'src/Makefile.housekeeping')
-rw-r--r-- | src/Makefile.housekeeping | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/Makefile.housekeeping b/src/Makefile.housekeeping index 38bd058c..9b7d1632 100644 --- a/src/Makefile.housekeeping +++ b/src/Makefile.housekeeping @@ -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 |