summaryrefslogtreecommitdiff
path: root/Makerules
diff options
context:
space:
mode:
authorBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2012-03-13 19:49:38 +0100
committerBernhard Reutner-Fischer <rep.dot.nop@gmail.com>2012-03-13 19:49:38 +0100
commitdd44bf943894b4a830c6007dfde0ee7c07ff0edd (patch)
treedceed493212453ab515514cd9debba135e63cae6 /Makerules
parentda4ef5cf6a195d42339e2e6901c43f7566219ed3 (diff)
buildsys: do not add empty obj to archives
Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
Diffstat (limited to 'Makerules')
-rw-r--r--Makerules6
1 files changed, 5 insertions, 1 deletions
diff --git a/Makerules b/Makerules
index 7153836cf..a215334ef 100644
--- a/Makerules
+++ b/Makerules
@@ -50,6 +50,10 @@ all_objs: $(ar_objs)
endif
$(shared_objs) $(ar_objs): | $(sub_headers)
+define objects_with_syms
+ $(foreach o,$(2),$(if $(shell $(NM) $(1) $(o) | grep .),$(o)))
+endef
+
headers-y: $(headers-y)
@true
@@ -243,7 +247,7 @@ cmd_compile.mi= $(cmd_compile.m:-c=-E -dD) $(UCLIBC_EXTRA_CPPFLAGS)
cmd_compile-m = $(CC) $^ -c -o $@ $(CFLAGS) $(CFLAGS-$(suffix $@)) $(CFLAGS-$(notdir $(@D))) $(CFLAGS-$(notdir $@)) $(sort $(foreach d,$(^:$(top_srcdir)=),$(collect_multi_flags)))
cmd_strip = $(STRIPTOOL) $(STRIP_FLAGS) $^
cmd_t_strip = $(STRIPTOOL) $(STRIP_FLAGS) $@
-cmd_ar = $(AR) $(ARFLAGS) $@ $^
+cmd_ar = $(AR) $(ARFLAGS) $@ $(call objects_with_syms,,$^)
define do_ln
@$(disp_ln)