]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - scripts/Makefile.clean
imx: gpmi: add debug[23] regs to struct gpmi_regs
[karo-tx-uboot.git] / scripts / Makefile.clean
index 5cd0f51770a8d69112ef9337da2b130a62567012..21e1f21531fd5b9a496f830ff21fefd2baf2f62b 100644 (file)
@@ -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-)