xref: /aoo42x/main/solenv/gbuild/LinkTarget.mk (revision 48bea759)
1#**************************************************************
2#
3#  Licensed to the Apache Software Foundation (ASF) under one
4#  or more contributor license agreements.  See the NOTICE file
5#  distributed with this work for additional information
6#  regarding copyright ownership.  The ASF licenses this file
7#  to you under the Apache License, Version 2.0 (the
8#  "License"); you may not use this file except in compliance
9#  with the License.  You may obtain a copy of the License at
10#
11#    http://www.apache.org/licenses/LICENSE-2.0
12#
13#  Unless required by applicable law or agreed to in writing,
14#  software distributed under the License is distributed on an
15#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16#  KIND, either express or implied.  See the License for the
17#  specific language governing permissions and limitations
18#  under the License.
19#
20#**************************************************************
21
22
23
24#the following user-defined variables are supported:
25# CPPFLAGS
26# CFLAGS
27# CXXFLAGS
28# OBJCXXFLAGS
29# JAVAFLAGS
30# LDFLAGS
31
32# CFLAGS from environment override debug/optimization flags
33
34ifeq ($(gb_DEBUGGING),TRUE)
35CFLAGS ?= $(gb_COMPILEROPTFLAGS) $(gb_DEBUG_CFLAGS)
36CXXFLAGS ?= $(gb_COMPILEROPTFLAGS) $(gb_DEBUG_CFLAGS)
37OBJCXXFLAGS ?= $(gb_COMPILEROPTFLAGS) $(gb_DEBUG_CFLAGS)
38JAVAFLAGS ?= -g
39else
40CFLAGS ?= $(gb_COMPILEROPTFLAGS)
41CXXFLAGS ?= $(gb_COMPILEROPTFLAGS)
42OBJCXXFLAGS ?= $(gb_COMPILEROPTFLAGS)
43endif
44
45
46# For every object there is a dep file (if gb_FULLDEPS is active).
47# The dep file depends on the object: the Object__command also updates the
48# dep file as a side effect.
49# In the dep file rule just touch it so it's newer than the object.
50
51# The gb_Object__command_dep generates an "always rebuild" dep file;
52# It is _only_ used in case the user deletes the object dep file.
53ifeq ($(gb_FULLDEPS),$(true))
54define gb_Object__command_dep
55mkdir -p $(dir $(1)) && \
56	echo '$(2) : $$(gb_Helper_PHONY)' > $(1)
57
58endef
59else
60gb_Object__command_dep = \
61 $(call gb_Output_error,gb_Object__command_dep is only for gb_FULLDEPS)
62endif
63
64
65# CObject class
66
67gb_CObject_REPOS := $(gb_REPOS)
68
69gb_CObject_get_source = $(1)/$(2).c
70# defined by platform
71#  gb_CObject__command
72
73define gb_CObject__rules
74$$(call gb_CObject_get_target,%) : $$(call gb_CObject_get_source,$(1),%)
75	$$(call gb_CObject__command,$$@,$$*,$$<,$$(call gb_CObject_get_dep_target,$$*))
76
77ifeq ($(gb_FULLDEPS),$(true))
78$$(call gb_CObject_get_dep_target,%) : $$(call gb_CObject_get_target,%)
79	$$(if $$(wildcard $$@),touch $$@,\
80	  $$(call gb_Object__command_dep,$$@,$$(call gb_CObject_get_target,$$*)))
81endif
82
83endef
84
85$(foreach repo,$(gb_CObject_REPOS),$(eval $(call gb_CObject__rules,$(repo))))
86
87$(call gb_CObject_get_dep_target,%) :
88	$(eval $(call gb_Output_error,Unable to find plain C file $(call gb_CObject_get_source,,$*) in the repositories: $(gb_CObject_REPOS)))
89
90gb_CObject_CObject =
91
92
93# CxxObject class
94
95gb_CxxObject_REPOS := $(gb_REPOS)
96
97gb_CxxObject_get_source = $(1)/$(2).cxx
98# defined by platform
99#  gb_CxxObject__command
100
101# Only enable PCH if the PCH_CXXFLAGS and the PCH_DEFS (from the linktarget)
102# are the same as the T_CXXFLAGS and DEFS we want to use for this object. This
103# should usually be the case.  The DEFS/T_CXXFLAGS would have too be manually
104# overridden for one object file for them to differ.  PCH_CXXFLAGS/PCH_DEFS
105# should never be overridden on an object -- they should be the same as for the
106# whole linktarget. In general it should be cleaner to use a static library
107# compiled with different flags and link that in rather than mixing different
108# flags in one linktarget.
109define gb_CxxObject__set_pchflags
110ifeq ($(gb_ENABLE_PCH),$(true))
111ifneq ($(strip $$(PCH_NAME)),)
112ifeq ($$(sort $$(PCH_CXXFLAGS) $$(PCH_DEFS) $$(gb_LinkTarget_EXCEPTIONFLAGS)),$$(sort $$(T_CXXFLAGS) $$(CXXFLAGS) $$(DEFS)))
113$$@ : PCHFLAGS := $$(call gb_PrecompiledHeader_get_enableflags,$$(PCH_NAME))
114else
115ifeq ($$(sort $$(PCH_CXXFLAGS) $$(PCH_DEFS) $$(gb_LinkTarget_NOEXCEPTIONFLAGS)),$$(sort $$(T_CXXFLAGS) $$(CXXFLAGS) $$(DEFS)))
116$$@ : PCHFLAGS := $$(call gb_NoexPrecompiledHeader_get_enableflags,$$(PCH_NAME))
117else
118$$(info No precompiled header available for $$*.)
119$$(info precompiled header flags (  ex) : $$(sort $$(PCH_CXXFLAGS) $$(PCH_DEFS) $$(gb_LinkTarget_EXCEPTIONFLAGS)))
120$$(info precompiled header flags (noex) : $$(sort $$(PCH_CXXFLAGS) $$(PCH_DEFS) $$(gb_LinkTarget_NOEXCEPTIONFLAGS)))
121$$(info .           object flags        : $$(sort $$(T_CXXFLAGS) $$(DEFS)))
122$$@ : PCHFLAGS :=
123endif
124endif
125endif
126endif
127endef
128
129define gb_CxxObject__rules
130$$(call gb_CxxObject_get_target,%) : $$(call gb_CxxObject_get_source,$(1),%)
131	$$(eval $$(gb_CxxObject__set_pchflags))
132	$$(call gb_CxxObject__command,$$@,$$*,$$<,$$(call gb_CxxObject_get_dep_target,$$*))
133
134ifeq ($(gb_FULLDEPS),$(true))
135$$(call gb_CxxObject_get_dep_target,%) : $$(call gb_CxxObject_get_target,%)
136	$$(if $$(wildcard $$@),touch $$@,\
137	  $$(eval $$(gb_CxxObject__set_pchflags))\
138	  $$(call gb_Object__command_dep,$$@,$$(call gb_CxxObject_get_target,$$*)))
139endif
140
141endef
142
143$(foreach repo,$(gb_CxxObject_REPOS),$(eval $(call gb_CxxObject__rules,$(repo))))
144
145ifeq ($(gb_FULLDEPS),$(true))
146$(call gb_CxxObject_get_dep_target,%) :
147	$(eval $(call gb_Output_error,Unable to find C++ file $(call gb_CxxObject_get_source,,$*) in repositories: $(gb_CxxObject_REPOS)))
148
149endif
150
151gb_CxxObject_CxxObject =
152
153
154# GenCxxObject class
155
156gb_GenCxxObject_get_source = $(WORKDIR)/$(1).cxx
157# defined by platform
158#  gb_CxxObject__command
159
160$(call gb_GenCxxObject_get_target,%) : $(call gb_GenCxxObject_get_source,%)
161	$(call gb_CxxObject__command,$@,$*,$<,$(call gb_GenCxxObject_get_dep_target,$*))
162
163ifeq ($(gb_FULLDEPS),$(true))
164$(call gb_GenCxxObject_get_dep_target,%) : $(call gb_GenCxxObject_get_target,%)
165	$(if $(wildcard $@),touch $@,\
166	  $(call gb_Object__command_dep,$@,$(call gb_GenCxxObject_get_target,$*)))
167endif
168
169gb_GenCxxObject_GenCxxObject =
170
171
172# ObjCxxObject class
173#
174gb_ObjCxxObject_REPOS := $(gb_REPOS)
175
176gb_ObjCxxObject_get_source = $(1)/$(2).mm
177# defined by platform
178#  gb_ObjCxxObject__command
179
180define gb_ObjCxxObject__rules
181$$(call gb_ObjCxxObject_get_target,%) : $$(call gb_ObjCxxObject_get_source,$(1),%)
182	$$(call gb_ObjCxxObject__command,$$@,$$*,$$<,$$(call gb_ObjCxxObject_get_dep_target,$$*))
183
184ifeq ($(gb_FULLDEPS),$(true))
185$$(call gb_ObjCxxObject_get_dep_target,%) : $$(call gb_ObjCxxObject_get_target,%)
186	$$(if $$(wildcard $$@),touch $$@,\
187	  $$(call gb_Object__command_dep,$$@,$$(call gb_ObjCxxObject_get_target,$$*)))
188endif
189
190endef
191
192$(foreach repo,$(gb_ObjCxxObject_REPOS),$(eval $(call gb_ObjCxxObject__rules,$(repo))))
193
194ifeq ($(gb_FULLDEPS),$(true))
195$(call gb_ObjCxxObject_get_dep_target,%) :
196	$(eval $(call gb_Output_error,Unable to find Objective C++ file $(call gb_ObjCxxObject_get_source,,$*) in repositories: $(gb_ObjCxxObject_REPOS)))
197endif
198
199gb_ObjCxxObject_ObjCxxObject =
200
201
202
203# LinkTarget class
204
205gb_LinkTarget_DEFAULTDEFS := $(gb_GLOBALDEFS)
206# defined by platform
207#  gb_LinkTarget_CXXFLAGS
208#  gb_LinkTarget_LDFLAGS
209#  gb_LinkTarget_INCLUDE
210#  gb_LinkTarget_INCLUDE_STL
211
212.PHONY : $(call gb_LinkTarget_get_clean_target,%)
213$(call gb_LinkTarget_get_clean_target,%) :
214	$(call gb_Output_announce,$*,$(false),LNK,4)
215	RESPONSEFILE=$(call var2file,$(shell $(gb_MKTEMP)),200,\
216		$(foreach object,$(COBJECTS),$(call gb_CObject_get_target,$(object))) \
217		$(foreach object,$(COBJECTS),$(call gb_CObject_get_dep_target,$(object))) \
218		$(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_target,$(object))) \
219		$(foreach object,$(CXXOBJECTS),$(call gb_CxxObject_get_dep_target,$(object))) \
220		$(foreach object,$(OBJCXXOBJECTS),$(call gb_ObjCxxObject_get_target,$(object))) \
221		$(foreach object,$(OBJCXXOBJECTS),$(call gb_ObjCxxObject_get_dep_target,$(object))) \
222		$(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_target,$(object))) \
223		$(foreach object,$(GENCXXOBJECTS),$(call gb_GenCxxObject_get_dep_target,$(object))) \
224		$(call gb_LinkTarget_get_target,$*) \
225		$(call gb_LinkTarget_get_dep_target,$*) \
226		$(call gb_LinkTarget_get_headers_target,$*) \
227		$(call gb_LinkTarget_get_external_headers_target,$*) \
228		$(DLLTARGET) \
229		$(AUXTARGETS)) && \
230	cat $${RESPONSEFILE} /dev/null | xargs -n 200 rm -f && \
231	rm -f $${RESPONSEFILE}
232
233
234# cat the deps of all objects in one file, then we need only open that one file
235define gb_LinkTarget__command_dep
236$(call gb_Output_announce,LNK:$(2),$(true),DEP,1)
237$(call gb_Helper_abbreviate_dirs,\
238	mkdir -p $(dir $(1)) && \
239	RESPONSEFILE=$(call var2file,$(shell $(gb_MKTEMP)),200,\
240		$(foreach object,$(3),$(call gb_CObject_get_dep_target,$(object))) \
241		$(foreach object,$(4),$(call gb_CxxObject_get_dep_target,$(object))) \
242		$(foreach object,$(5),$(call gb_ObjCxxObject_get_dep_target,$(object)))\
243		$(foreach object,$(6),$(call gb_GenCxxObject_get_dep_target,$(object)))\
244		) && \
245	cat $${RESPONSEFILE} /dev/null | xargs -n 200 cat > $(1)) && \
246	rm -f $${RESPONSEFILE}
247
248endef
249
250$(call gb_LinkTarget_get_target,%) : $(call gb_LinkTarget_get_headers_target,%) $(gb_Helper_MISCDUMMY)
251	$(call gb_LinkTarget__command,$@,$*)
252
253ifeq ($(gb_FULLDEPS),$(true))
254$(call gb_LinkTarget_get_target,%) : $(call gb_LinkTarget_get_dep_target,%)
255$(call gb_LinkTarget_get_dep_target,%) : | $(call gb_LinkTarget_get_headers_target,%)
256	$(call gb_LinkTarget__command_dep,$@,$*,$(COBJECTS),$(CXXOBJECTS),$(OBJCXXOBJECTS),$(GENCXXOBJECTS))
257endif
258
259# Ok, this is some dark voodoo: When declaring a linktarget with
260# gb_LinkTarget_LinkTarget we set SELF in the headertarget to name of the
261# target. When the rule for the headertarget is executed and SELF does not
262# match the target name, we are depending on a linktarget that was never
263# declared. In a full build exclusively in gbuild that should never happen.
264# However, partial gbuild build will not know about how to build lower level
265# linktargets, just as gbuild can not know about linktargets generated in the
266# old build.pl/dmake system. Once all is migrated, gbuild should error out
267# when is is told to depend on a linktarget it does not know about and not
268# only warn.
269define gb_LinkTarget__get_external_headers_check
270ifneq ($$(SELF),$$*)
271$$(eval $$(call gb_Output_info,LinkTarget $$* not defined: Assuming headers to be there!,ALL))
272endif
273$$@ : COMMAND := $$(call gb_Helper_abbreviate_dirs, mkdir -p $$(dir $$@) && touch $$@ && mkdir -p $(call gb_LinkTarget_get_target,)pdb/$$(dir $$*))
274
275endef
276
277$(call gb_LinkTarget_get_external_headers_target,%) :
278	$(eval $(gb_LinkTarget__get_external_headers_check))
279	$(COMMAND)
280
281$(call gb_LinkTarget_get_headers_target,%) : $(call gb_LinkTarget_get_external_headers_target,%)
282	$(call gb_Helper_abbreviate_dirs,\
283		mkdir -p $(dir $@) && touch $@)
284
285# Explanation of some of the targets:
286# - gb_LinkTarget_get_external_headers_target is the targets that guarantees all
287#   headers from linked against libraries are in OUTDIR.
288# - gb_LinkTarget_get_headers_target is the target that guarantees all headers
289#   from the linked against the libraries and the linktargets own headers
290#   (including generated headers) are in the OUTDIR.
291# - gb_LinkTarget_get_target links the objects into a file in WORKDIR.
292# gb_LinkTarget_get_target depends on gb_LinkTarget_get_headers_target which in
293# turn depends gb_LinkTarget_get_external_headers_target.
294# gb_LinkTarget_get_target depends additionally on the objects, which in turn
295# depend build-order only on the gb_LinkTarget_get_headers_target. The build
296# order-only dependency ensures all headers to be there for compiling and
297# dependency generation without causing all objects to be rebuild when one
298# header changes. Only the ones with an explicit dependency in their generated
299# dependency file will be rebuild.
300#
301# gb_LinkTarget_get_target is the target that links the objects into a file in
302# WORKDIR
303# Explanation of some of the variables:
304# - AUXTARGETS are the additionally generated files that need to be cleaned out
305#   on clean.
306# - PCH_CXXFLAGS and PCH_DEFS are the flags that the precompiled headers will
307#   be compiled with.  They should never be overridden in a single object
308#   files.
309# - TARGETTYPE is the type of linktarget as some platforms need very different
310#   command to link different targettypes.
311# - VERSIONMAP is the linker script, usually used to version a dynamic
312#   library's symbols (on *nix/Mac).
313#
314# Since most variables are set on the linktarget and not on the object, the
315# object learns about these setting via GNU makes scoping of target variables.
316# Therefore it is important that objects are only directly depended on by the
317# linktarget. This for example means that you cannot build a single object
318# alone, because then you would directly depend on the object.
319#
320# A note about flags: because the overriding the global variables with a target
321# local variable of the same name is considered obscure, the target local
322# variables have a T_ prefix.
323define gb_LinkTarget_LinkTarget
324$(call gb_LinkTarget_get_clean_target,$(1)) : AUXTARGETS :=
325$(call gb_LinkTarget_get_external_headers_target,$(1)) : SELF := $(1)
326$(call gb_LinkTarget_get_target,$(1)) : DLLTARGET :=
327$(call gb_LinkTarget_get_clean_target,$(1)) \
328$(call gb_LinkTarget_get_target,$(1)) : COBJECTS :=
329$(call gb_LinkTarget_get_clean_target,$(1)) \
330$(call gb_LinkTarget_get_target,$(1)) : CXXOBJECTS :=
331$(call gb_LinkTarget_get_clean_target,$(1)) \
332$(call gb_LinkTarget_get_target,$(1)) : OBJCXXOBJECTS :=
333$(call gb_LinkTarget_get_clean_target,$(1)) \
334$(call gb_LinkTarget_get_target,$(1)) : GENCXXOBJECTS :=
335$(call gb_LinkTarget_get_headers_target,$(1)) \
336$(call gb_LinkTarget_get_target,$(1)) : T_CFLAGS := $$(gb_LinkTarget_CFLAGS)
337$(call gb_LinkTarget_get_headers_target,$(1)) \
338$(call gb_LinkTarget_get_target,$(1)) : T_CXXFLAGS := $$(gb_LinkTarget_CXXFLAGS)
339$(call gb_LinkTarget_get_headers_target,$(1)) \
340$(call gb_LinkTarget_get_target,$(1)) : PCH_CXXFLAGS := $$(gb_LinkTarget_CXXFLAGS) $$(CXXFLAGS)
341$(call gb_LinkTarget_get_target,$(1)) : T_OBJCXXFLAGS := $$(gb_LinkTarget_OBJCXXFLAGS)
342$(call gb_LinkTarget_get_headers_target,$(1)) \
343$(call gb_LinkTarget_get_target,$(1)) : DEFS := $$(gb_LinkTarget_DEFAULTDEFS) $(CPPFLAGS)
344$(call gb_LinkTarget_get_headers_target,$(1)) \
345$(call gb_LinkTarget_get_target,$(1)) : PCH_DEFS := $$(gb_LinkTarget_DEFAULTDEFS) $(CPPFLAGS)
346$(call gb_LinkTarget_get_headers_target,$(1)) \
347$(call gb_LinkTarget_get_target,$(1)) : INCLUDE := $$(gb_LinkTarget_INCLUDE)
348$(call gb_LinkTarget_get_headers_target,$(1)) \
349$(call gb_LinkTarget_get_target,$(1)) : INCLUDE_STL := $$(gb_LinkTarget_INCLUDE_STL)
350$(call gb_LinkTarget_get_target,$(1)) : T_LDFLAGS := $$(gb_LinkTarget_LDFLAGS) $(LDFLAGS)
351$(call gb_LinkTarget_get_target,$(1)) : LINKED_LIBS :=
352$(call gb_LinkTarget_get_target,$(1)) : LINKED_STATIC_LIBS :=
353$(call gb_LinkTarget_get_target,$(1)) : EXTERNAL_LIBS :=
354$(call gb_LinkTarget_get_target,$(1)) : LIBS :=
355$(call gb_LinkTarget_get_target,$(1)) : TARGETTYPE :=
356$(call gb_LinkTarget_get_target,$(1)) : VERSIONMAP :=
357$(call gb_LinkTarget_get_headers_target,$(1)) \
358$(call gb_LinkTarget_get_target,$(1)) : PCH_NAME :=
359$(call gb_LinkTarget_get_target,$(1)) : PCHOBJS :=
360#$(call gb_LinkTarget_get_headers_target,$(1)) \
361#$(call gb_LinkTarget_get_target,$(1)) : PDBFILE :=
362$(call gb_LinkTarget_get_target,$(1)) : NATIVERES :=
363
364ifeq ($(gb_FULLDEPS),$(true))
365-include $(call gb_LinkTarget_get_dep_target,$(1))
366$(call gb_LinkTarget_get_dep_target,$(1)) : COBJECTS :=
367$(call gb_LinkTarget_get_dep_target,$(1)) : CXXOBJECTS :=
368$(call gb_LinkTarget_get_dep_target,$(1)) : OBJCXXOBJECTS :=
369$(call gb_LinkTarget_get_dep_target,$(1)) : GENCXXOBJECTS :=
370$(call gb_LinkTarget_get_dep_target,$(1)) : T_CFLAGS := $$(gb_LinkTarget_CFLAGS)
371$(call gb_LinkTarget_get_dep_target,$(1)) : T_CXXFLAGS := $$(gb_LinkTarget_CXXFLAGS)
372$(call gb_LinkTarget_get_dep_target,$(1)) : PCH_CXXFLAGS := $$(gb_LinkTarget_CXXFLAGS) $$(CXXFLAGS)
373$(call gb_LinkTarget_get_dep_target,$(1)) : T_OBJCXXFLAGS := $$(gb_LinkTarget_OBJCXXFLAGS)
374$(call gb_LinkTarget_get_dep_target,$(1)) : DEFS := $$(gb_LinkTarget_DEFAULTDEFS) $(CPPFLAGS)
375$(call gb_LinkTarget_get_dep_target,$(1)) : PCH_DEFS := $$(gb_LinkTarget_DEFAULTDEFS) $(CPPFLAGS)
376$(call gb_LinkTarget_get_dep_target,$(1)) : INCLUDE := $$(gb_LinkTarget_INCLUDE)
377$(call gb_LinkTarget_get_dep_target,$(1)) : INCLUDE_STL := $$(gb_LinkTarget_INCLUDE_STL)
378$(call gb_LinkTarget_get_dep_target,$(1)) : TARGETTYPE :=
379$(call gb_LinkTarget_get_dep_target,$(1)) : VERSIONMAP :=
380$(call gb_LinkTarget_get_dep_target,$(1)) : PCH_NAME :=
381endif
382
383endef
384
385define gb_LinkTarget_add_defs
386$(call gb_LinkTarget_get_headers_target,$(1)) \
387$(call gb_LinkTarget_get_target,$(1)) : DEFS += $(2)
388$(call gb_LinkTarget_get_headers_target,$(1)) \
389$(call gb_LinkTarget_get_target,$(1)) : PCH_DEFS += $(2)
390ifeq ($(gb_FULLDEPS),$(true))
391$(call gb_LinkTarget_get_dep_target,$(1)) : DEFS += $(2)
392$(call gb_LinkTarget_get_dep_target,$(1)) : PCH_DEFS += $(2)
393endif
394endef
395
396define gb_LinkTarget_set_defs
397ifeq (,)
398$$(call gb_Output_error,\
399 gb_LinkTarget_set_defs: use gb_LinkTarget_add_defs instead.)
400else
401$(call gb_LinkTarget_get_headers_target,$(1)) \
402$(call gb_LinkTarget_get_target,$(1)) : DEFS := $(2)
403$(call gb_LinkTarget_get_headers_target,$(1)) \
404$(call gb_LinkTarget_get_target,$(1)) : PCH_DEFS := $(2)
405
406ifeq ($(gb_FULLDEPS),$(true))
407$(call gb_LinkTarget_get_dep_target,$(1)) : DEFS := $(2)
408$(call gb_LinkTarget_get_dep_target,$(1)) : PCH_DEFS := $(2)
409endif
410endif
411
412endef
413
414define gb_LinkTarget_add_cflags
415$(call gb_LinkTarget_get_target,$(1)) : T_CFLAGS += $(2)
416ifeq ($(gb_FULLDEPS),$(true))
417$(call gb_LinkTarget_get_dep_target,$(1)) : T_CFLAGS += $(2)
418endif
419
420endef
421
422define gb_LinkTarget_set_cflags
423ifeq (,)
424$$(call gb_Output_error,\
425 gb_LinkTarget_set_cflags: use gb_LinkTarget_add_cflags instead.)
426else
427$(call gb_LinkTarget_get_target,$(1)) : T_CFLAGS := $(2)
428ifeq ($(gb_FULLDEPS),$(true))
429$(call gb_LinkTarget_get_dep_target,$(1)) : T_CFLAGS := $(2)
430endif
431endif
432
433endef
434
435define gb_LinkTarget_add_cxxflags
436$(call gb_LinkTarget_get_headers_target,$(1)) \
437$(call gb_LinkTarget_get_target,$(1)) : T_CXXFLAGS += $(2)
438$(call gb_LinkTarget_get_headers_target,$(1)) \
439$(call gb_LinkTarget_get_target,$(1)) : PCH_CXXFLAGS += $(2)
440ifeq ($(gb_FULLDEPS),$(true))
441$(call gb_LinkTarget_get_dep_target,$(1)) : T_CXXFLAGS += $(2)
442$(call gb_LinkTarget_get_dep_target,$(1)) : PCH_CXXFLAGS += $(2)
443endif
444endef
445
446define gb_LinkTarget_set_cxxflags
447ifeq (,)
448$$(call gb_Output_error,\
449 gb_LinkTarget_set_cxxflags: use gb_LinkTarget_add_cxxflags instead.)
450else
451$(call gb_LinkTarget_get_headers_target,$(1)) \
452$(call gb_LinkTarget_get_target,$(1)) : T_CXXFLAGS := $(2)
453$(call gb_LinkTarget_get_headers_target,$(1)) \
454$(call gb_LinkTarget_get_target,$(1)) : PCH_CXXFLAGS := $(2)
455ifeq ($(gb_FULLDEPS),$(true))
456$(call gb_LinkTarget_get_dep_target,$(1)) : T_CXXFLAGS := $(2)
457$(call gb_LinkTarget_get_dep_target,$(1)) : PCH_CXXFLAGS := $(2)
458endif
459endif
460
461endef
462
463define gb_LinkTarget_add_objcxxflags
464$(call gb_LinkTarget_get_target,$(1)) : T_OBJCXXFLAGS += $(2)
465ifeq ($(gb_FULLDEPS),$(true))
466$(call gb_LinkTarget_get_dep_target,$(1)) : T_OBJCXXFLAGS += $(2)
467endif
468endef
469
470define gb_LinkTarget_set_objcxxflags
471ifeq (,)
472$$(call gb_Output_error,\
473 gb_LinkTarget_set_objcxxflags: use gb_LinkTarget_add_objcxxflags instead.)
474else
475$(call gb_LinkTarget_get_target,$(1)) : T_OBJCXXFLAGS := $(2)
476ifeq ($(gb_FULLDEPS),$(true))
477$(call gb_LinkTarget_get_dep_target,$(1)) : T_OBJCXXFLAGS := $(2)
478endif
479endif
480endef
481
482define gb_LinkTarget_set_c_optimization
483$(foreach object,$(1),$(eval $(call gb_CObject_get_target,$(object)) : CFLAGS := $(filter-out $(gb_COMPILEROPTFLAGS),$(CFLAGS)) $(2)))
484endef
485
486define gb_LinkTarget_set_cxx_optimization
487$(foreach object,$(1),$(eval $(call gb_CxxObject_get_target,$(object)) : CXXFLAGS := $(filter-out $(gb_COMPILEROPTFLAGS),$(CXXFLAGS)) $(2)))
488endef
489
490define gb_LinkTarget_set_gencxx_optimization
491$(foreach object,$(1),$(eval $(call gb_GenCxxObject_get_target,$(object)) : CXXFLAGS := $(filter-out $(gb_COMPILEROPTFLAGS),$(CXXFLAGS)) $(2)))
492endef
493
494define gb_LinkTarget_set_objcxx_optimization
495$(foreach object,$(1),$(eval $(call gb_ObjCxxObject_get_target,$(object)) : OBJCXXFLAGS := $(filter-out $(gb_COMPILEROPTFLAGS),$(OBJCXXFLAGS)) $(2)))
496endef
497
498define gb_LinkTarget_set_include
499$(call gb_LinkTarget_get_headers_target,$(1)) \
500$(call gb_LinkTarget_get_target,$(1)) : INCLUDE := $(2)
501ifeq ($(gb_FULLDEPS),$(true))
502$(call gb_LinkTarget_get_dep_target,$(1)) : INCLUDE := $(2)
503endif
504
505endef
506
507define gb_LinkTarget_set_include_stl
508$(call gb_LinkTarget_get_headers_target,$(1)) \
509$(call gb_LinkTarget_get_target,$(1)) : INCLUDE_STL := $(2)
510ifeq ($(gb_FULLDEPS),$(true))
511$(call gb_LinkTarget_get_dep_target,$(1)) : INCLUDE_STL := $(2)
512endif
513
514endef
515
516define gb_LinkTarget_add_ldflags
517$(call gb_LinkTarget_get_target,$(1)) : T_LDFLAGS += $(2)
518endef
519
520# real use in RepositoryExternal.mk
521define gb_LinkTarget_set_ldflags
522$(call gb_LinkTarget_get_target,$(1)) : T_LDFLAGS := $(2)
523endef
524
525define gb_LinkTarget_add_api
526$(call gb_LinkTarget_get_external_headers_target,$(1)) :| \
527	$$(foreach api,$(2),$$(call gb_Package_get_target,$$(api)_inc))
528$(call gb_LinkTarget_get_headers_target,$(1)) \
529$(call gb_LinkTarget_get_target,$(1)) : INCLUDE += $$(foreach api,$(2),-I$(OUTDIR)/inc/$$(api))
530ifeq ($(gb_FULLDEPS),$(true))
531$(call gb_LinkTarget_get_dep_target,$(1)) : INCLUDE += $$(foreach api,$(2),-I$(OUTDIR)/inc/$$(api))
532endif
533
534endef
535
536define gb_LinkTarget_add_private_api
537$(call gb_LinkTarget_get_external_headers_target,$(1)) :| \
538	$(call gb_UnoPrivateApiTarget_get_target,$(1)/idl.cppumaker.flag)
539$(call gb_LinkTarget_get_headers_target,$(1)) \
540$(call gb_LinkTarget_get_target,$(1)) : INCLUDE += -I$(call gb_UnoPrivateApiTarget_get_target,$(1)/inc)
541ifeq ($(gb_FULLDEPS),$(true))
542$(call gb_LinkTarget_get_dep_target,$(1)) : INCLUDE += -I$(call gb_UnoPrivateApiTarget_get_target,$(1)/inc)
543endif
544
545$(call gb_UnoPrivateApiTarget_get_target,$(1)/idl.cppumaker.flag): $(2) $(3)
546	$(call gb_Output_announce,$@,$(true),PVTIDL,2)
547	-$$(call gb_Helper_abbreviate_dirs_native,\
548		mkdir -p $$(call gb_UnoPrivateApiTarget_get_target,$(1)/urd) && \
549		mkdir -p $$(call gb_UnoPrivateApiTarget_get_target,$(1)/rdb) && \
550		mkdir -p $$(call gb_UnoPrivateApiTarget_get_target,$(1)/inc) && \
551		$$(gb_UnoApiTarget_IDLCCOMMAND) -I$$(OUTDIR)/idl -O $$(call gb_UnoPrivateApiTarget_get_target,$(1)/urd) \
552			-verbose -cid -we $(3) && \
553		$$(gb_UnoApiTarget_REGMERGECOMMAND) $$(call gb_UnoPrivateApiTarget_get_target,$(1)/rdb/registry.rdb) /UCR \
554			$(patsubst %.idl,%.urd,$$(call gb_UnoPrivateApiTarget_get_target,$(1)/urd)/$(notdir $(3))) && \
555		$(gb_UnoApiTarget_CPPUMAKERCOMMAND) \
556			-O $$(call gb_UnoPrivateApiTarget_get_target,$(1)/inc) \
557			$(foreach unotype,$(4),-T$(unotype)) \
558			-BUCR \
559			-C \
560			$$(call gb_UnoPrivateApiTarget_get_target,$(1)/rdb/registry.rdb) \
561			$(2) && \
562		touch $(call gb_UnoPrivateApiTarget_get_target,$(1)/idl.cppumaker.flag))
563
564$(call gb_LinkTarget_get_clean_target,$(1)) :
565	rm -rf $(call gb_UnoPrivateApiTarget_get_target,$(1))
566
567endef
568
569# FIXME: multiple??
570define gb_LinkTarget_set_private_api
571$(foreach api,$(3),$(call gb_LinkTarget_add_private_api,$(1),$(2),$(api),$(4)))
572
573endef
574
575define gb_LinkTarget_set_private_extract_of_public_api
576$(call gb_LinkTarget_get_external_headers_target,$(1)) :| \
577	$(call gb_UnoPrivateApiExtractTarget_get_target,$(1)/idl.cppumaker.flag)
578$(call gb_LinkTarget_get_headers_target,$(1)) \
579$(call gb_LinkTarget_get_target,$(1)) : INCLUDE += -I$(call gb_UnoPrivateApiExtractTarget_get_target,$(1)/inc)
580ifeq ($(gb_FULLDEPS),$(true))
581$(call gb_LinkTarget_get_dep_target,$(1)) : INCLUDE += -I$(call gb_UnoPrivateApiExtractTarget_get_target,$(1)/inc)
582endif
583
584$(call gb_UnoPrivateApiExtractTarget_get_target,$(1)/idl.cppumaker.flag): $(2)
585	$(call gb_Output_announce,$@,$(true),PVTUNOTYPES,2)
586	-$$(call gb_Helper_abbreviate_dirs_native,\
587		mkdir -p $$(call gb_UnoPrivateApiExtractTarget_get_target,$(1)/inc) && \
588		$(gb_UnoApiTarget_CPPUMAKERCOMMAND) \
589			-O $$(call gb_UnoPrivateApiExtractTarget_get_target,$(1)/inc) \
590			$(foreach unotype,$(3),-T$(unotype)) \
591			-BUCR \
592			-C \
593			$(2) && \
594		touch $(call gb_UnoPrivateApiExtractTarget_get_target,$(1)/idl.cppumaker.flag))
595
596$(call gb_LinkTarget_get_clean_target,$(1)) :
597	rm -rf $(call gb_UnoPrivateApiExtractTarget_get_target,$(1))
598
599
600endef
601
602gb_BisonTarget_get_source = $(SRCDIR)/$(1).y
603
604# Bison-generated .cxx files are always #include'd into in-module files,
605# and aren't compiled, so they effectively act as generated headers, not generated .cxx.
606
607define gb_LinkTarget_add_bison_file
608
609$(call gb_LinkTarget_get_external_headers_target,$(1)) :| \
610	$(call gb_BisonTarget_get_target,$(1),$(2))
611
612$(call gb_LinkTarget_get_headers_target,$(1)) \
613$(call gb_LinkTarget_get_target,$(1)) : INCLUDE += -I$(dir $(call gb_BisonTarget_get_target,$(1),$(2)))
614ifeq ($(gb_FULLDEPS),$(true))
615$(call gb_LinkTarget_get_dep_target,$(1)) : INCLUDE += -I$(dir $(call gb_BisonTarget_get_target,$(1),$(2)))
616endif
617
618$(call gb_BisonTarget_get_target,$(1),$(2)) : $(call gb_BisonTarget_get_source,$(2))
619	mkdir -p $(dir $(call gb_BisonTarget_get_target,$(1),$(2))) && \
620	tr -d "\015" < $(call gb_BisonTarget_get_source,$(2)) > $(dir $(call gb_BisonTarget_get_target,$(1),$(2)))/stripped_$(notdir $(call gb_BisonTarget_get_source,$(2))) && \
621	bison -d -o $(call gb_BisonTarget_get_target,$(1),$(2)) $(dir $(call gb_BisonTarget_get_target,$(1),$(2)))/stripped_$(notdir $(call gb_BisonTarget_get_source,$(2)))
622
623endef
624
625define gb_LinkTarget_add_bison_files
626$(foreach bisonfile,$(2),$(call gb_LinkTarget_add_bison_file,$(1),$(bisonfile)))
627
628endef
629
630define gb_LinkTarget_add_libs
631$(call gb_LinkTarget_get_target,$(1)) : LIBS += $(2)
632endef
633
634define gb_LinkTarget_add_linked_libs
635ifneq (,$$(filter-out $(gb_Library_KNOWNLIBS),$(2)))
636$$(eval $$(call gb_Output_info,currently known libraries are: $(sort $(gb_Library_KNOWNLIBS)),ALL))
637$$(eval $$(call gb_Output_error,Cannot link against library/libraries $$(filter-out $(gb_Library_KNOWNLIBS),$(2)). Libraries must be registered in Repository.mk))
638endif
639
640$(call gb_LinkTarget_get_target,$(1)) : LINKED_LIBS += $(2)
641
642$(call gb_LinkTarget_get_target,$(1)) : $$(foreach lib,$(2),$$(call gb_Library_get_target,$$(lib)))
643$(call gb_LinkTarget_get_external_headers_target,$(1)) : \
644$$(foreach lib,$(2),$$(call gb_Library_get_headers_target,$$(lib)))
645
646endef
647
648define gb_LinkTarget_add_linked_static_libs
649ifneq (,$$(filter-out $(gb_StaticLibrary_KNOWNLIBS),$(2)))
650$$(eval $$(call gb_Output_info, currently known static libraries are: $(sort $(gb_StaticLibrary_KNOWNLIBS)),ALL))
651$$(eval $$(call gb_Output_error,Cannot link against static library/libraries $$(filter-out $(gb_StaticLibrary_KNOWNLIBS),$(2)). Static libraries must be registered in Repository.mk))
652endif
653
654$(call gb_LinkTarget_get_target,$(1)) : LINKED_STATIC_LIBS += $(2)
655
656$(call gb_LinkTarget_get_target,$(1)) : $$(foreach lib,$(2),$$(call gb_StaticLibrary_get_target,$$(lib)))
657$(call gb_LinkTarget_get_external_headers_target,$(1)) : \
658$$(foreach lib,$(2),$$(call gb_StaticLibrary_get_headers_target,$$(lib)))
659
660endef
661
662#
663# Add external libs for linking.  External libaries are not built by any module.
664#
665# The list of libraries is used as is, ie it is not filtered with gb_Library_KNOWNLIBS.
666#
667# An error is signaled, when any of the library names does not look like
668# a base name, ie is prefixed by -l or is folled by .lib or .so.
669#
670# @param target
671# @param libraries
672#     A list of (base names of) libraries that will be added to the target
673#     local EXTERNAL_LIBS variable and eventually linked in when the
674#     target is made.
675#
676define gb_LinkTarget_add_external_libs
677
678# Make sure that all libraries are given as base names.
679ifneq (,$$(filter -l% %.so %.lib, $(2)))
680$$(eval $$(call gb_Output_announce,ERROR: Please give only library basenames to gb_LinkTarget_add_external_libs))
681$$(eval $$(call gb_Output_announce,ERROR:    (no prefixes -l% or lib%, no suffixes %.so or %.lib)))
682$$(eval $$(call gb_Output_announce,ERROR:    libraries given: $(2)))
683$$(eval $$(call gb_Output_announce,ERROR:    offending: $$(filter -l% lib% %.so %.lib, $(2))))
684$$(eval $$(call gb_Output_error,  ))
685endif
686
687$(call gb_LinkTarget_get_target,$(1)) : EXTERNAL_LIBS += $(2)
688
689$(call gb_LinkTarget_get_target,$(1)) : $$(foreach lib,$(2),$$(call gb_Library_get_target,$$(lib)))
690$(call gb_LinkTarget_get_external_headers_target,$(1)) : \
691$$(foreach lib,$(2),$$(call gb_Library_get_headers_target,$$(lib)))
692
693endef
694
695
696define gb_LinkTarget_add_cobject
697$(call gb_LinkTarget_get_target,$(1)) : COBJECTS += $(2)
698$(call gb_LinkTarget_get_clean_target,$(1)) : COBJECTS += $(2)
699
700$(call gb_LinkTarget_get_target,$(1)) : $(call gb_CObject_get_target,$(2))
701$(call gb_CObject_get_target,$(2)) : | $(call gb_LinkTarget_get_headers_target,$(1))
702$(call gb_CObject_get_target,$(2)) : T_CFLAGS += $(3)
703
704ifeq ($(gb_FULLDEPS),$(true))
705$(call gb_LinkTarget_get_dep_target,$(1)) : COBJECTS += $(2)
706$(call gb_LinkTarget_get_dep_target,$(1)) : $(call gb_CObject_get_dep_target,$(2))
707endif
708
709endef
710
711define gb_LinkTarget_add_cxxobject
712$(call gb_LinkTarget_get_target,$(1)) : CXXOBJECTS += $(2)
713$(call gb_LinkTarget_get_clean_target,$(1)) : CXXOBJECTS += $(2)
714
715$(call gb_LinkTarget_get_target,$(1)) : $(call gb_CxxObject_get_target,$(2))
716$(call gb_CxxObject_get_target,$(2)) : | $(call gb_LinkTarget_get_headers_target,$(1))
717$(call gb_CxxObject_get_target,$(2)) : T_CXXFLAGS += $(3)
718
719ifeq ($(gb_FULLDEPS),$(true))
720$(call gb_LinkTarget_get_dep_target,$(1)) : CXXOBJECTS += $(2)
721$(call gb_LinkTarget_get_dep_target,$(1)) : $(call gb_CxxObject_get_dep_target,$(2))
722endif
723
724endef
725
726define gb_LinkTarget_add_objcxxobject
727$(call gb_LinkTarget_get_target,$(1)) : OBJCXXOBJECTS += $(2)
728$(call gb_LinkTarget_get_clean_target,$(1)) : OBJCXXOBJECTS += $(2)
729
730$(call gb_LinkTarget_get_target,$(1)) : $(call gb_ObjCxxObject_get_target,$(2))
731$(call gb_ObjCxxObject_get_target,$(2)) : | $(call gb_LinkTarget_get_headers_target,$(1))
732$(call gb_ObjCxxObject_get_target,$(2)) : T_OBJCXXFLAGS += $(3)
733
734ifeq ($(gb_FULLDEPS),$(true))
735$(call gb_LinkTarget_get_dep_target,$(1)) : OBJCXXOBJECTS += $(2)
736$(call gb_LinkTarget_get_dep_target,$(1)) : $(call gb_ObjCxxObject_get_dep_target,$(2))
737endif
738
739endef
740
741define gb_LinkTarget_add_generated_cxx_object
742$(call gb_LinkTarget_get_target,$(1)) : GENCXXOBJECTS += $(2)
743$(call gb_LinkTarget_get_clean_target,$(1)) : GENCXXOBJECTS += $(2)
744
745$(call gb_LinkTarget_get_target,$(1)) : $(call gb_GenCxxObject_get_target,$(2))
746$(call gb_GenCxxObject_get_source,$(2)) : | $(call gb_LinkTarget_get_headers_target,$(1))
747$(call gb_GenCxxObject_get_target,$(2)) : T_CXXFLAGS += $(3)
748
749ifeq ($(gb_FULLDEPS),$(true))
750$(call gb_LinkTarget_get_dep_target,$(1)) : GENCXXOBJECTS += $(2)
751$(call gb_LinkTarget_get_dep_target,$(1)) : $(call gb_GenCxxObject_get_dep_target,$(2))
752endif
753
754endef
755
756define gb_LinkTarget_add_noexception_object
757$(call gb_LinkTarget_add_cxxobject,$(1),$(2),$(gb_LinkTarget_NOEXCEPTIONFLAGS))
758endef
759
760define gb_LinkTarget_add_exception_object
761$(call gb_LinkTarget_add_cxxobject,$(1),$(2),$(gb_LinkTarget_EXCEPTIONFLAGS))
762endef
763
764define gb_LinkTarget_add_cobjects
765$(foreach obj,$(2),$(call gb_LinkTarget_add_cobject,$(1),$(obj),$(3)))
766endef
767
768define gb_LinkTarget_add_cxxobjects
769$(foreach obj,$(2),$(call gb_LinkTarget_add_cxxobject,$(1),$(obj),$(3)))
770endef
771
772define gb_LinkTarget_add_objcxxobjects
773$(foreach obj,$(2),$(call gb_LinkTarget_add_objcxxobject,$(1),$(obj),$(3)))
774endef
775
776define gb_LinkTarget_add_noexception_objects
777$(foreach obj,$(2),$(call gb_LinkTarget_add_noexception_object,$(1),$(obj)))
778endef
779
780define gb_LinkTarget_add_exception_objects
781$(foreach obj,$(2),$(call gb_LinkTarget_add_exception_object,$(1),$(obj)))
782endef
783
784define gb_LinkTarget_add_generated_exception_object
785$(call gb_LinkTarget_add_generated_cxx_object,$(1),$(2),$(gb_LinkTarget_EXCEPTIONFLAGS))
786endef
787
788define gb_LinkTarget_add_generated_exception_objects
789$(foreach obj,$(2),$(call gb_LinkTarget_add_generated_exception_object,$(1),$(obj)))
790endef
791
792define gb_LinkTarget_set_targettype
793$(call gb_LinkTarget_get_target,$(1)) \
794$(call gb_LinkTarget_get_dep_target,$(1)) : TARGETTYPE := $(2)
795endef
796
797define gb_LinkTarget_set_versionmap
798$(call gb_LinkTarget_get_target,$(1)) \
799$(call gb_LinkTarget_get_dep_target,$(1)) : VERSIONMAP := $(2)
800endef
801
802define gb_LinkTarget_set_dlltarget
803$(call gb_LinkTarget_get_clean_target,$(1)) \
804$(call gb_LinkTarget_get_target,$(1)) : DLLTARGET := $(2)
805endef
806
807define gb_LinkTarget_set_auxtargets
808$(call gb_LinkTarget_get_clean_target,$(1)) : AUXTARGETS := $(2)
809endef
810
811define gb_LinkTarget__add_internal_headers
812$(call gb_LinkTarget_get_headers_target,$(1)) : $(2)
813$(2) :|	$(call gb_LinkTarget_get_external_headers_target,$(1))
814
815endef
816
817define gb_LinkTarget_add_package_headers
818$(foreach package,$(2),$(call gb_LinkTarget__add_internal_headers,$(1),$(call gb_Package_get_target,$(package))))
819$(call gb_LinkTarget_get_clean_target,$(1)) : $(foreach package,$(2),$(call gb_Package_get_clean_target,$(package)))
820
821endef
822
823define gb_LinkTarget_add_sdi_headers
824$(call gb_LinkTarget__add_internal_headers,$(1),$(foreach sdi,$(2),$(call gb_SdiTarget_get_target,$(sdi))))
825$(call gb_LinkTarget_get_clean_target,$(1)) : $(foreach sdi,$(2),$(call gb_SdiTarget_get_clean_target,$(sdi)))
826endef
827
828define gb_LinkTarget__add_precompiled_header_impl
829$(call gb_LinkTarget__add_internal_headers,$(1),$(call gb_PrecompiledHeader_get_target,$(3)))
830$(call gb_LinkTarget_get_clean_target,$(1)) : $(call gb_PrecompiledHeader_get_clean_target,$(3))
831$(call gb_PrecompiledHeader_get_target,$(3)) : $(2).cxx
832
833$(call gb_LinkTarget__add_internal_headers,$(1),$(call gb_NoexPrecompiledHeader_get_target,$(3)))
834$(call gb_LinkTarget_get_clean_target,$(1)) : $(call gb_NoexPrecompiledHeader_get_clean_target,$(3))
835$(call gb_NoexPrecompiledHeader_get_target,$(3)) : $(2).cxx
836
837$(call gb_LinkTarget_get_target,$(1)) : PCH_NAME := $(3)
838$(call gb_LinkTarget_get_target,$(1)) : PCHOBJS = $(call gb_PrecompiledHeader_get_target,$(3)).obj $(call gb_NoexPrecompiledHeader_get_target,$(3)).obj
839
840$(call gb_LinkTarget_get_headers_target,$(1)) \
841$(call gb_LinkTarget_get_target,$(1)) : PCH_DEFS = $$(DEFS)
842ifeq ($(gb_FULLDEPS),$(true))
843-include \
844	$(call gb_PrecompiledHeader_get_dep_target,$(3)) \
845	$(call gb_NoexPrecompiledHeader_get_dep_target,$(3))
846$(call gb_LinkTarget_get_dep_target,$(1)) : PCH_NAME := $(3)
847$(call gb_LinkTarget_get_dep_target,$(1)) : PCH_DEFS = $$(DEFS)
848endif
849
850endef
851
852define gb_LinkTarget_add_precompiled_header
853ifeq ($(gb_ENABLE_PCH),$(true))
854$(call gb_LinkTarget__add_precompiled_header_impl,$(1),$(2),$(notdir $(2)))
855endif
856
857endef
858
859# this forwards to functions that must be defined in RepositoryExternal.mk.
860# $(call gb_LinkTarget_use_external,library,external)
861define gb_LinkTarget_use_external
862$(eval $(if $(value gb_LinkTarget__use_$(2)),\
863  $(call gb_LinkTarget__use_$(2),$(1)),\
864  $(error gb_LinkTarget_use_external: unknown external: $(2))))
865endef
866
867# $(call gb_LinkTarget_use_externals,library,externals)
868gb_LinkTarget_use_externals = \
869 $(foreach external,$(2),$(call gb_LinkTarget_use_external,$(1),$(external)))
870
871
872# vim: set noet sw=4 ts=4:
873