From c47f214ac65a45597917e017b7a1c617a56ac1cb Mon Sep 17 00:00:00 2001 From: Michal Marek Date: Fri, 3 Sep 2010 15:00:22 +0200 Subject: kbuild: Do not run make clean in $(srctree) Signed-off-by: Michal Marek --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index b98943a466c..d71bfdee7fb 100644 --- a/Makefile +++ b/Makefile @@ -1180,7 +1180,7 @@ MRPROPER_FILES += .config .config.old .version .old_version \ # clean: rm-dirs := $(CLEAN_DIRS) clean: rm-files := $(CLEAN_FILES) -clean-dirs := $(addprefix _clean_,$(srctree) $(vmlinux-alldirs) Documentation) +clean-dirs := $(addprefix _clean_, . $(vmlinux-alldirs) Documentation) PHONY += $(clean-dirs) clean archclean $(clean-dirs): -- cgit v1.2.3-18-g5258 From 88d7be031f9f975bb3f50a0b5ef3796a671e7edf Mon Sep 17 00:00:00 2001 From: Michal Marek Date: Mon, 6 Sep 2010 12:00:08 +0200 Subject: kbuild: Use a single clean rule for kernel and external modules The list of patterns for the external modules case was constantly lagging behind. Signed-off-by: Michal Marek --- Makefile | 31 ++++++++++++------------------- 1 file changed, 12 insertions(+), 19 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index d71bfdee7fb..414a6469728 100644 --- a/Makefile +++ b/Makefile @@ -1186,15 +1186,7 @@ PHONY += $(clean-dirs) clean archclean $(clean-dirs): $(Q)$(MAKE) $(clean)=$(patsubst _clean_%,%,$@) -clean: archclean $(clean-dirs) - $(call cmd,rmdirs) - $(call cmd,rmfiles) - @find . $(RCS_FIND_IGNORE) \ - \( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \ - -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \ - -o -name '*.symtypes' -o -name 'modules.order' \ - -o -name modules.builtin -o -name '.tmp_*.o.*' \ - -o -name '*.gcno' \) -type f -print | xargs rm -f +clean: archclean # mrproper - Delete all generated files, including .config # @@ -1392,16 +1384,7 @@ $(clean-dirs): $(Q)$(MAKE) $(clean)=$(patsubst _clean_%,%,$@) clean: rm-dirs := $(MODVERDIR) -clean: rm-files := $(KBUILD_EXTMOD)/Module.symvers \ - $(KBUILD_EXTMOD)/modules.order \ - $(KBUILD_EXTMOD)/modules.builtin -clean: $(clean-dirs) - $(call cmd,rmdirs) - $(call cmd,rmfiles) - @find $(KBUILD_EXTMOD) $(RCS_FIND_IGNORE) \ - \( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \ - -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \ - -o -name '*.gcno' \) -type f -print | xargs rm -f +clean: rm-files := $(KBUILD_EXTMOD)/Module.symvers help: @echo ' Building external modules.' @@ -1418,6 +1401,16 @@ prepare: ; scripts: ; endif # KBUILD_EXTMOD +clean: $(clean-dirs) + $(call cmd,rmdirs) + $(call cmd,rmfiles) + @find $(or $(KBUILD_EXTMOD), .) $(RCS_FIND_IGNORE) \ + \( -name '*.[oas]' -o -name '*.ko' -o -name '.*.cmd' \ + -o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \ + -o -name '*.symtypes' -o -name 'modules.order' \ + -o -name modules.builtin -o -name '.tmp_*.o.*' \ + -o -name '*.gcno' \) -type f -print | xargs rm -f + # Generate tags for editors # --------------------------------------------------------------------------- quiet_cmd_tags = GEN $@ -- cgit v1.2.3-18-g5258