OSDN Git Service

kbuild: clean up *.dtb and *.dtb.S patterns from top-level Makefile
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Thu, 2 Nov 2017 02:51:25 +0000 (11:51 +0900)
committerRob Herring <robh@kernel.org>
Wed, 8 Nov 2017 17:20:24 +0000 (11:20 -0600)
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>
54 files changed:
Documentation/kbuild/makefiles.txt
Makefile
arch/arc/boot/dts/Makefile
arch/arm/boot/dts/Makefile
arch/arm64/boot/dts/actions/Makefile
arch/arm64/boot/dts/al/Makefile
arch/arm64/boot/dts/allwinner/Makefile
arch/arm64/boot/dts/altera/Makefile
arch/arm64/boot/dts/amd/Makefile
arch/arm64/boot/dts/amlogic/Makefile
arch/arm64/boot/dts/apm/Makefile
arch/arm64/boot/dts/arm/Makefile
arch/arm64/boot/dts/broadcom/Makefile
arch/arm64/boot/dts/broadcom/northstar2/Makefile
arch/arm64/boot/dts/broadcom/stingray/Makefile
arch/arm64/boot/dts/cavium/Makefile
arch/arm64/boot/dts/exynos/Makefile
arch/arm64/boot/dts/freescale/Makefile
arch/arm64/boot/dts/hisilicon/Makefile
arch/arm64/boot/dts/lg/Makefile
arch/arm64/boot/dts/marvell/Makefile
arch/arm64/boot/dts/mediatek/Makefile
arch/arm64/boot/dts/nvidia/Makefile
arch/arm64/boot/dts/qcom/Makefile
arch/arm64/boot/dts/realtek/Makefile
arch/arm64/boot/dts/renesas/Makefile
arch/arm64/boot/dts/rockchip/Makefile
arch/arm64/boot/dts/socionext/Makefile
arch/arm64/boot/dts/sprd/Makefile
arch/arm64/boot/dts/xilinx/Makefile
arch/arm64/boot/dts/zte/Makefile
arch/c6x/boot/dts/Makefile
arch/cris/boot/dts/Makefile
arch/h8300/boot/dts/Makefile
arch/metag/boot/dts/Makefile
arch/microblaze/boot/Makefile
arch/mips/boot/dts/Makefile
arch/mips/boot/dts/brcm/Makefile
arch/mips/boot/dts/cavium-octeon/Makefile
arch/mips/boot/dts/img/Makefile
arch/mips/boot/dts/ingenic/Makefile
arch/mips/boot/dts/lantiq/Makefile
arch/mips/boot/dts/mti/Makefile
arch/mips/boot/dts/netlogic/Makefile
arch/mips/boot/dts/ni/Makefile
arch/mips/boot/dts/pic32/Makefile
arch/mips/boot/dts/qca/Makefile
arch/mips/boot/dts/ralink/Makefile
arch/mips/boot/dts/xilfpga/Makefile
arch/nios2/boot/Makefile
arch/openrisc/boot/dts/Makefile
arch/powerpc/boot/Makefile
arch/sh/boot/dts/Makefile
arch/xtensa/boot/dts/Makefile

