kbuild: fix bugs in cleaning targets
authorMasahiro Yamada <yamada.m@jp.panasonic.com>
Fri, 28 Mar 2014 05:55:02 +0000 (14:55 +0900)
committerTom Rini <trini@ti.com>
Fri, 28 Mar 2014 19:06:32 +0000 (15:06 -0400)
"make clean", "make clobber", "make mrproper" and "make distclean"
missed to clean-up some files when they were run with
O=<some_dir> option.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Reported-by: Wolfgang Denk <wd@denx.de>
Makefile
dts/Makefile
scripts/Makefile.clean

index 341f336ce5e3c8ee3420cda78623f469dea1bcdd..e5f5a8cdc2435708a96bd128e7ec60e64d2de3f2 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1173,7 +1173,7 @@ MRPROPER_FILES += .config .config.old \
 clean: rm-dirs  := $(CLEAN_DIRS)
 clean: rm-files := $(CLEAN_FILES)
 
-clean-dirs     := $(foreach f,$(u-boot-alldirs),$(if $(wildcard $f/Makefile),$f))
+clean-dirs     := $(foreach f,$(u-boot-alldirs),$(if $(wildcard $(srctree)/$f/Makefile),$f))
 
 clean-dirs      := $(addprefix _clean_, $(clean-dirs) doc/DocBook)
 
index 9907463fc6344d524d9ea415db5112573c6e1a8b..e59550c9d2e6e06a8fb9f1f729db10358480ff64 100644 (file)
@@ -44,4 +44,4 @@ dtbs: $(obj)/dt.dtb
 clean-files := dt.dtb.S
 
 # Let clean descend into dts directories
-subdir- += ../arch/*/dts
+subdir- += ../arch/arm/dts ../arch/microblaze/dts ../arch/sandbox/dts ../arch/x86/dts
index 5cd0f51770a8d69112ef9337da2b130a62567012..d6dcd47f6f9742ff36c0d6fe1ebe43eabe1c2b5b 100644 (file)
@@ -39,7 +39,8 @@ subdir-ymn    := $(addprefix $(obj)/,$(subdir-ymn))
 
 # Temporal work-around for U-Boot
 
-subdir-ymn     := $(foreach f, $(subdir-ymn), $(if $(wildcard $f/Makefile),$f))
+subdir-ymn     := $(foreach f, $(subdir-ymn), \
+                               $(if $(wildcard $(srctree)/$f/Makefile),$f))
 
 # build a list of files to remove, usually relative to the current
 # directory