From bffaef246a5b838eb40a642463b1186935424fae Mon Sep 17 00:00:00 2001 From: "Torne (Richard Coles)" Date: Fri, 15 Jun 2012 16:03:52 +0100 Subject: [PATCH] Make building an empty static library work. Handle the case where a static library is not built because it has no input files (e.g. because they are conditionally included and it happens that the computed list is empty). Previously, ar never ran because of split-long-arguments, and anything that depended on the static library would fail to link. Make sure that ar runs at least once. Change-Id: If0071d7ae50c4e45fff1772dca43187af155db1f --- core/definitions.mk | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/definitions.mk b/core/definitions.mk index c3c4884f6..8607f0645 100644 --- a/core/definitions.mk +++ b/core/definitions.mk @@ -1058,11 +1058,13 @@ $(if $(2),$(hide) $(1) $(2)) endef # Split long argument list into smaller groups and call the command repeatedly +# Call the command at least once even if there are no arguments, as otherwise +# the output file won't be created. # # $(1): the command without arguments # $(2): the arguments define split-long-arguments -$(call _concat-if-arg2-not-empty,$(1),$(wordlist 1,500,$(2))) +$(hide) $(1) $(wordlist 1,500,$(2)) $(call _concat-if-arg2-not-empty,$(1),$(wordlist 501,1000,$(2))) $(call _concat-if-arg2-not-empty,$(1),$(wordlist 1001,1500,$(2))) $(call _concat-if-arg2-not-empty,$(1),$(wordlist 1501,2000,$(2))) -- 2.11.0