Commit 6bd04bb48715dc8e8f6d1a3389f886698bba0dc0

Authored by Masahiro Yamada
Committed by Tom Rini
1 parent 5a449d75bc

kbuild: fix bugs in cleaning targets

"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>

Showing 3 changed files with 4 additions and 3 deletions Side-by-side Diff

... ... @@ -1173,7 +1173,7 @@
1173 1173 clean: rm-dirs := $(CLEAN_DIRS)
1174 1174 clean: rm-files := $(CLEAN_FILES)
1175 1175  
1176   -clean-dirs := $(foreach f,$(u-boot-alldirs),$(if $(wildcard $f/Makefile),$f))
  1176 +clean-dirs := $(foreach f,$(u-boot-alldirs),$(if $(wildcard $(srctree)/$f/Makefile),$f))
1177 1177  
1178 1178 clean-dirs := $(addprefix _clean_, $(clean-dirs) doc/DocBook)
1179 1179  
... ... @@ -44,5 +44,5 @@
44 44 clean-files := dt.dtb.S
45 45  
46 46 # Let clean descend into dts directories
47   -subdir- += ../arch/*/dts
  47 +subdir- += ../arch/arm/dts ../arch/microblaze/dts ../arch/sandbox/dts ../arch/x86/dts
scripts/Makefile.clean
... ... @@ -39,7 +39,8 @@
39 39  
40 40 # Temporal work-around for U-Boot
41 41  
42   -subdir-ymn := $(foreach f, $(subdir-ymn), $(if $(wildcard $f/Makefile),$f))
  42 +subdir-ymn := $(foreach f, $(subdir-ymn), \
  43 + $(if $(wildcard $(srctree)/$f/Makefile),$f))
43 44  
44 45 # build a list of files to remove, usually relative to the current
45 46 # directory