Sophie

Sophie

distrib > Mandriva > 2009.0 > i586 > by-pkgid > 955755413b690d027a5fcf418c0ecafc > files > 5

kernel-tmb-2.6.27.46-1mdv2009.0.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 -p -up linux-2.6.26-desktop-0.rc8.1mnb/Kbuild.orig linux-2.6.26-desktop-0.rc8.1mnb/Kbuild
--- linux-2.6.26-desktop-0.rc8.1mnb/Kbuild.orig	2008-07-09 20:58:49.000000000 -0300
+++ linux-2.6.26-desktop-0.rc8.1mnb/Kbuild	2008-07-09 21:03:40.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-$(SRCARCH)/asm-offsets.h
 
-always  += $(offsets-file)
-targets += $(offsets-file)
+always_noclean += $(offsets-file)
 targets += arch/$(SRCARCH)/kernel/asm-offsets.s
 
 
@@ -94,6 +93,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 -p -up linux-2.6.26-desktop-0.rc8.1mnb/scripts/Makefile.build.orig linux-2.6.26-desktop-0.rc8.1mnb/scripts/Makefile.build
--- linux-2.6.26-desktop-0.rc8.1mnb/scripts/Makefile.build.orig	2008-07-09 20:52:39.000000000 -0300
+++ linux-2.6.26-desktop-0.rc8.1mnb/scripts/Makefile.build	2008-07-09 21:02:51.000000000 -0300
@@ -15,6 +15,7 @@ obj-m :=
 lib-y :=
 lib-m :=
 always :=
+always_noclean :=
 targets :=
 subdir-y :=
 subdir-m :=
@@ -89,7 +90,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
@@ -249,7 +250,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)
 # ---------------------------------------------------------------------------