[U-Boot] [PATCH] kbuild: fix bugs in cleaning targets

Masahiro Yamada yamada.m at jp.panasonic.com
Fri Mar 28 06:55:02 CET 2014


"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 at jp.panasonic.com>
Reported-by: Wolfgang Denk <wd at denx.de>
---

This bug was reported by Wolfgang.

Refer to this thread:
http://lists.denx.de/pipermail/u-boot/2014-March/175983.html


 Makefile               | 2 +-
 dts/Makefile           | 2 +-
 scripts/Makefile.clean | 3 ++-
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index 0522ba8..c744718 100644
--- 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)
 
diff --git a/dts/Makefile b/dts/Makefile
index 9907463..e59550c 100644
--- a/dts/Makefile
+++ b/dts/Makefile
@@ -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
diff --git a/scripts/Makefile.clean b/scripts/Makefile.clean
index 5cd0f51..d6dcd47 100644
--- a/scripts/Makefile.clean
+++ b/scripts/Makefile.clean
@@ -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
-- 
1.8.3.2



More information about the U-Boot mailing list