X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=scripts%2FMakefile.clean;h=21e1f21531fd5b9a496f830ff21fefd2baf2f62b;hb=1398252abf2aaf906832932401727c3538f74f46;hp=5cd0f51770a8d69112ef9337da2b130a62567012;hpb=efcf861931f987d82b11caed75b8c2ad9d709274;p=u-boot diff --git a/scripts/Makefile.clean b/scripts/Makefile.clean index 5cd0f51770..21e1f21531 100644 --- a/scripts/Makefile.clean +++ b/scripts/Makefile.clean @@ -10,7 +10,7 @@ __clean: # Shorthand for $(Q)$(MAKE) scripts/Makefile.clean obj=dir # Usage: # $(Q)$(MAKE) $(clean)=dir -clean := -f $(if $(KBUILD_SRC),$(srctree)/)scripts/Makefile.clean obj +clean := -f $(srctree)/scripts/Makefile.clean obj # The filename Kbuild has precedence over Makefile kbuild-dir := $(if $(filter /%,$(src)),$(src),$(srctree)/$(src)) @@ -23,15 +23,13 @@ __subdir-y := $(patsubst %/,%,$(filter %/, $(obj-y))) subdir-y += $(__subdir-y) __subdir-m := $(patsubst %/,%,$(filter %/, $(obj-m))) subdir-m += $(__subdir-m) -__subdir-n := $(patsubst %/,%,$(filter %/, $(obj-n))) -subdir-n += $(__subdir-n) __subdir- := $(patsubst %/,%,$(filter %/, $(obj-))) subdir- += $(__subdir-) # Subdirectories we need to descend into subdir-ym := $(sort $(subdir-y) $(subdir-m)) -subdir-ymn := $(sort $(subdir-ym) $(subdir-n) $(subdir-)) +subdir-ymn := $(sort $(subdir-ym) $(subdir-)) # Add subdir path @@ -39,13 +37,14 @@ 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 -__clean-files := $(extra-y) $(always) \ - $(targets) $(clean-files) \ +__clean-files := $(extra-y) $(extra-m) $(extra-) \ + $(always) $(targets) $(clean-files) \ $(host-progs) \ $(hostprogs-y) $(hostprogs-m) $(hostprogs-)