@@ -21,6 +21,7 @@
*.dtbo
*.dtb.S
*.dtbo.S
+*.dtlst
*.dwo
*.elf
*.gcno
@@ -1927,7 +1927,7 @@ clean: $(clean-dirs)
-o -name '*.ko.*' \
-o -name '*.dtb' -o -name '*.dtbo' \
-o -name '*.dtb.S' -o -name '*.dtbo.S' \
- -o -name '*.dt.yaml' -o -name 'dtbs-list' \
+ -o -name '*.dt.yaml' -o -name '*.dtlst' -o -name 'dtbs-list' \
-o -name '*.dwo' -o -name '*.lst' \
-o -name '*.su' -o -name '*.mod' \
-o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \
@@ -252,6 +252,12 @@ cmd_mod = printf '%s\n' $(call real-search, $*.o, .o, -objs -y -m) | \
$(obj)/%.mod: FORCE
$(call if_changed,mod)
+cmd_dt_list = printf '%s\n' $(call real-search, $*.dtb, .dtb, -dtbs) | \
+ $(AWK) '!x[$$0]++ { print("$(obj)/"$$0) }' > $@
+
+$(obj)/%.dtlst: FORCE
+ $(call if_changed,dt_list)
+
quiet_cmd_cc_lst_c = MKLST $@
cmd_cc_lst_c = $(CC) $(c_flags) -g -c -o $*.o $< && \
$(CONFIG_SHELL) $(srctree)/scripts/makelst $*.o \
@@ -93,6 +93,8 @@ base-dtb-y := $(filter %.dtb, $(call real-search, $(multi-dtb-y), .dtb, -dtbs))
always-y += $(dtb-y)
+always-y += $(patsubst %.dtb, %.dtlst, $(filter %.dtb, $(dtb-y)))
+
# Add subdir path
ifneq ($(obj),.)
Some *.dtb files are assembled from a base DTB and overlays, but once they are built, there is no way to propagate such information to succeeding processes. This commit introduces the generation of *.dtlst files, listing the component *.dtb(o) files that construct the corresponding *.dtb. This is analogous to *.mod, which lists component objects for each module. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> --- .gitignore | 1 + Makefile | 2 +- scripts/Makefile.build | 6 ++++++ scripts/Makefile.lib | 2 ++ 4 files changed, 10 insertions(+), 1 deletion(-)