Commit 1b0c3109 authored by Sam Ravnborg's avatar Sam Ravnborg

kbuild: Made cmd_link_multi readable

Introduced ld_flags, and separated out the common parts of link_multi
for normal and module objects.
Added a bit of a comment as well
parent 8aba4e43
...@@ -236,11 +236,20 @@ endif ...@@ -236,11 +236,20 @@ endif
# #
# Rule to link composite objects # Rule to link composite objects
# #
# Composite objects are specified in kbuild makefile as follows:
# <composite-object>-objs := <list of .o files>
# or
# <composite-object>-y := <list of .o files>
link_multi_deps = \
$(filter $(addprefix $(obj)/, \
$($(subst $(obj)/,,$(@:.o=-objs))) \
$($(subst $(obj)/,,$(@:.o=-y)))), $^)
quiet_cmd_link_multi-y = LD $@ quiet_cmd_link_multi-y = LD $@
cmd_link_multi-y = $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) -r -o $@ $(filter $(addprefix $(obj)/,$($(subst $(obj)/,,$(@:.o=-objs))) $($(subst $(obj)/,,$(@:.o=-y)))),$^) cmd_link_multi-y = $(LD) $(ld_flags) -r -o $@ $(link_multi_deps)
quiet_cmd_link_multi-m = LD [M] $@ quiet_cmd_link_multi-m = LD [M] $@
cmd_link_multi-m = $(LD) $(LDFLAGS) $(EXTRA_LDFLAGS) $(LDFLAGS_MODULE) -o $@ $(filter $(addprefix $(obj)/,$($(subst $(obj)/,,$(@:.o=-objs))) $($(subst $(obj)/,,$(@:.o=-y)))),$^) cmd_link_multi-m = $(LD) $(ld_flags) $(LDFLAGS_MODULE) -o $@ $(link_multi_deps)
# We would rather have a list of rules like # We would rather have a list of rules like
# foo.o: $(foo-objs) # foo.o: $(foo-objs)
......
...@@ -128,6 +128,7 @@ hostc_flags = -Wp,-MD,$(depfile) $(HOSTCFLAGS) $(HOST_EXTRACFLAGS)\ ...@@ -128,6 +128,7 @@ hostc_flags = -Wp,-MD,$(depfile) $(HOSTCFLAGS) $(HOST_EXTRACFLAGS)\
$(HOSTCFLAGS_$(*F).o) $(HOSTCFLAGS_$(*F).o)
hostcxx_flags = -Wp,-MD,$(depfile) $(HOSTCXXFLAGS) $(HOST_EXTRACXXFLAGS)\ hostcxx_flags = -Wp,-MD,$(depfile) $(HOSTCXXFLAGS) $(HOST_EXTRACXXFLAGS)\
$(HOSTCXXFLAGS_$(*F).o) $(HOSTCXXFLAGS_$(*F).o)
ld_flags = $(LDFLAGS) $(EXTRA_LDFLAGS)
# Finds the multi-part object the current object will be linked into # Finds the multi-part object the current object will be linked into
modname-multi = $(sort $(foreach m,$(multi-used),\ modname-multi = $(sort $(foreach m,$(multi-used),\
......
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