[PATCH] kbuild: clean and mrproper file list created dynamically 1/6

From: Sam Ravnborg (sam@ravnborg.org)
Date: Tue Sep 10 2002 - 16:01:57 EST


o Create infrastructure in Rules.make to allow the individual makefiles
to specify what files shall be deleted during clean and mrproper
o Add .clean and .mrproper to ignore list

        Sam

diff -Nru a/Rules.make b/Rules.make
--- a/Rules.make Tue Sep 10 22:37:37 2002
+++ b/Rules.make Tue Sep 10 22:37:37 2002
@@ -405,6 +405,27 @@
 
 targets += $(host-progs-single) $(host-progs-multi-objs) $(host-progs-multi)
 
+# Saved generated files that needs cleaning up later.
+# Filename are saved in $(objtree)/.clean and $(objtree)/.mrproper
+# When make clean or make mrproper is executed, the files listed
+# are deleted, and the file itselt is deleted.
+# To add files to the list set clean or mrproper equal to the
+# file, before inclusion of Rules.make. Rules.amke will prefix the
+# file with the full directory path.
+# ===========================================================================
+clean := $(addprefix $(CURDIR)/,$(clean))
+clean-file := $(objtree)/.clean
+tmp := $(if $(clean),\
+$(shell (if [ -f $(clean-file) ]; then cat $(clean-file); fi;\
+echo $(clean)) | sort -u > $(clean-file)))
+
+mrproper := $(addprefix $(CURDIR)/,$(mrproper) \
+$(host-progs-single) $(host-progs-multi) $(host-progs-multi-objs))
+mrproper-file := $(objtree)/.mrproper
+tmp := $(if $(mrproper),\
+$(shell (if [ -f $(mrproper-file) ]; then cat $(mrproper-file); fi;\
+echo $(mrproper)) | sort -u > $(mrproper-file)))
+
 endif # ! modules_install
 endif # ! fastdep
 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun Sep 15 2002 - 22:00:22 EST