kbuild: removing .tmp_versions considered harmful
authorPavel Roskin <proski@gnu.org>
Mon, 24 Apr 2006 19:55:27 +0000 (15:55 -0400)
committerSam Ravnborg <sam@mars.ravnborg.org>
Sun, 30 Apr 2006 21:48:03 +0000 (23:48 +0200)
Remove *.mod files but not .tmp_versions for external builds

When "make install" is run as root, .tmp_versions is re-created and
becomes owned by root.  Subsequent "make" run by user fails because
.tmp_versions cannot be removed.

Signed-off-by: Pavel Roskin <proski@gnu.org>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Makefile

index 6bf99624bd4c5705b4b5bd6f96385a012dc0a736..8517f7ba247318d7d722438be0cb6b80b92106c7 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -796,8 +796,8 @@ prepare2: prepare3 outputmakefile
 prepare1: prepare2 include/linux/version.h include/asm \
                    include/config/MARKER
 ifneq ($(KBUILD_MODULES),)
-       $(Q)rm -rf $(MODVERDIR)
        $(Q)mkdir -p $(MODVERDIR)
+       $(Q)rm -f $(MODVERDIR)/*
 endif
 
 archprepare: prepare1 scripts_basic
@@ -1086,8 +1086,8 @@ else # KBUILD_EXTMOD
 KBUILD_MODULES := 1
 PHONY += crmodverdir
 crmodverdir:
-       $(Q)rm -rf $(MODVERDIR)
        $(Q)mkdir -p $(MODVERDIR)
+       $(Q)rm -f $(MODVERDIR)/*
 
 PHONY += $(objtree)/Module.symvers
 $(objtree)/Module.symvers: