]> git.hungrycats.org Git - linux/commitdiff
Handle $(export-objs) ambiguity
authorKai Germaschewski <kai@tp1.ruhr-uni-bochum.de>
Tue, 16 Apr 2002 04:15:37 +0000 (23:15 -0500)
committerKai Germaschewski <kai@tp1.ruhr-uni-bochum.de>
Tue, 16 Apr 2002 04:15:37 +0000 (23:15 -0500)
We use the makefile variable $(foo-objs) to list the objects
a composed module foo.o is supposed to be composed of.

We use the special varible $(export-objs) to list the object files which
export symbols.

This oviously clashes in the case of foo == export. There's basically
two ways to handle it: (1) rename one of these options, like
foo-objs to foo-parts or something, or (2) simply disallow a composite
object called export.o, so you never need $(export-objs) to list its
parts.

As (1) would affect basically all Makefiles in the tree and (2) doesn't
seem much of a limitation, I went for (2).

Rules.make

index 05858896c186197f7f01c7313419f31270e5fd53..763dbfe29a4cd888e5a590984e3eb02e3073ffd0 100644 (file)
@@ -126,8 +126,10 @@ endif
 
 # for make >= 3.78 the following is cleaner:
 # multi-used := $(foreach m,$(obj-y) $(obj-m), $(if $($(basename $(m))-objs), $(m)))
-multi-used-y := $(sort $(foreach m,$(obj-y),$(patsubst %,$(m),$($(basename $(m))-objs))))
-multi-used-m := $(sort $(foreach m,$(obj-m),$(patsubst %,$(m),$($(basename $(m))-objs))))
+__obj-y = $(filter-out export.o,$(obj-y))
+__obj-m = $(filter-out export.o,$(obj-m))
+multi-used-y := $(sort $(foreach m,$(__obj-y),$(patsubst %,$(m),$($(basename $(m))-objs))))
+multi-used-m := $(sort $(foreach m,$(__obj-m),$(patsubst %,$(m),$($(basename $(m))-objs))))
 ld-multi-used-y := $(filter-out $(list-multi),$(multi-used-y))
 ld-multi-used-m := $(filter-out $(list-multi),$(multi-used-m))
 ld-multi-objs-y := $(foreach m, $(ld-multi-used-y), $($(basename $(m))-objs))