Commit 6bd04bb4 authored by Masahiro Yamada's avatar Masahiro Yamada Committed by Tom Rini

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: default avatarMasahiro Yamada <>
Reported-by: default avatarWolfgang Denk <>
parent 5a449d75
......@@ -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)
......@@ -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
......@@ -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
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment