Re: CONFIG_MODVERSIONS problem identified

From: Mikael Pettersson (mikpe@csd.uu.se)
Date: Thu Jul 27 2000 - 07:54:09 EST


I wrote:

>Possible solutions:
>...
>C. Change the Linux kernel to work around this problem. We either:
> C1. forcibly remake modversions.h in each subdir's `fastdep', or
> C2. don't create modversions.h at all in the subdirs, but only
> once in the toplevel Makefile after doing dep-files.
>
>I'll do a patch to implement solution C1, unless someone has
>a much better idea.

I had a couple of requests to go with C2 instead of C1, since
it has less overhead and works better with parallel makes.
The patch below implements solution C2 as described above.
I've tested it in different configurations wrt CONFIG_MODULES
and CONFIG_MODVERSIONS, and it seems to work ok.

/Mikael

--- linux-2.4.0-test5-pre6/Makefile.~1~ Thu Jul 27 13:15:00 2000
+++ linux-2.4.0-test5-pre6/Makefile Thu Jul 27 13:44:47 2000
@@ -442,10 +442,11 @@
 MODVERFILE := $(TOPDIR)/include/linux/modversions.h
 else
 MODVERFILE :=
+update-modverfile:
 endif
 export MODVERFILE
 
-depend dep: dep-files $(MODVERFILE)
+depend dep: dep-files update-modverfile
 
 # make checkconfig: Prune 'scripts' directory to avoid "false positives".
 checkconfig:
--- linux-2.4.0-test5-pre6/Rules.make.~1~ Sat Jul 1 00:13:51 2000
+++ linux-2.4.0-test5-pre6/Rules.make Thu Jul 27 13:45:09 2000
@@ -215,7 +215,21 @@
         
 $(addprefix $(MODINCL)/,$(SYMTAB_OBJS:.o=.ver)): $(TOPDIR)/include/linux/autoconf.h
 
-$(TOPDIR)/include/linux/modversions.h: $(addprefix $(MODINCL)/,$(SYMTAB_OBJS:.o=.ver))
+# updates .ver files but not modversions.h -- used by top-level 'make dep'
+fastdep: $(addprefix $(MODINCL)/,$(SYMTAB_OBJS:.o=.ver))
+
+# updates .ver files and modversions.h like before (is this needed?)
+dep: fastdep update-modverfile
+
+endif # SYMTAB_OBJS
+
+# forcibly remake modversions.h
+update-modverfile: rm-modverfile $(TOPDIR)/include/linux/modversions.h
+
+rm-modverfile:
+ @rm -f $(TOPDIR)/include/linux/modversions.h
+
+$(TOPDIR)/include/linux/modversions.h:
         @echo updating $(TOPDIR)/include/linux/modversions.h
         @(echo "#ifndef _LINUX_MODVERSIONS_H";\
           echo "#define _LINUX_MODVERSIONS_H"; \
@@ -226,10 +240,6 @@
           done; \
           echo "#endif"; \
         ) > $@
-
-dep fastdep: $(TOPDIR)/include/linux/modversions.h
-
-endif # SYMTAB_OBJS
 
 $(M_OBJS): $(TOPDIR)/include/linux/modversions.h
 ifdef MAKING_MODULES

-
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/



This archive was generated by hypermail 2b29 : Mon Jul 31 2000 - 21:00:23 EST