index 329e740..411b728 100644 (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
index 64cbc66..c1dcd85 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -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' \
index a09f11b..1257db1 100644 (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
index faf46ab..5eeefbc 100644 (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
index 62922d6..89bb1b5 100644 (file)
@@ -2,4 +2,3 @@ dtb-$(CONFIG_ARCH_ACTIONS) += s900-bubblegum-96.dtb
 
 always         := $(dtb-y)
 subdir-y       := $(dts-dirs)
-clean-files    := *.dtb
index 8a6cde4..8606a57 100644 (file)
@@ -2,4 +2,3 @@ dtb-$(CONFIG_ARCH_ALPINE)       += alpine-v2-evp.dtb
 
 always         := $(dtb-y)
 subdir-y       := $(dts-dirs)
-clean-files    := *.dtb
index 19c3fbd..871ed76 100644 (file)
@@ -11,4 +11,3 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h5-nanopi-neo2.dtb
 
 always         := $(dtb-y)
 subdir-y       := $(dts-dirs)
-clean-files    := *.dtb
index d7a6416..7511b51 100644 (file)
@@ -2,4 +2,3 @@ dtb-$(CONFIG_ARCH_STRATIX10) += socfpga_stratix10_socdk.dtb
 
 always         := $(dtb-y)
 subdir-y       := $(dts-dirs)
-clean-files    := *.dtb
index ba84770..cb1c779 100644 (file)
@@ -4,4 +4,3 @@ dtb-$(CONFIG_ARCH_SEATTLE) += amd-overdrive.dtb \
 
 always         := $(dtb-y)
 subdir-y       := $(dts-dirs)
-clean-files    := *.dtb
index 7a9f48c..d864403 100644 (file)
@@ -22,4 +22,3 @@ dtb-$(CONFIG_ARCH_MESON) += meson-gxm-rbox-pro.dtb
 
 always         := $(dtb-y)
 subdir-y       := $(dts-dirs)
-clean-files    := *.dtb
index c75f17a..4334978 100644 (file)
@@ -3,4 +3,3 @@ dtb-$(CONFIG_ARCH_XGENE) += apm-merlin.dtb
 
 always         := $(dtb-y)
 subdir-y       := $(dts-dirs)
-clean-files    := *.dtb
index 75cc2aa..01c342f 100644 (file)
@@ -5,4 +5,3 @@ dtb-$(CONFIG_ARCH_VEXPRESS) += vexpress-v2f-1xv7-ca53x2.dtb
 
 always         := $(dtb-y)
 subdir-y       := $(dts-dirs)
-clean-files    := *.dtb
index 3eaef38..d720d0d 100644 (file)
@@ -4,4 +4,3 @@ dts-dirs        += northstar2
 dts-dirs       += stingray
 always         := $(dtb-y)
 subdir-y       := $(dts-dirs)
-clean-files    := *.dtb
index e01a148..c589b9b 100644 (file)
@@ -3,4 +3,3 @@ dtb-$(CONFIG_ARCH_BCM_IPROC) += ns2-xmc.dtb
 
 always         := $(dtb-y)
 subdir-y       := $(dts-dirs)
-clean-files    := *.dtb
index f70028e..8edcc52 100644 (file)
@@ -3,4 +3,3 @@ dtb-$(CONFIG_ARCH_BCM_IPROC) += bcm958742t.dtb
 
 always         := $(dtb-y)
 subdir-y       := $(dts-dirs)
-clean-files    := *.dtb
index 581b2c1..c63145e 100644 (file)
@@ -3,4 +3,3 @@ dtb-$(CONFIG_ARCH_THUNDER2) += thunder2-99xx.dtb
 
 always         := $(dtb-y)
 subdir-y       := $(dts-dirs)
-clean-files    := *.dtb
index 7ddea53..4633adf 100644 (file)
@@ -5,4 +5,3 @@ dtb-$(CONFIG_ARCH_EXYNOS) += \
 
 always         := $(dtb-y)
 subdir-y       := $(dts-dirs)
-clean-files    := *.dtb
index 72c4b52..fe18e3d 100644 (file)
@@ -15,4 +15,3 @@ dtb-$(CONFIG_ARCH_LAYERSCAPE) += fsl-ls2088a-rdb.dtb
  
 always         := $(dtb-y)
 subdir-y       := $(dts-dirs)
-clean-files    := *.dtb
index 8960eca..cb25d7a 100644 (file)
@@ -7,4 +7,3 @@ dtb-$(CONFIG_ARCH_HISI) += hip07-d05.dtb
 
 always         := $(dtb-y)
 subdir-y       := $(dts-dirs)
-clean-files    := *.dtb
index 5c7b54c..c0bbe06 100644 (file)
@@ -3,4 +3,3 @@ dtb-$(CONFIG_ARCH_LG1K) += lg1313-ref.dtb
 
 always         := $(dtb-y)
 subdir-y       := $(dts-dirs)
-clean-files    := *.dtb
index 6cff81e..b471235 100644 (file)
@@ -12,4 +12,3 @@ dtb-$(CONFIG_ARCH_MVEBU) += armada-8080-db.dtb
 
 always         := $(dtb-y)
 subdir-y       := $(dts-dirs)
-clean-files    := *.dtb
index 151723b..80d1743 100644 (file)
@@ -7,4 +7,3 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += mt8173-evb.dtb
 
 always         := $(dtb-y)
 subdir-y       := $(dts-dirs)
-clean-files    := *.dtb
index 1894145..a9d5196 100644 (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
index ff81d7e..65af6f9 100644 (file)
@@ -8,4 +8,3 @@ dtb-$(CONFIG_ARCH_QCOM) += msm8996-mtp.dtb
 
 always         := $(dtb-y)
 subdir-y       := $(dts-dirs)
-clean-files    := *.dtb
index 8521e92..88cb515 100644 (file)
@@ -2,4 +2,3 @@ dtb-$(CONFIG_ARCH_REALTEK) += rtd1295-zidoo-x9s.dtb
 
 always         := $(dtb-y)
 subdir-y       := $(dts-dirs)
-clean-files    := *.dtb
index 381928b..960dade 100644 (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
index f1c9b13..6b6bb1d 100644 (file)
@@ -13,4 +13,3 @@ dtb-$(CONFIG_ARCH_ROCKCHIP) += rk3399-sapphire-excavator.dtb
 
 always         := $(dtb-y)
 subdir-y       := $(dts-dirs)
-clean-files    := *.dtb
index 4bc091b..5eed3ce 100644 (file)
@@ -6,4 +6,3 @@ dtb-$(CONFIG_ARCH_UNIPHIER) += \
        uniphier-pxs3-ref.dtb
 
 always         := $(dtb-y)
-clean-files    := *.dtb
index f0535e6..c91b62e 100644 (file)
@@ -3,4 +3,3 @@ dtb-$(CONFIG_ARCH_SPRD) += sc9836-openphone.dtb \
 
 always         := $(dtb-y)
 subdir-y       := $(dts-dirs)
-clean-files    := *.dtb
index ae16427..74e1956 100644 (file)
@@ -2,4 +2,3 @@ dtb-$(CONFIG_ARCH_ZYNQMP) += zynqmp-ep108.dtb
 
 always         := $(dtb-y)
 subdir-y       := $(dts-dirs)
-clean-files    := *.dtb
index d86c4de..71e0708 100644 (file)
@@ -3,4 +3,3 @@ dtb-$(CONFIG_ARCH_ZX) += zx296718-pcbox.dtb
 
 always         := $(dtb-y)
 subdir-y       := $(dts-dirs)
-clean-files    := *.dtb
index c7528b0..cb4874c 100644 (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
index faf69fb..4a97c7d 100644 (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
index 6c08467..6f3fe47 100644 (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
index 097c6da..83d5b88 100644 (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
index 91d2068..1cb84cf 100644 (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
index cbac26c..7891ffa 100644 (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
index d61bc2a..69a69d1 100644 (file)
@@ -40,4 +40,3 @@ obj-y                         += $(patsubst %.dtb, %.dtb.o, $(dtb-y))
 obj-                           += dummy.o
 
 always                         := $(dtb-y)
-clean-files                    := *.dtb *.dtb.S
index 5b99c40..a6fb331 100644 (file)
@@ -6,4 +6,3 @@ obj-y                           += $(patsubst %.dtb, %.dtb.o, $(dtb-y))
 obj-                           += dummy.o
 
 always                         := $(dtb-y)
-clean-files                    := *.dtb *.dtb.S
index 3d70958..135f987 100644 (file)
@@ -7,4 +7,3 @@ obj-$(CONFIG_MACH_PISTACHIO)    += pistachio_marduk.dtb.o
 obj-                           += dummy.o
 
 always                         := $(dtb-y)
-clean-files                    := *.dtb *.dtb.S
index f2b864f..e3d0ec1 100644 (file)
@@ -7,4 +7,3 @@ obj-y                           += $(patsubst %.dtb, %.dtb.o, $(dtb-y))
 obj-                           += dummy.o
 
 always                         := $(dtb-y)
-clean-files                    := *.dtb *.dtb.S
index 0906c62..5976f08 100644 (file)
@@ -6,4 +6,3 @@ obj-y                           += $(patsubst %.dtb, %.dtb.o, $(dtb-y))
 obj-                           += dummy.o
 
 always                         := $(dtb-y)
-clean-files                    := *.dtb *.dtb.S
index fcabd69..9a1a6dc 100644 (file)
@@ -7,4 +7,3 @@ obj-y                           += $(patsubst %.dtb, %.dtb.o, $(dtb-y))
 obj-                           += dummy.o
 
 always                         := $(dtb-y)
-clean-files                    := *.dtb *.dtb.S
index 9868057..6b2cf49 100644 (file)
@@ -10,4 +10,3 @@ obj-y                         += $(patsubst %.dtb, %.dtb.o, $(dtb-y))
 obj-                           += dummy.o
 
 always                         := $(dtb-y)
-clean-files                    := *.dtb *.dtb.S
index 66cfdff..094da72 100644 (file)
@@ -4,4 +4,3 @@ dtb-$(CONFIG_FIT_IMAGE_FDT_NI169445)    += 169445.dtb
 obj-                                   += dummy.o
 
 always                                 := $(dtb-y)
-clean-files                            := *.dtb *.dtb.S
index 7ac7905..0ee591b 100644 (file)
@@ -9,4 +9,3 @@ obj-y                           += $(patsubst %.dtb, %.dtb.o, $(dtb-y))
 obj-                           += dummy.o
 
 always                         := $(dtb-y)
-clean-files                    := *.dtb *.dtb.S
index 63a9ddf..87cf351 100644 (file)
@@ -9,4 +9,3 @@ dtb-$(CONFIG_ATH79)                     += ar9331_tl_mr3020.dtb
 obj-                           += dummy.o
 
 always                         := $(dtb-y)
-clean-files                    := *.dtb *.dtb.S
index 55e2937..e0e3a9d 100644 (file)
@@ -11,4 +11,3 @@ obj-y                         += $(patsubst %.dtb, %.dtb.o, $(dtb-y))
 obj-                           += dummy.o
 
 always                         := $(dtb-y)
-clean-files                    := *.dtb *.dtb.S
index 913a752..8b9ea11 100644 (file)
@@ -6,4 +6,3 @@ obj-y                           += $(patsubst %.dtb, %.dtb.o, $(dtb-y))
 obj-                           += dummy.o
 
 always                         := $(dtb-y)
-clean-files    := *.dtb *.dtb.S
index c899876..2ba23a6 100644 (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)"
index b092d30..0a5017c 100644 (file)
@@ -5,6 +5,4 @@ BUILTIN_DTB :=
 endif
 obj-y += $(BUILTIN_DTB)
 
-clean-files := *.dtb.S
-
 #DTC_FLAGS ?= -p 1024
index c4e6fe3..c3caa5b 100644 (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
index e5ce3a0..715def0 100644 (file)
@@ -1,3 +1 @@
 obj-$(CONFIG_USE_BUILTIN_DTB) += $(patsubst "%",%,$(CONFIG_BUILTIN_DTB_SOURCE)).dtb.o
-
-clean-files := *.dtb.S
index a15e241..c62dd6c 100644 (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
-