Commit 0663c68c authored by Masahiro Yamada's avatar Masahiro Yamada

kbuild: remove {CLEAN,MRPROPER,DISTCLEAN}_DIRS

Merge {CLEAN,MRPROPER,DISTCLEAN}_DIRS into {CLEAN,MRPROPER,DISTCLEAN}_FILES
because the difference is just the -r option passed to the 'rm' command.

Do likewise as commit 1634f2bf ("kbuild: remove clean-dirs syntax").
Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
parent 610134b7
...@@ -1397,14 +1397,14 @@ endif # CONFIG_MODULES ...@@ -1397,14 +1397,14 @@ endif # CONFIG_MODULES
# make distclean Remove editor backup files, patch leftover files and the like # make distclean Remove editor backup files, patch leftover files and the like
# Directories & files removed with 'make clean' # Directories & files removed with 'make clean'
CLEAN_DIRS += include/ksym CLEAN_FILES += include/ksym \
CLEAN_FILES += modules.builtin modules.builtin.modinfo modules.nsdeps modules.builtin modules.builtin.modinfo modules.nsdeps
# Directories & files removed with 'make mrproper' # Directories & files removed with 'make mrproper'
MRPROPER_DIRS += include/config include/generated \ MRPROPER_FILES += include/config include/generated \
arch/$(SRCARCH)/include/generated .tmp_objdiff \ arch/$(SRCARCH)/include/generated .tmp_objdiff \
debian/ snap/ tar-install/ debian snap tar-install \
MRPROPER_FILES += .config .config.old .version \ .config .config.old .version \
Module.symvers \ Module.symvers \
signing_key.pem signing_key.priv signing_key.x509 \ signing_key.pem signing_key.priv signing_key.x509 \
x509.genkey extra_certificates signing_key.x509.keyid \ x509.genkey extra_certificates signing_key.x509.keyid \
...@@ -1412,12 +1412,10 @@ MRPROPER_FILES += .config .config.old .version \ ...@@ -1412,12 +1412,10 @@ MRPROPER_FILES += .config .config.old .version \
*.spec *.spec
# Directories & files removed with 'make distclean' # Directories & files removed with 'make distclean'
DISTCLEAN_DIRS +=
DISTCLEAN_FILES += tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS DISTCLEAN_FILES += tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS
# clean - Delete most, but leave enough to build external modules # clean - Delete most, but leave enough to build external modules
# #
clean: rm-dirs := $(CLEAN_DIRS)
clean: rm-files := $(CLEAN_FILES) clean: rm-files := $(CLEAN_FILES)
PHONY += archclean vmlinuxclean PHONY += archclean vmlinuxclean
...@@ -1430,7 +1428,6 @@ clean: archclean vmlinuxclean ...@@ -1430,7 +1428,6 @@ clean: archclean vmlinuxclean
# mrproper - Delete all generated files, including .config # mrproper - Delete all generated files, including .config
# #
mrproper: rm-dirs := $(wildcard $(MRPROPER_DIRS))
mrproper: rm-files := $(wildcard $(MRPROPER_FILES)) mrproper: rm-files := $(wildcard $(MRPROPER_FILES))
mrproper-dirs := $(addprefix _mrproper_,scripts) mrproper-dirs := $(addprefix _mrproper_,scripts)
...@@ -1439,18 +1436,15 @@ $(mrproper-dirs): ...@@ -1439,18 +1436,15 @@ $(mrproper-dirs):
$(Q)$(MAKE) $(clean)=$(patsubst _mrproper_%,%,$@) $(Q)$(MAKE) $(clean)=$(patsubst _mrproper_%,%,$@)
mrproper: clean $(mrproper-dirs) mrproper: clean $(mrproper-dirs)
$(call cmd,rmdirs)
$(call cmd,rmfiles) $(call cmd,rmfiles)
# distclean # distclean
# #
distclean: rm-dirs := $(wildcard $(DISTCLEAN_DIRS))
distclean: rm-files := $(wildcard $(DISTCLEAN_FILES)) distclean: rm-files := $(wildcard $(DISTCLEAN_FILES))
PHONY += distclean PHONY += distclean
distclean: mrproper distclean: mrproper
$(call cmd,rmdirs)
$(call cmd,rmfiles) $(call cmd,rmfiles)
@find $(srctree) $(RCS_FIND_IGNORE) \ @find $(srctree) $(RCS_FIND_IGNORE) \
\( -name '*.orig' -o -name '*.rej' -o -name '*~' \ \( -name '*.orig' -o -name '*.rej' -o -name '*~' \
...@@ -1740,7 +1734,6 @@ $(clean-dirs): ...@@ -1740,7 +1734,6 @@ $(clean-dirs):
$(Q)$(MAKE) $(clean)=$(patsubst _clean_%,%,$@) $(Q)$(MAKE) $(clean)=$(patsubst _clean_%,%,$@)
clean: $(clean-dirs) clean: $(clean-dirs)
$(call cmd,rmdirs)
$(call cmd,rmfiles) $(call cmd,rmfiles)
@find $(if $(KBUILD_EXTMOD), $(KBUILD_EXTMOD), .) $(RCS_FIND_IGNORE) \ @find $(if $(KBUILD_EXTMOD), $(KBUILD_EXTMOD), .) $(RCS_FIND_IGNORE) \
\( -name '*.[aios]' -o -name '*.ko' -o -name '.*.cmd' \ \( -name '*.[aios]' -o -name '*.ko' -o -name '.*.cmd' \
...@@ -1835,11 +1828,8 @@ tools/%: FORCE ...@@ -1835,11 +1828,8 @@ tools/%: FORCE
$(Q)mkdir -p $(objtree)/tools $(Q)mkdir -p $(objtree)/tools
$(Q)$(MAKE) LDFLAGS= MAKEFLAGS="$(tools_silent) $(filter --j% -j,$(MAKEFLAGS))" O=$(abspath $(objtree)) subdir=tools -C $(srctree)/tools/ $* $(Q)$(MAKE) LDFLAGS= MAKEFLAGS="$(tools_silent) $(filter --j% -j,$(MAKEFLAGS))" O=$(abspath $(objtree)) subdir=tools -C $(srctree)/tools/ $*
quiet_cmd_rmdirs = $(if $(wildcard $(rm-dirs)),CLEAN $(wildcard $(rm-dirs)))
cmd_rmdirs = rm -rf $(rm-dirs)
quiet_cmd_rmfiles = $(if $(wildcard $(rm-files)),CLEAN $(wildcard $(rm-files))) quiet_cmd_rmfiles = $(if $(wildcard $(rm-files)),CLEAN $(wildcard $(rm-files)))
cmd_rmfiles = rm -f $(rm-files) cmd_rmfiles = rm -rf $(rm-files)
# Run depmod only if we have System.map and depmod is executable # Run depmod only if we have System.map and depmod is executable
quiet_cmd_depmod = DEPMOD $(KERNELRELEASE) quiet_cmd_depmod = DEPMOD $(KERNELRELEASE)
......
...@@ -140,7 +140,7 @@ export CFLAGS_vmlinux := $(LINK-y) $(LINK_WRAPS) $(LD_FLAGS_CMDLINE) ...@@ -140,7 +140,7 @@ export CFLAGS_vmlinux := $(LINK-y) $(LINK_WRAPS) $(LD_FLAGS_CMDLINE)
# When cleaning we don't include .config, so we don't include # When cleaning we don't include .config, so we don't include
# TT or skas makefiles and don't clean skas_ptregs.h. # TT or skas makefiles and don't clean skas_ptregs.h.
CLEAN_FILES += linux x.i gmon.out CLEAN_FILES += linux x.i gmon.out
MRPROPER_DIRS += arch/$(SUBARCH)/include/generated MRPROPER_FILES += arch/$(SUBARCH)/include/generated
archclean: archclean:
@find . \( -name '*.bb' -o -name '*.bbg' -o -name '*.da' \ @find . \( -name '*.bb' -o -name '*.bbg' -o -name '*.da' \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment