2.3.25-pre1: "make clean" blows away modules directory

Michael Elizabeth Chastain (mec@shout.net)
Fri, 29 Oct 1999 02:49:07 -0500


I noticed this change to 'make clean' in 2.3.25-1:

@@ -392,10 +392,8 @@
rm -f drivers/sound/bin2hex drivers/sound/hex2hex
rm -f net/khttpd/make_times_h
rm -f net/khttpd/times.h
- if [ -d modules ]; then \
- rm -f core `find modules/ -type f -print`; \
- fi
rm -f submenu*
+ rm -rf modules

I like this, but there's a bug. If I do these commands, I don't
have a modules/ directory:

make oldconfig
make dep
make clean
make bzImage
make modules

I think that the "modules" target should create the directory as
needed. I've attached a patch to do this. It works for me; could
somebody please test it? (How about the person who did the first
patch to Makefile?)

Michael Elizabeth Chastain
<mailto:mec@shout.net>
"love without fear"

===

diff -u -r -N linux-2.3.25-1/Makefile linux/Makefile
--- linux-2.3.25-1/Makefile Fri Oct 29 00:35:44 1999
+++ linux/Makefile Fri Oct 29 00:34:13 1999
@@ -250,9 +250,6 @@
symlinks:
rm -f include/asm
( cd include ; ln -sf asm-$(ARCH) asm)
- @if [ ! -d modules ]; then \
- mkdir modules; \
- fi
@if [ ! -d include/linux/modules ]; then \
mkdir include/linux/modules; \
fi
@@ -331,7 +328,11 @@

modules: $(patsubst %, _mod_%, $(SUBDIRS))

-$(patsubst %, _mod_%, $(SUBDIRS)) : include/linux/version.h include/config/MARKER
+modules/MARKER:
+ mkdir modules
+ touch modules/MARKER
+
+$(patsubst %, _mod_%, $(SUBDIRS)) : include/linux/version.h include/config/MARKER modules/MARKER
$(MAKE) -C $(patsubst _mod_%, %, $@) CFLAGS="$(CFLAGS) $(MODFLAGS)" MAKING_MODULES=1 modules

modules_install:

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/