From: Sam Ravnborg <sam@ravnborg.org>
To: Andrew Morton <akpm@osdl.org>, linux-kernel@vger.kernel.org
Subject: [PATCH] kbuild: cleaning in three steps
Date: Fri, 9 Apr 2004 20:48:52 +0200 [thread overview]
Message-ID: <20040409184852.GA23602@mars.ravnborg.org> (raw)
Previously 'make clean' deleted all automatically generated files.
The following patch revert this behaviour, and now 'make clean'
leaves enough behind to allow external modules to be built.
The cleaning is now done in three steps:
make clean - delete everything not needed for building external modules
make mrproper - delete all generated files, including .config
make distclean - delete all temporary files such as *.orig, *~, *.rej etc.
This fixes reports about nvidia and wmware build issues.
--- linux-2.6.5/Makefile 2004-04-09 14:03:35.000000000 +0200
+++ mm3/Makefile 2004-04-09 20:42:47.000000000 +0200
@@ -767,39 +767,39 @@ endef
###
# Cleaning is done on three levels.
-# make clean Delete all automatically generated files, including
-# tools and firmware.
-# make mrproper Delete the current configuration, and related files
-# Any core files spread around are deleted as well
+# make clean Delete most generated files
+# Leave enough to build external modules
+# make mrproper Delete the current configuration, and all generated files
# make distclean Remove editor backup files, patch leftover files and the like
-# Directories & files removed with 'make clean'
-CLEAN_DIRS += $(MODVERDIR) include/config include2
-CLEAN_FILES += vmlinux System.map \
- include/linux/autoconf.h include/linux/version.h \
- include/asm include/linux/modversions.h \
- kernel.spec .tmp*
+quiet_cmd_rmdirs = $(if $(wildcard $(rm-dirs)),CLEAN $(wildcard $(rm-dirs)))
+ cmd_rmdirs = rm -rf $(rm-dirs)
-# Files removed with 'make mrproper'
-MRPROPER_FILES += .version .config .config.old tags TAGS cscope*
+quiet_cmd_rmfiles = $(if $(wildcard $(rm-files)),CLEAN $(wildcard $(rm-files)))
+ cmd_rmfiles = rm -f $(rm-files)
+
+# Directories & files removed with 'make clean'
+CLEAN_DIRS += $(MODVERDIR)
+CLEAN_FILES += vmlinux System.map kernel.spec \
+ .tmp_kallsyms* .tmp_version .tmp_vmlinux*
+
+# Directories & files removed with 'make mrproper'
+MRPROPER_DIRS += include/config include2
+MRPROPER_FILES += .config .config.old include/asm .version \
+ include/linux/autoconf.h include/linux/version.h \
+ include/linux/modversions.h \
+ tags TAGS cscope*
-# clean - Delete all intermediate files
+# clean - Delete most, but leave enough to build external modules
#
-clean-dirs += $(addprefix _clean_,$(ALL_SUBDIRS) Documentation/DocBook scripts)
-.PHONY: $(clean-dirs) clean archclean mrproper archmrproper distclean
+clean: rm-dirs := $(CLEAN_DIRS)
+clean: rm-files := $(CLEAN_FILES)
+clean-dirs := $(addprefix _clean_,$(ALL_SUBDIRS))
+
+.PHONY: $(clean-dirs) clean archclean
$(clean-dirs):
$(Q)$(MAKE) $(clean)=$(patsubst _clean_%,%,$@)
-clean: rm-dirs := $(wildcard $(CLEAN_DIRS))
-mrproper: rm-dirs := $(wildcard $(MRPROPER_DIRS))
-quiet_cmd_rmdirs = $(if $(rm-dirs),CLEAN $(rm-dirs))
- cmd_rmdirs = rm -rf $(rm-dirs)
-
-clean: rm-files := $(wildcard $(CLEAN_FILES))
-mrproper: rm-files := $(wildcard $(MRPROPER_FILES))
-quiet_cmd_rmfiles = $(if $(rm-files),CLEAN $(rm-files))
- cmd_rmfiles = rm -rf $(rm-files)
-
clean: archclean $(clean-dirs)
$(call cmd,rmdirs)
$(call cmd,rmfiles)
@@ -808,12 +808,25 @@ clean: archclean $(clean-dirs)
-o -name '.*.d' -o -name '.*.tmp' -o -name '*.mod.c' \) \
-type f -print | xargs rm -f
-# mrproper
+# mrproper - Delete all generated files, including .config
#
-distclean: mrproper
-mrproper: clean archmrproper
+mrproper: rm-dirs := $(wildcard $(MRPROPER_DIRS))
+mrproper: rm-files := $(wildcard $(MRPROPER_FILES))
+mrproper-dirs := $(addprefix _mrproper_,Documentation/DocBook scripts)
+
+.PHONY: $(mrproper-dirs) mrproper archmrproper
+$(mrproper-dirs):
+ $(Q)$(MAKE) $(clean)=$(patsubst _mrproper_%,%,$@)
+
+mrproper: clean archmrproper $(mrproper-dirs)
$(call cmd,rmdirs)
$(call cmd,rmfiles)
+
+# distclean
+#
+.PHONY: distclean
+
+distclean: mrproper
@find . $(RCS_FIND_IGNORE) \
\( -name '*.orig' -o -name '*.rej' -o -name '*~' \
-o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
reply other threads:[~2004-04-09 18:43 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20040409184852.GA23602@mars.ravnborg.org \
--to=sam@ravnborg.org \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®