[PATCH] 2.5.40 kbuild bug: mrproper removes files it shouldn't remove

Mikael Pettersson (mikpe@csd.uu.se)
Mon, 7 Oct 2002 18:08:24 +0200 (MET DST)


'make mrproper' incorrectly deletes *~-style editor backup files
from the top-level directory. This bug was introduced in 2.5.29
when the top-level Makefile was changed to remain in the top-level
directory when invoking DocBook's Makefile:

(snippet from patch-2.5.29):
>--- a/Makefile Fri Jul 26 19:58:50 2002
>+++ b/Makefile Fri Jul 26 19:58:50 2002
>@@ -650,7 +650,7 @@
> -name .\*.tmp -o -name .\*.d \) -type f -print \
> | grep -v lxdialog/ | xargs rm -f
> @rm -f $(CLEAN_FILES)
>- @$(MAKE) -C Documentation/DocBook clean
>+ @$(MAKE) -f Documentation/DocBook/Makefile clean
>
> mrproper: clean archmrproper
> @echo 'Making mrproper'

The problem is that DocBook's 'make clean' rule contains

clean:
@echo 'Cleaning up (DocBook)'
@rm -f core *~

so the rm now removes files from the wrong directory. Not good.

Since the top-level Makefile removes all core files, I suggest
simply removing the problematic rm line. Patch below.

/Mikael

--- linux-2.5.40/Documentation/DocBook/Makefile.~1~ Sat Aug 3 00:40:00 2002
+++ linux-2.5.40/Documentation/DocBook/Makefile Mon Oct 7 17:05:16 2002
@@ -155,7 +155,6 @@

clean:
@echo 'Cleaning up (DocBook)'
- @rm -f core *~
@rm -f $(BOOKS)
@rm -f $(DVI) $(AUX) $(TEX) $(LOG) $(OUT)
@rm -f $(PNG-parportbook) $(EPS-parportbook)
-
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/