kbuild: clean up *.dtb and *.dtb.S patterns from top-level Makefile

We need to add "clean-files" in Makfiles to clean up DT blobs, but we
often miss to do so.

Since there are no source files that end with .dtb or .dtb.S, so we
can clean-up those files from the top-level Makefile.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Rob Herring <robh@kernel.org>
This commit is contained in:
Masahiro Yamada 2017-11-02 11:51:25 +09:00 committed by Rob Herring
parent 10b62a2f78
commit 74ce1896c6
54 changed files with 3 additions and 60 deletions

View File

@ -1153,7 +1153,6 @@ When kbuild executes, the following steps are followed (roughly):
Example:
targets += $(dtb-y)
clean-files += *.dtb
DTC_FLAGS ?= -p 1024
--- 6.8 Custom kbuild commands

View File

@ -1544,7 +1544,7 @@ clean: $(clean-dirs)
$(call cmd,rmfiles)
@find $(if $(KBUILD_EXTMOD), $(KBUILD_EXTMOD), .) $(RCS_FIND_IGNORE) \
\( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \
-o -name '*.ko.*' \
-o -name '*.ko.*' -o -name '*.dtb' -o -name '*.dtb.S' \
-o -name '*.dwo' \
-o -name '*.su' \
-o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \

View File

@ -14,4 +14,3 @@ dtstree := $(srctree)/$(src)
dtb-$(CONFIG_OF_ALL_DTBS) := $(patsubst $(dtstree)/%.dts,%.dtb, $(wildcard $(dtstree)/*.dts))
always := $(dtb-y)
clean-files := *.dtb *.dtb.S

View File

@ -1074,4 +1074,3 @@ dtstree := $(srctree)/$(src)
dtb-$(CONFIG_OF_ALL_DTBS) := $(patsubst $(dtstree)/%.dts,%.dtb, $(wildcard $(dtstree)/*.dts))
always := $(dtb-y)
clean-files := *.dtb

View File

@ -2,4 +2,3 @@ dtb-$(CONFIG_ARCH_ACTIONS) += s900-bubblegum-96.dtb
always := $(dtb-y)
subdir-y := $(dts-dirs)
clean-files := *.dtb

View File

@ -2,4 +2,3 @@ dtb-$(CONFIG_ARCH_ALPINE) += alpine-v2-evp.dtb
always := $(dtb-y)
subdir-y := $(dts-dirs)
clean-files := *.dtb

View File

@ -11,4 +11,3 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-nanopi-neo2.dtb
always := $(dtb-y)
subdir-y := $(dts-dirs)
clean-files := *.dtb

View File

@ -2,4 +2,3 @@ dtb-$(CONFIG_ARCH_STRATIX10) += socfpga_stratix10_socdk.dtb
always := $(dtb-y)
subdir-y := $(dts-dirs)
clean-files := *.dtb

View File

@ -4,4 +4,3 @@ dtb-$(CONFIG_ARCH_SEATTLE) += amd-overdrive.dtb \
always := $(dtb-y)
subdir-y := $(dts-dirs)
clean-files := *.dtb

View File

@ -22,4 +22,3 @@ dtb-$(CONFIG_ARCH_MESON) += meson-gxm-rbox-pro.dtb
always := $(dtb-y)
subdir-y := $(dts-dirs)
clean-files := *.dtb

View File

@ -3,4 +3,3 @@ dtb-$(CONFIG_ARCH_XGENE) += apm-merlin.dtb
always := $(dtb-y)
subdir-y := $(dts-dirs)
clean-files := *.dtb

View File

@ -5,4 +5,3 @@ dtb-$(CONFIG_ARCH_VEXPRESS) += vexpress-v2f-1xv7-ca53x2.dtb
always := $(dtb-y)
subdir-y := $(dts-dirs)
clean-files := *.dtb

View File

@ -4,4 +4,3 @@ dts-dirs += northstar2
dts-dirs += stingray
always := $(dtb-y)
subdir-y := $(dts-dirs)
clean-files := *.dtb

View File

@ -3,4 +3,3 @@ dtb-$(CONFIG_ARCH_BCM_IPROC) += ns2-xmc.dtb
always := $(dtb-y)
subdir-y := $(dts-dirs)
clean-files := *.dtb

View File

@ -3,4 +3,3 @@ dtb-$(CONFIG_ARCH_BCM_IPROC) += bcm958742t.dtb
always := $(dtb-y)
subdir-y := $(dts-dirs)
clean-files := *.dtb

View File

@ -3,4 +3,3 @@ dtb-$(CONFIG_ARCH_THUNDER2) += thunder2-99xx.dtb
always := $(dtb-y)
subdir-y := $(dts-dirs)
clean-files := *.dtb

View File

@ -5,4 +5,3 @@ dtb-$(CONFIG_ARCH_EXYNOS) += \
always := $(dtb-y)
subdir-y := $(dts-dirs)
clean-files := *.dtb

View File

@ -15,4 +15,3 @@ dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls2088a-rdb.dtb
always := $(dtb-y)
subdir-y := $(dts-dirs)
clean-files := *.dtb

View File

@ -7,4 +7,3 @@ dtb-$(CONFIG_ARCH_HISI) += hip07-d05.dtb
always := $(dtb-y)
subdir-y := $(dts-dirs)
clean-files := *.dtb

View File

@ -3,4 +3,3 @@ dtb-$(CONFIG_ARCH_LG1K) += lg1313-ref.dtb
always := $(dtb-y)
subdir-y := $(dts-dirs)
clean-files := *.dtb

View File

@ -12,4 +12,3 @@ dtb-$(CONFIG_ARCH_MVEBU) += armada-8080-db.dtb
always := $(dtb-y)
subdir-y := $(dts-dirs)
clean-files := *.dtb

View File

@ -7,4 +7,3 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += mt8173-evb.dtb
always := $(dtb-y)
subdir-y := $(dts-dirs)
clean-files := *.dtb

View File

@ -6,4 +6,3 @@ dtb-$(CONFIG_ARCH_TEGRA_210_SOC) += tegra210-smaug.dtb
dtb-$(CONFIG_ARCH_TEGRA_186_SOC) += tegra186-p2771-0000.dtb
always := $(dtb-y)
clean-files := *.dtb

View File

@ -8,4 +8,3 @@ dtb-$(CONFIG_ARCH_QCOM) += msm8996-mtp.dtb
always := $(dtb-y)
subdir-y := $(dts-dirs)
clean-files := *.dtb

View File

@ -2,4 +2,3 @@ dtb-$(CONFIG_ARCH_REALTEK) += rtd1295-zidoo-x9s.dtb
always := $(dtb-y)
subdir-y := $(dts-dirs)
clean-files := *.dtb

View File

@ -5,4 +5,3 @@ dtb-$(CONFIG_ARCH_R8A7796) += r8a7796-salvator-x.dtb r8a7796-m3ulcb.dtb
dtb-$(CONFIG_ARCH_R8A77995) += r8a77995-draak.dtb
always := $(dtb-y)
clean-files := *.dtb

View File

@ -13,4 +13,3 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-sapphire-excavator.dtb
always := $(dtb-y)
subdir-y := $(dts-dirs)
clean-files := *.dtb

View File

@ -6,4 +6,3 @@ dtb-$(CONFIG_ARCH_UNIPHIER) += \
uniphier-pxs3-ref.dtb
always := $(dtb-y)
clean-files := *.dtb

View File

@ -3,4 +3,3 @@ dtb-$(CONFIG_ARCH_SPRD) += sc9836-openphone.dtb \
always := $(dtb-y)
subdir-y := $(dts-dirs)
clean-files := *.dtb

View File

@ -2,4 +2,3 @@ dtb-$(CONFIG_ARCH_ZYNQMP) += zynqmp-ep108.dtb
always := $(dtb-y)
subdir-y := $(dts-dirs)
clean-files := *.dtb

View File

@ -3,4 +3,3 @@ dtb-$(CONFIG_ARCH_ZX) += zx296718-pcbox.dtb
always := $(dtb-y)
subdir-y := $(dts-dirs)
clean-files := *.dtb

View File

@ -16,5 +16,3 @@ $(obj)/builtin.dtb: $(obj)/$(DTB).dtb
$(call if_changed,cp)
$(obj)/linked_dtb.o: $(obj)/builtin.dtb
clean-files := *.dtb

View File

@ -2,5 +2,3 @@ BUILTIN_DTB := $(patsubst "%",%,$(CONFIG_BUILTIN_DTB)).dtb.o
ifneq ($(CONFIG_BUILTIN_DTB),"")
obj-$(CONFIG_OF) += $(BUILTIN_DTB)
endif
clean-files := *.dtb.S

View File

@ -12,4 +12,3 @@ dtstree := $(srctree)/$(src)
dtb-$(CONFIG_OF_ALL_DTBS) := $(patsubst $(dtstree)/%.dts,%.dtb, $(wildcard $(dtstree)/*.dts))
always := $(dtb-y)
clean-files := *.dtb.S *.dtb

View File

@ -18,4 +18,3 @@ dtb-$(CONFIG_OF_ALL_DTBS) := $(patsubst $(dtstree)/%.dts,%.dtb, $(wildcard $(dts
.SECONDARY: $(obj)/$(builtindtb-y).dtb.S
always += $(dtb-y)
clean-files += *.dtb *.dtb.S

View File

@ -34,4 +34,4 @@ $(obj)/simpleImage.%: vmlinux FORCE
$(call if_changed,strip)
@echo 'Kernel: $@ is ready' ' (#'`cat .version`')'
clean-files += simpleImage.*.unstrip linux.bin.ub dts/*.dtb
clean-files += simpleImage.*.unstrip linux.bin.ub

View File

@ -18,4 +18,3 @@ dtb-$(CONFIG_OF_ALL_DTBS) := $(patsubst $(dtstree)/%.dts,%.dtb, $(foreach d,$(dt
always := $(dtb-y)
subdir-y := $(dts-dirs)
clean-files := *.dtb *.dtb.S

View File

@ -40,4 +40,3 @@ obj-y += $(patsubst %.dtb, %.dtb.o, $(dtb-y))
obj- += dummy.o
always := $(dtb-y)
clean-files := *.dtb *.dtb.S

View File

@ -6,4 +6,3 @@ obj-y += $(patsubst %.dtb, %.dtb.o, $(dtb-y))
obj- += dummy.o
always := $(dtb-y)
clean-files := *.dtb *.dtb.S

View File

@ -7,4 +7,3 @@ obj-$(CONFIG_MACH_PISTACHIO) += pistachio_marduk.dtb.o
obj- += dummy.o
always := $(dtb-y)
clean-files := *.dtb *.dtb.S

View File

@ -7,4 +7,3 @@ obj-y += $(patsubst %.dtb, %.dtb.o, $(dtb-y))
obj- += dummy.o
always := $(dtb-y)
clean-files := *.dtb *.dtb.S

View File

@ -6,4 +6,3 @@ obj-y += $(patsubst %.dtb, %.dtb.o, $(dtb-y))
obj- += dummy.o
always := $(dtb-y)
clean-files := *.dtb *.dtb.S

View File

@ -7,4 +7,3 @@ obj-y += $(patsubst %.dtb, %.dtb.o, $(dtb-y))
obj- += dummy.o
always := $(dtb-y)
clean-files := *.dtb *.dtb.S

View File

@ -10,4 +10,3 @@ obj-y += $(patsubst %.dtb, %.dtb.o, $(dtb-y))
obj- += dummy.o
always := $(dtb-y)
clean-files := *.dtb *.dtb.S

View File

@ -4,4 +4,3 @@ dtb-$(CONFIG_FIT_IMAGE_FDT_NI169445) += 169445.dtb
obj- += dummy.o
always := $(dtb-y)
clean-files := *.dtb *.dtb.S

View File

@ -9,4 +9,3 @@ obj-y += $(patsubst %.dtb, %.dtb.o, $(dtb-y))
obj- += dummy.o
always := $(dtb-y)
clean-files := *.dtb *.dtb.S

View File

@ -9,4 +9,3 @@ dtb-$(CONFIG_ATH79) += ar9331_tl_mr3020.dtb
obj- += dummy.o
always := $(dtb-y)
clean-files := *.dtb *.dtb.S

View File

@ -11,4 +11,3 @@ obj-y += $(patsubst %.dtb, %.dtb.o, $(dtb-y))
obj- += dummy.o
always := $(dtb-y)
clean-files := *.dtb *.dtb.S

View File

@ -6,4 +6,3 @@ obj-y += $(patsubst %.dtb, %.dtb.o, $(dtb-y))
obj- += dummy.o
always := $(dtb-y)
clean-files := *.dtb *.dtb.S

View File

@ -53,7 +53,5 @@ $(obj)/%.dtb: $(src)/dts/%.dts FORCE
$(obj)/dtbs: $(addprefix $(obj)/, $(dtb-y))
clean-files := *.dtb
install:
sh $(srctree)/$(src)/install.sh $(KERNELRELEASE) $(BOOTIMAGE) System.map "$(INSTALL_PATH)"

View File

@ -5,6 +5,4 @@ BUILTIN_DTB :=
endif
obj-y += $(BUILTIN_DTB)
clean-files := *.dtb.S
#DTC_FLAGS ?= -p 1024

View File

@ -439,7 +439,7 @@ zInstall: $(CONFIGURE) $(addprefix $(obj)/, $(image-y))
clean-files += $(image-) $(initrd-) cuImage.* dtbImage.* treeImage.* \
zImage zImage.initrd zImage.chrp zImage.coff zImage.holly \
zImage.miboot zImage.pmac zImage.pseries \
zImage.maple simpleImage.* otheros.bld *.dtb
zImage.maple simpleImage.* otheros.bld
# clean up files cached by wrapper
clean-kernel-base := vmlinux.strip vmlinux.bin

View File

@ -1,3 +1 @@
obj-$(CONFIG_USE_BUILTIN_DTB) += $(patsubst "%",%,$(CONFIG_BUILTIN_DTB_SOURCE)).dtb.o
clean-files := *.dtb.S

View File

@ -16,5 +16,3 @@ dtstree := $(srctree)/$(src)
dtb-$(CONFIG_OF_ALL_DTBS) := $(patsubst $(dtstree)/%.dts,%.dtb, $(wildcard $(dtstree)/*.dts))
always += $(dtb-y)
clean-files += *.dtb *.dtb.S