summaryrefslogtreecommitdiffstats
path: root/scripts/Makefile.build
diff options
context:
space:
mode:
authorMasahiro Yamada <yamada.m@jp.panasonic.com>2014-08-19 16:34:20 +0900
committerSascha Hauer <s.hauer@pengutronix.de>2014-11-27 15:42:07 +0100
commit22b3745f97cc0c9974dfdaa5d1ee05f3909f9f9c (patch)
treeeac368ca37d9927d89c37126de6104fe8942bfd7 /scripts/Makefile.build
parent0f1078d5cc9ce495ca44ed8d79bd6bd856954c5c (diff)
downloadbarebox-22b3745f97cc0c9974dfdaa5d1ee05f3909f9f9c.tar.gz
barebox-22b3745f97cc0c9974dfdaa5d1ee05f3909f9f9c.tar.xz
kbuild: handle multi-objs dependency appropriately
The comment in scripts/Makefile.build says as follows: We would rather have a list of rules like foo.o: $(foo-objs) but that's not so easy, so we rather make all composite objects depend on the set of all their parts This commit makes it possible! For example, assume a Makefile like this obj-m = foo.o bar.o foo-objs := foo1.o foo2.o bar-objs := bar1.o bar2.o Without this patch, foo.o depends on all of foo1.o foo2.o bar1.o bar2.o. It looks funny that foo.o is regenerated when bar1.c is updated. Now we can handle the dependency of foo.o and bar.o separately. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
Diffstat (limited to 'scripts/Makefile.build')
-rw-r--r--scripts/Makefile.build10
1 files changed, 4 insertions, 6 deletions
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index 4ef2c56a1b..56ee072065 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -367,16 +367,14 @@ cmd_link_multi-y = $(LD) $(ld_flags) -r -o $@ $(link_multi_deps)
quiet_cmd_link_multi-m = LD [M] $@
cmd_link_multi-m = $(LD) $(ld_flags) $(LDFLAGS_MODULE) -o $@ $(link_multi_deps)
-# We would rather have a list of rules like
-# foo.o: $(foo-objs)
-# but that's not so easy, so we rather make all composite objects depend
-# on the set of all their parts
-$(multi-used-y) : %.o: $(multi-objs-y) FORCE
+$(multi-used-y): FORCE
$(call if_changed,link_multi-y)
+$(call multi_depend, $(multi-used-y), .o, -objs -y)
-$(multi-used-m) : %.o: $(multi-objs-m) FORCE
+$(multi-used-m): FORCE
$(call if_changed,link_multi-m)
@{ echo $(@:.o=.ko); echo $(link_multi_deps); } > $(MODVERDIR)/$(@F:.o=.mod)
+$(call multi_depend, $(multi-used-m), .o, -objs -y)
targets += $(multi-used-y) $(multi-used-m)