aboutsummaryrefslogtreecommitdiffstats
path: root/Rules.make
diff options
context:
space:
mode:
authordavem <davem>1997-01-16 14:11:44 +0000
committerdavem <davem>1997-01-16 14:11:44 +0000
commit21989bcc87778e7fd28fdf73733d362b724051db (patch)
treee847e3ec80ff4ec659d94b6efd2f1f580a58f39e /Rules.make
parentbf548fb1d1e26a3fa52e5d0e7ae1352dc60eeaff (diff)
downloadnetdev-vger-cvs-21989bcc87778e7fd28fdf73733d362b724051db.tar.gz
Merge to 2.1.21
Diffstat (limited to 'Rules.make')
-rw-r--r--Rules.make58
1 files changed, 30 insertions, 28 deletions
diff --git a/Rules.make b/Rules.make
index 8614f8aa1..87a0d671d 100644
--- a/Rules.make
+++ b/Rules.make
@@ -67,7 +67,7 @@ ifneq "$(strip $(ALL_O))" ""
else
$(AR) rcs $@
endif
-endif
+endif # O_TARGET
#
# Rule to compile a set of .o files into one .a file
@@ -146,57 +146,59 @@ script:
# Separate the object into "normal" objects and "exporting" objects
# Exporting objects are: all objects that define symbol tables
#
-ifdef CONFIG_MODVERSIONS
+ifdef CONFIG_MODULES
+
SYMTAB_OBJS = $(LX_OBJS) $(OX_OBJS) $(MX_OBJS)
+
+ifdef CONFIG_MODVERSIONS
ifneq "$(strip $(SYMTAB_OBJS))" ""
MODINCL = $(TOPDIR)/include/linux/modules
-# The -w option (enable warnings) for /bin/genksyms will return here in 2.1
+# The -w option (enable warnings) for genksyms will return here in 2.1
$(MODINCL)/%.ver: %.c
- @if [ ! -x /sbin/genksyms ]; then echo "Please read: Documentation/modules.txt"; fi
- $(CC) $(CFLAGS) -E -D__GENKSYMS__ $< | /sbin/genksyms $(MODINCL)
-
+ $(CC) $(CFLAGS) -E -D__GENKSYMS__ $<\
+ | $(GENKSYMS) -k $(VERSION).$(PATCHLEVEL).$(SUBLEVEL) > $@.tmp
+ mv $@.tmp $@
+
$(addprefix $(MODINCL)/,$(SYMTAB_OBJS:.o=.ver)): $(TOPDIR)/include/linux/autoconf.h
$(TOPDIR)/include/linux/modversions.h: $(addprefix $(MODINCL)/,$(SYMTAB_OBJS:.o=.ver))
@echo updating $(TOPDIR)/include/linux/modversions.h
- @(echo "#ifdef MODVERSIONS";\
- echo "#undef CONFIG_MODVERSIONS";\
- echo "#define CONFIG_MODVERSIONS";\
- echo "#ifndef _set_ver";\
- echo "#define _set_ver(sym,vers) sym ## _R ## vers";\
- echo "#endif";\
- cd $(TOPDIR)/include/linux/modules; for f in *.ver;\
- do echo "#include <linux/modules/$${f}>"; done; \
- echo "#undef CONFIG_MODVERSIONS";\
- echo "#endif") \
- > $(TOPDIR)/include/linux/modversions.h
-
-$(MX_OBJS): $(TOPDIR)/include/linux/modversions.h
- $(CC) $(CFLAGS) -DEXPORT_SYMTAB -c $(@:.o=.c)
-
-$(LX_OBJS) $(OX_OBJS): $(TOPDIR)/include/linux/modversions.h
- $(CC) $(CFLAGS) -DMODVERSIONS -DEXPORT_SYMTAB -c $(@:.o=.c)
+ @(echo "#ifndef _LINUX_MODVERSIONS_H";\
+ echo "#define _LINUX_MODVERSIONS_H"; \
+ echo "#include <linux/modsetver.h>"; \
+ cd $(TOPDIR)/include/linux/modules; \
+ for f in *.ver; do \
+ if [ -f $$f ]; then echo "#include <linux/modules/$${f}>"; fi; \
+ done; \
+ echo "#endif"; \
+ ) > $@
dep fastdep: $(TOPDIR)/include/linux/modversions.h
-endif
+endif # SYMTAB_OBJS
+
$(M_OBJS): $(TOPDIR)/include/linux/modversions.h
ifdef MAKING_MODULES
$(O_OBJS) $(L_OBJS): $(TOPDIR)/include/linux/modversions.h
endif
-# This is needed to ensure proper dependency for multipart modules such as
-# fs/ext.o. (Otherwise, not all subobjects will be recompiled when
-# version information changes.)
else
$(TOPDIR)/include/linux/modversions.h:
- @touch $(TOPDIR)/include/linux/modversions.h
+ @echo "#include <linux/modsetver.h>" > $@
+endif # CONFIG_MODVERSIONS
+
+ifneq "$(strip $(SYMTAB_OBJS))" ""
+$(SYMTAB_OBJS): $(TOPDIR)/include/linux/modversions.h
+ $(CC) $(CFLAGS) -DEXPORT_SYMTAB -c $(@:.o=.c)
endif
+endif # CONFIG_MODULES
+
+
#
# include dependency files they exist
#