Commit 03102fad authored by Kai Germaschewski's avatar Kai Germaschewski

Handle $(export-objs) ambiguity

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).
parent 274678d1
......@@ -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))
......
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