| Kernel v2.5.11 /Rules.make |
|---|
 2.5.11
 Rules.make
diff -Nru a/Rules.make b/Rules.make
--- a/Rules.make Sun Apr 28 20:10:35 2002
+++ b/Rules.make Sun Apr 28 20:10:35 2002
@@ -19,7 +19,6 @@
unexport ALL_SUB_DIRS
unexport MOD_SUB_DIRS
unexport O_TARGET
-unexport ALL_MOBJS
unexport obj-y
unexport obj-m
@@ -34,6 +33,12 @@
comma := ,
#
+# When an object is listed to be built compiled-in and modular,
+# only build the compiled-in version
+#
+obj-m := $(filter-out $(obj-y),$(obj-m))
+
+#
# Get things started.
#
first_rule: sub_dirs
@@ -182,8 +187,7 @@
#
# A rule to make modules
#
-ALL_MOBJS = $(filter-out $(obj-y), $(obj-m))
-ifneq "$(strip $(ALL_MOBJS))" ""
+ifneq "$(strip $(obj-m))" ""
MOD_DESTDIR := $(shell $(CONFIG_SHELL) $(TOPDIR)/scripts/pathdown.sh)
endif
@@ -200,14 +204,14 @@
endif
.PHONY: modules
-modules: $(ALL_MOBJS) dummy \
+modules: $(obj-m) dummy \
$(patsubst %,_modsubdir_%,$(MOD_DIRS))
.PHONY: _modinst__
_modinst__: dummy
-ifneq "$(strip $(ALL_MOBJS))" ""
+ifneq "$(strip $(obj-m))" ""
mkdir -p $(MODLIB)/kernel/$(MOD_DESTDIR)
- cp $(ALL_MOBJS) $(MODLIB)/kernel/$(MOD_DESTDIR)$(MOD_TARGET)
+ cp $(obj-m) $(MODLIB)/kernel/$(MOD_DESTDIR)
endif
.PHONY: modules_install
@@ -304,7 +308,8 @@
endif # CONFIG_MODVERSIONS
ifneq "$(strip $(export-objs))" ""
-$(export-objs): $(export-objs:.o=.c) $(TOPDIR)/include/linux/modversions.h
+$(export-objs): $(TOPDIR)/include/linux/modversions.h
+$(export-objs): %.o: %.c
$(CC) $(CFLAGS) $(EXTRA_CFLAGS) -DKBUILD_BASENAME=$(subst $(comma),_,$(subst -,_,$(*F))) $(CFLAGS_$@) -DEXPORT_SYMTAB -c $(@:.o=+
.c)
@ ( \
echo 'ifeq ($(strip $(subst $(comma),:,$(CFLAGS) $(EXTRA_CFLAGS) $(CFLAGS_$@) -DEXPORT_SYMTAB)),$$(strip $$(subst $$(comma),+
:,$$(CFLAGS) $$(EXTRA_CFLAGS) $$(CFLAGS_$@) -DEXPORT_SYMTAB)))' ; \
|