Sophie

Sophie

distrib > Mandriva > 2009.1 > x86_64 > media > contrib-backports-src > by-pkgid > c6ad31d7ff8a5bcd66ca46f414148eee > files > 5

kernel-tmb-2.6.31.8-1mdv2009.1.src.rpm

Really don't remove bounds.h and asm-offsets.h with make clean

Even after commit 7d3cc8b6d899e53222c22a78d98bb53a695f7962, bounds.h and
asm-offsets.h are still deleted with make clean. Turns out that always and
targets lists are always added to __clean-files inside scripts/Makefile.clean,
making clean-files inside root Kbuild file not having any effect. To allow
bounds.h and asm-offsets.h to stay after a make clean, the better way I found
for now is to create a new always_noclean list and use it where necessary.

Signed-off-by: Herton Ronaldo Krzesinski <herton@mandriva.com.br>

diff -Nurp linux-2.6.31-rc2-git4-tmb1/Kbuild linux-2.6.31-rc2-git4-tmb1-devel/Kbuild
--- linux-2.6.31-rc2-git4-tmb1/Kbuild	2009-06-10 06:05:27.000000000 +0300
+++ linux-2.6.31-rc2-git4-tmb1-devel/Kbuild	2009-07-10 03:55:25.000000000 +0300
@@ -10,8 +10,8 @@
 
 bounds-file := include/linux/bounds.h
 
-always  := $(bounds-file)
-targets := $(bounds-file) kernel/bounds.s
+always_noclean := $(bounds-file)
+targets := kernel/bounds.s
 
 quiet_cmd_bounds = GEN     $@
 define cmd_bounds
@@ -45,8 +45,7 @@ $(obj)/$(bounds-file): kernel/bounds.s K
 
 offsets-file := include/asm/asm-offsets.h
 
-always  += $(offsets-file)
-targets += $(offsets-file)
+always_noclean += $(offsets-file)
 targets += arch/$(SRCARCH)/kernel/asm-offsets.s
 
 
@@ -93,6 +92,3 @@ quiet_cmd_syscalls = CALL    $<
 PHONY += missing-syscalls
 missing-syscalls: scripts/checksyscalls.sh FORCE
 	$(call cmd,syscalls)
-
-# Delete all targets during make clean
-clean-files := $(addprefix $(objtree)/,$(filter-out $(bounds-file) $(offsets-file),$(targets)))
diff -Nurp linux-2.6.31-rc2-git4-tmb1/scripts/Makefile.build linux-2.6.31-rc2-git4-tmb1-devel/scripts/Makefile.build
--- linux-2.6.31-rc2-git4-tmb1/scripts/Makefile.build	2009-06-10 06:05:27.000000000 +0300
+++ linux-2.6.31-rc2-git4-tmb1-devel/scripts/Makefile.build	2009-07-10 03:55:25.000000000 +0300
@@ -15,6 +15,7 @@ obj-m :=
 lib-y :=
 lib-m :=
 always :=
+always_noclean :=
 targets :=
 subdir-y :=
 subdir-m :=
@@ -92,7 +93,7 @@ modorder-target := $(obj)/modules.order
 
 __build: $(if $(KBUILD_BUILTIN),$(builtin-target) $(lib-target) $(extra-y)) \
 	 $(if $(KBUILD_MODULES),$(obj-m) $(modorder-target)) \
-	 $(subdir-ym) $(always)
+	 $(subdir-ym) $(always) $(always_noclean)
 	@:
 
 # Linus' kernel sanity checking tool
@@ -264,7 +265,7 @@ $(obj)/%.o: $(src)/%.S FORCE
 	$(call if_changed_dep,as_o_S)
 
 targets += $(real-objs-y) $(real-objs-m) $(lib-y)
-targets += $(extra-y) $(MAKECMDGOALS) $(always)
+targets += $(extra-y) $(MAKECMDGOALS) $(always) $(always_noclean)
 
 # Linker scripts preprocessor (.lds.S -> .lds)
 # ---------------------------------------------------------------------------