Parcourir la source

[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.
tags/v0.9.8
Michael Brown il y a 16 ans
Parent
révision
f79608b376
1 fichiers modifiés avec 28 ajouts et 0 suppressions
  1. 28
    0
      src/Makefile.housekeeping

+ 28
- 0
src/Makefile.housekeeping Voir le fichier

@@ -664,6 +664,34 @@ $(BIN)/%.tmp : $(BLIB) $(MAKEDEPS) $(LDSCRIPT)
664 664
 $(BIN)/%.map : $(BIN)/%.tmp
665 665
 	@less $(BIN)/$*.tmp.map
666 666
 
667
+# Get objects list for the specified target
668
+#
669
+define objs_list
670
+	$(sort $(foreach OBJ_SYMBOL,\
671
+		 $(filter obj_%,$(shell $(NM) $(1) | cut -d" " -f3)),\
672
+		 $(patsubst obj_%,%,$(OBJ_SYMBOL))))
673
+endef
674
+$(BIN)/%.objs : $(BIN)/%.tmp
675
+	$(Q)$(ECHO) $(call objs_list,$<)
676
+
677
+# Get dependency list for the specified target
678
+#
679
+define deps_list
680
+	$(sort $(foreach OBJ,$(call objs_list,$(1)),$($(OBJ)_DEPS)))
681
+endef
682
+$(BIN)/%.deps : $(BIN)/%.tmp
683
+	$(Q)$(ECHO) $(call deps_list,$<)
684
+
685
+# Get unneeded source files for the specified target
686
+#
687
+define nodeps_list
688
+	$(sort $(filter-out $(call deps_list,$<),\
689
+		 $(foreach BOBJ,$(BOBJS),\
690
+		   $($(basename $(notdir $(BOBJ)))_DEPS))))
691
+endef
692
+$(BIN)/%.nodeps : $(BIN)/%.tmp
693
+	$(Q)$(ECHO) $(call nodeps_list,$<)
694
+
667 695
 # Extract compression information from intermediate object file
668 696
 #
669 697
 $(BIN)/%.zinfo : $(BIN)/%.tmp

Chargement…
Annuler
Enregistrer