Linux Headquarters
[ Register ]
[ About us ] [ Home Page ]

[ Kernel ] [ Documentation ] [ Links ] [ Books ]

Advertisement

Kernel v2.5.20 /Rules.make

Filename:/Rules.make
Lines Added:20
Lines Deleted:25
Also changed in: (Previous) 2.5.19  2.5.18  2.5.17  2.5.13  2.5.11  2.5.9 
(Following) 2.5.21  2.5.22  2.5.23  2.5.24  2.5.25  2.5.30 

Location
[  2.5.20
   o  Rules.make

Patch

diff -Nru a/Rules.make b/Rules.make
--- a/Rules.make   Sun Jun  2 18:44:57 2002
+++ b/Rules.make   Sun Jun  2 18:44:57 2002
@@ -291,9 +291,6 @@
 #
 ifdef CONFIG_MODULES
 
-multi-objs   := $(foreach m, $(obj-y) $(obj-m), $($(basename $(m))-objs))
-active-objs   := $(sort $(multi-objs) $(obj-y) $(obj-m))
-
 ifdef CONFIG_MODVERSIONS
 ifneq "$(strip $(export-objs))" ""
 
@@ -311,38 +308,37 @@
    genksyms_smp_prefix := 
 endif
 
-$(MODINCL)/$(MODPREFIX)%.ver: %.c
-   @if [ ! -r $(MODINCL)/$(MODPREFIX)$*.stamp -o $(MODINCL)/$(MODPREFIX)$*.stamp -ot $< ]; then \
-      echo '$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -E -D__GENKSYMS__ $<'; \
-      echo '| $(GENKSYMS) $(genksyms_smp_prefix) -k $(VERSION).$(PATCHLEVEL).$(SUBLEVEL) > $@.tmp'; \
-      $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -E -D__GENKSYMS__ $< \
-      | $(GENKSYMS) $(genksyms_smp_prefix) -k $(VERSION).$(PATCHLEVEL).$(SUBLEVEL) > $@.tmp; \
-      if [ -r $@ ] && cmp -s $@ $@.tmp; then echo $@ is unchanged; rm -f $@.tmp; \
-      else echo mv $@.tmp $@; mv -f $@.tmp $@; fi; \
-   fi; touch $(MODINCL)/$(MODPREFIX)$*.stamp
+# We don't track dependencies for .ver files, so we FORCE to check
+# them always (i.e. always at "make dep" time).
+
+cmd_create_ver = $(CC) $(CFLAGS) $(EXTRA_CFLAGS) -E -D__GENKSYMS__ $< | \
+       $(GENKSYMS) $(genksyms_smp_prefix) -k $(VERSION).$(PATCHLEVEL).$(SUBLEVEL) > $@.tmp
 
-$(addprefix $(MODINCL)/$(MODPREFIX),$(export-objs:.o=.ver)): $(TOPDIR)/include/linux/autoconf.h
+$(MODINCL)/$(MODPREFIX)%.ver: %.c FORCE
+   @echo $(cmd_create_ver)
+   @$(cmd_create_ver)
+   @if [ -r $@ ] && cmp -s $@ $@.tmp; then \
+     echo $@ is unchanged; rm -f $@.tmp; \
+   else \
+     echo mv $@.tmp $@; mv -f $@.tmp $@; \
+   fi
 
 # updates .ver files but not modversions.h
 fastdep: $(addprefix $(MODINCL)/$(MODPREFIX),$(export-objs:.o=.ver))
 
 endif # export-objs 
 
-$(active-objs): $(TOPDIR)/include/linux/modversions.h
+# make dep cannot correctly figure out the dependency on the generated
+# modversions.h, so we list them here:
+# o files which export symbols and are compiled into the kernel include
+#   it (to generate a correct symbol table)
+# o all modules get compiled with -include modversions.h
 
-else
-
-$(TOPDIR)/include/linux/modversions.h:
-   @echo "#include <linux/modsetver.h>" > $@
+$(filter $(export-objs),$(real-objs-y)): $(TOPDIR)/include/linux/modversions.h
+$(real-objs-m): $(TOPDIR)/include/linux/modversions.h
 
 endif # CONFIG_MODVERSIONS
 
-ifneq "$(strip $(export-objs))" ""
-
-$(export-objs): $(TOPDIR)/include/linux/modversions.h
-
-endif
-
 endif # CONFIG_MODULES
 
 #
@@ -400,4 +396,3 @@
                 $(filter-out $($(1)),$(cmd_$(@F)))\
            $(filter-out $(cmd_$(@F)),$($(1)))),\
           @echo '$($(1))' && $($(1)) && echo 'cmd_$@ := $($(1))' > $(@D)/.$(@F).cmd)
-


Comments: webmaster (at) linuxhq.com.
Advertising: banners (at) linuxhq.com.
Compilation ©1998-2008 Linux Headquarters, Inc.