From f79608b37626ed7a2a93c03044c6cdcc1cc1c119 Mon Sep 17 00:00:00 2001 From: Michael Brown Date: Fri, 17 Apr 2009 12:38:44 +0100 Subject: [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. --- src/Makefile.housekeeping | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'src/Makefile.housekeeping') 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 -- cgit v1.2.3-55-g7522