Commit 2dc25140 authored by Kai Germaschewski's avatar Kai Germaschewski

Rules.make cleanup

Get rid of traces of the old-style ALL_MOBJS variable.

This also fixes the following issue, which could cause a warning with
certain configs:

Makefiles (legally) do:

obj-$(CONFIG_SND_AD1848) += snd-pcm.o snd-timer.o snd.o
obj-$(CONFIG_SND_CS4231) += snd-pcm.o snd-timer.o snd.o snd-rawmidi.o

so when the first option is set to y, the second to m, we have e.g.
snd-pcm.o on both $(obj-y) and $(obj-m). We correctly don't build
the modular version in this case.

However, if snd-pcm.o was a multi-part object, we did automatically
generate a link rule for both the modular and the built-in version, 
which caused a warning - that's now fixed.
parent d0096496
......@@ -19,7 +19,6 @@ unexport SUB_DIRS
unexport ALL_SUB_DIRS
unexport MOD_SUB_DIRS
unexport O_TARGET
unexport ALL_MOBJS
unexport obj-y
unexport obj-m
......@@ -33,6 +32,12 @@ unexport subdir-
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.
#
......@@ -182,8 +187,7 @@ endif
#
# 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 @@ $(patsubst %,_modinst_%,$(MOD_DIRS)) : dummy
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)
cp $(obj-m) $(MODLIB)/kernel/$(MOD_DESTDIR)
endif
.PHONY: modules_install
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment