]> git.lizzy.rs Git - rust.git/blob - mk/rt.mk
Doc says to avoid mixing allocator instead of forbiding it
[rust.git] / mk / rt.mk
1 # Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2 # file at the top-level directory of this distribution and at
3 # http://rust-lang.org/COPYRIGHT.
4 #
5 # Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 # http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 # <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 # option. This file may not be copied, modified, or distributed
9 # except according to those terms.
10
11 ################################################################################
12 # Native libraries built as part of the rust build process
13 #
14 # This portion of the rust build system is meant to keep track of native
15 # dependencies and how to build them. It is currently required that all native
16 # dependencies are built as static libraries, as slinging around dynamic
17 # libraries isn't exactly the most fun thing to do.
18 #
19 # This section should need minimal modification to add new libraries. The
20 # relevant variables are:
21 #
22 #   NATIVE_LIBS
23 #       This is a list of all native libraries which are built as part of the
24 #       build process. It will build all libraries into RT_OUTPUT_DIR with the
25 #       appropriate name of static library as dictated by the target platform
26 #
27 #   NATIVE_DEPS_<lib>
28 #       This is a list of files relative to the src/rt directory which are
29 #       needed to build the native library. Each file will be compiled to an
30 #       object file, and then all the object files will be assembled into an
31 #       archive (static library). The list contains files of any extension
32 #
33 # If adding a new library, you should update the NATIVE_LIBS list, and then list
34 # the required files below it. The list of required files is a list of files
35 # that's per-target so you're allowed to conditionally add files based on the
36 # target.
37 ################################################################################
38 NATIVE_LIBS := rust_builtin hoedown uv_support morestack miniz context_switch \
39                 rustrt_native rust_test_helpers
40
41 # $(1) is the target triple
42 define NATIVE_LIBRARIES
43
44 NATIVE_DEPS_hoedown_$(1) := hoedown/src/autolink.c \
45                         hoedown/src/buffer.c \
46                         hoedown/src/document.c \
47                         hoedown/src/escape.c \
48                         hoedown/src/html.c \
49                         hoedown/src/html_blocks.c \
50                         hoedown/src/html_smartypants.c \
51                         hoedown/src/stack.c \
52                         hoedown/src/version.c
53 NATIVE_DEPS_uv_support_$(1) := rust_uv.c
54 NATIVE_DEPS_miniz_$(1) = miniz.c
55 NATIVE_DEPS_rust_builtin_$(1) := rust_builtin.c \
56                         rust_android_dummy.c
57 NATIVE_DEPS_rustrt_native_$(1) := \
58                         rust_try.ll \
59                         arch/$$(HOST_$(1))/record_sp.S
60 NATIVE_DEPS_rust_test_helpers_$(1) := rust_test_helpers.c
61 NATIVE_DEPS_morestack_$(1) := arch/$$(HOST_$(1))/morestack.S
62 NATIVE_DEPS_context_switch_$(1) := \
63                         arch/$$(HOST_$(1))/_context.S
64
65 ################################################################################
66 # You shouldn't find it that necessary to edit anything below this line.
67 ################################################################################
68
69 # While we're defining the native libraries for each target, we define some
70 # common rules used to build files for various targets.
71
72 RT_OUTPUT_DIR_$(1) := $(1)/rt
73
74 $$(RT_OUTPUT_DIR_$(1))/%.o: $(S)src/rt/%.ll $$(MKFILE_DEPS) \
75             $$(LLVM_CONFIG_$$(CFG_BUILD))
76         @mkdir -p $$(@D)
77         @$$(call E, compile: $$@)
78         $$(Q)$$(LLC_$$(CFG_BUILD)) $$(CFG_LLC_FLAGS_$(1)) \
79             -filetype=obj -mtriple=$(1) -relocation-model=pic -o $$@ $$<
80
81 $$(RT_OUTPUT_DIR_$(1))/%.o: $(S)src/rt/%.c $$(MKFILE_DEPS)
82         @mkdir -p $$(@D)
83         @$$(call E, compile: $$@)
84         $$(Q)$$(call CFG_COMPILE_C_$(1), $$@, \
85                 -I $$(S)src/rt/hoedown/src \
86                 -I $$(S)src/libuv/include -I $$(S)src/rt \
87                  $$(RUNTIME_CFLAGS_$(1))) $$<
88
89 $$(RT_OUTPUT_DIR_$(1))/%.o: $(S)src/rt/%.S $$(MKFILE_DEPS) \
90             $$(LLVM_CONFIG_$$(CFG_BUILD))
91         @mkdir -p $$(@D)
92         @$$(call E, compile: $$@)
93         $$(Q)$$(call CFG_ASSEMBLE_$(1),$$@,$$<)
94 endef
95
96 $(foreach target,$(CFG_TARGET),$(eval $(call NATIVE_LIBRARIES,$(target))))
97
98 # A macro for devining how to build third party libraries listed above (based
99 # on their dependencies).
100 #
101 # $(1) is the target
102 # $(2) is the lib name
103 define THIRD_PARTY_LIB
104
105 OBJS_$(2)_$(1) := $$(NATIVE_DEPS_$(2)_$(1):%=$$(RT_OUTPUT_DIR_$(1))/%)
106 OBJS_$(2)_$(1) := $$(OBJS_$(2)_$(1):.c=.o)
107 OBJS_$(2)_$(1) := $$(OBJS_$(2)_$(1):.cpp=.o)
108 OBJS_$(2)_$(1) := $$(OBJS_$(2)_$(1):.ll=.o)
109 OBJS_$(2)_$(1) := $$(OBJS_$(2)_$(1):.S=.o)
110 NATIVE_$(2)_$(1) := $$(call CFG_STATIC_LIB_NAME_$(1),$(2))
111 $$(RT_OUTPUT_DIR_$(1))/$$(NATIVE_$(2)_$(1)): $$(OBJS_$(2)_$(1))
112         @$$(call E, link: $$@)
113         $$(Q)$$(AR_$(1)) rcs $$@ $$^
114
115 endef
116
117 $(foreach target,$(CFG_TARGET), \
118  $(eval $(call RUNTIME_RULES,$(target))))
119 $(foreach lib,$(NATIVE_LIBS), \
120  $(foreach target,$(CFG_TARGET), \
121   $(eval $(call THIRD_PARTY_LIB,$(target),$(lib)))))
122
123
124 ################################################################################
125 # Building third-party targets with external build systems
126 #
127 # This location is meant for dependencies which have external build systems. It
128 # is still assumed that the output of each of these steps is a static library
129 # in the correct location.
130 ################################################################################
131
132 ################################################################################
133 # libuv
134 ################################################################################
135
136 define DEF_LIBUV_ARCH_VAR
137   LIBUV_ARCH_$(1) = $$(subst i386,ia32,$$(subst x86_64,x64,$$(HOST_$(1))))
138 endef
139 $(foreach t,$(CFG_TARGET),$(eval $(call DEF_LIBUV_ARCH_VAR,$(t))))
140
141 ifdef CFG_ENABLE_FAST_MAKE
142 LIBUV_DEPS := $(S)/.gitmodules
143 else
144 LIBUV_DEPS := $(wildcard \
145               $(S)src/libuv/* \
146               $(S)src/libuv/*/* \
147               $(S)src/libuv/*/*/* \
148               $(S)src/libuv/*/*/*/*)
149 endif
150
151 LIBUV_NO_LOAD = run-benchmarks.target.mk run-tests.target.mk \
152                 uv_dtrace_header.target.mk uv_dtrace_provider.target.mk
153
154 export PYTHONPATH := $(PYTHONPATH):$(S)src/gyp/pylib
155
156 define DEF_THIRD_PARTY_TARGETS
157
158 # $(1) is the target triple
159
160 ifeq ($$(CFG_WINDOWSY_$(1)), 1)
161   LIBUV_OSTYPE_$(1) := win
162   # This isn't necessarily a desired option, but it's harmless and works around
163   # what appears to be a mingw-w64 bug.
164   #
165   # https://sourceforge.net/p/mingw-w64/bugs/395/
166   JEMALLOC_ARGS_$(1) := --enable-lazy-lock
167 else ifeq ($(OSTYPE_$(1)), apple-darwin)
168   LIBUV_OSTYPE_$(1) := mac
169 else ifeq ($(OSTYPE_$(1)), apple-ios)
170   LIBUV_OSTYPE_$(1) := ios
171   JEMALLOC_ARGS_$(1) := --disable-tls
172 else ifeq ($(OSTYPE_$(1)), unknown-freebsd)
173   LIBUV_OSTYPE_$(1) := freebsd
174 else ifeq ($(OSTYPE_$(1)), unknown-dragonfly)
175   LIBUV_OSTYPE_$(1) := freebsd
176   # required on DragonFly, otherwise gyp fails with a Python exception
177   LIBUV_GYP_ARGS_$(1) := --no-parallel
178 else ifeq ($(OSTYPE_$(1)), linux-androideabi)
179   LIBUV_OSTYPE_$(1) := android
180   LIBUV_ARGS_$(1) := PLATFORM=android host=android OS=linux
181   JEMALLOC_ARGS_$(1) := --disable-tls
182 else
183   LIBUV_OSTYPE_$(1) := linux
184 endif
185
186 LIBUV_NAME_$(1) := $$(call CFG_STATIC_LIB_NAME_$(1),uv)
187 LIBUV_DIR_$(1) := $$(RT_OUTPUT_DIR_$(1))/libuv
188 LIBUV_LIB_$(1) := $$(RT_OUTPUT_DIR_$(1))/$$(LIBUV_NAME_$(1))
189
190 LIBUV_MAKEFILE_$(1) := $$(CFG_BUILD_DIR)$$(RT_OUTPUT_DIR_$(1))/libuv/Makefile
191 LIBUV_BUILD_DIR_$(1) := $$(CFG_BUILD_DIR)$$(RT_OUTPUT_DIR_$(1))/libuv
192 LIBUV_XCODEPROJ_$(1) := $$(LIBUV_BUILD_DIR_$(1))/uv.xcodeproj
193
194 LIBUV_STAMP_$(1) = $$(LIBUV_DIR_$(1))/libuv-auto-clean-stamp
195
196 $$(LIBUV_STAMP_$(1)): $(S)src/rt/libuv-auto-clean-trigger
197         $$(Q)rm -rf $$(LIBUV_DIR_$(1))
198         $$(Q)mkdir -p $$(@D)
199         touch $$@
200
201 # libuv triggers a few warnings on some platforms
202 LIBUV_CFLAGS_$(1) := $(subst -Werror,,$(CFG_GCCISH_CFLAGS_$(1)))
203
204 $$(LIBUV_MAKEFILE_$(1)): $$(LIBUV_DEPS) $$(MKFILE_DEPS) $$(LIBUV_STAMP_$(1))
205         (cd $(S)src/libuv/ && \
206          $$(CFG_PYTHON) ./gyp_uv.py -f make -Dtarget_arch=$$(LIBUV_ARCH_$(1)) \
207            -D ninja \
208            -DOS=$$(LIBUV_OSTYPE_$(1)) \
209            -Goutput_dir=$$(@D) $$(LIBUV_GYP_ARGS_$(1)) --generator-output $$(@D))
210         touch $$@
211
212 # Windows has a completely different build system for libuv because of mingw. In
213 # theory when we support msvc then we should be using gyp's msvc output instead
214 # of mingw's makefile for windows
215 ifdef CFG_WINDOWSY_$(1)
216 LIBUV_LOCAL_$(1) := $$(S)src/libuv/libuv.a
217 $$(LIBUV_LOCAL_$(1)): $$(LIBUV_DEPS) $$(MKFILE_DEPS)
218         $$(Q)$$(MAKE) -C $$(S)src/libuv -f Makefile.mingw \
219                 LDFLAGS="$$(CFG_GCCISH_LINK_FLAGS_$(1))" \
220                 CC="$$(CC_$(1)) $$(LIBUV_CFLAGS_$(1)) $$(SNAP_DEFINES)" \
221                 CXX="$$(CXX_$(1))" \
222                 AR="$$(AR_$(1))" \
223                 V=$$(VERBOSE)
224 else ifeq ($(OSTYPE_$(1)), apple-ios) # iOS
225 $$(LIBUV_XCODEPROJ_$(1)): $$(LIBUV_DEPS) $$(MKFILE_DEPS) $$(LIBUV_STAMP_$(1))
226         cp -rf $(S)src/libuv/ $$(LIBUV_BUILD_DIR_$(1))
227         (cd $$(LIBUV_BUILD_DIR_$(1)) && \
228          $$(CFG_PYTHON) ./gyp_uv.py -f xcode \
229            -D ninja \
230            -R libuv)
231         touch $$@
232
233 LIBUV_XCODE_OUT_LIB_$(1) := $$(LIBUV_BUILD_DIR_$(1))/build/Release-$$(CFG_SDK_NAME_$(1))/libuv.a
234
235 $$(LIBUV_LIB_$(1)): $$(LIBUV_XCODE_OUT_LIB_$(1)) $$(MKFILE_DEPS)
236         $$(Q)cp $$< $$@
237 $$(LIBUV_XCODE_OUT_LIB_$(1)): $$(LIBUV_DEPS) $$(LIBUV_XCODEPROJ_$(1)) \
238                                     $$(MKFILE_DEPS)
239         $$(Q)xcodebuild -project $$(LIBUV_BUILD_DIR_$(1))/uv.xcodeproj \
240                 CFLAGS="$$(LIBUV_CFLAGS_$(1)) $$(SNAP_DEFINES)" \
241                 LDFLAGS="$$(CFG_GCCISH_LINK_FLAGS_$(1))" \
242                 $$(LIBUV_ARGS_$(1)) \
243                 V=$$(VERBOSE) \
244                 -configuration Release \
245                 -sdk "$$(CFG_SDK_NAME_$(1))" \
246                 ARCHS="$$(CFG_SDK_ARCHS_$(1))"
247         $$(Q)touch $$@
248 else
249 LIBUV_LOCAL_$(1) := $$(LIBUV_DIR_$(1))/Release/libuv.a
250 $$(LIBUV_LOCAL_$(1)): $$(LIBUV_DEPS) $$(LIBUV_MAKEFILE_$(1)) $$(MKFILE_DEPS)
251         $$(Q)$$(MAKE) -C $$(LIBUV_DIR_$(1)) \
252                 CFLAGS="$$(LIBUV_CFLAGS_$(1)) $$(SNAP_DEFINES)" \
253                 LDFLAGS="$$(CFG_GCCISH_LINK_FLAGS_$(1))" \
254                 CC="$$(CC_$(1))" \
255                 CXX="$$(CXX_$(1))" \
256                 AR="$$(AR_$(1))" \
257                 $$(LIBUV_ARGS_$(1)) \
258                 BUILDTYPE=Release \
259                 NO_LOAD="$$(LIBUV_NO_LOAD)" \
260                 V=$$(VERBOSE)
261         $$(Q)touch $$@
262 endif
263
264 ifeq ($(1),$$(CFG_BUILD))
265 ifneq ($$(CFG_LIBUV_ROOT),)
266 $$(LIBUV_LIB_$(1)): $$(CFG_LIBUV_ROOT)/libuv.a
267         $$(Q)cp $$< $$@
268 else
269 $$(LIBUV_LIB_$(1)): $$(LIBUV_LOCAL_$(1))
270         $$(Q)cp $$< $$@
271 endif
272 else
273 $$(LIBUV_LIB_$(1)): $$(LIBUV_LOCAL_$(1))
274         $$(Q)cp $$< $$@
275 endif
276
277 ################################################################################
278 # jemalloc
279 ################################################################################
280
281 ifdef CFG_ENABLE_FAST_MAKE
282 JEMALLOC_DEPS := $(S)/.gitmodules
283 else
284 JEMALLOC_DEPS := $(wildcard \
285                    $(S)src/jemalloc/* \
286                    $(S)src/jemalloc/*/* \
287                    $(S)src/jemalloc/*/*/* \
288                    $(S)src/jemalloc/*/*/*/*)
289 endif
290
291 JEMALLOC_NAME_$(1) := $$(call CFG_STATIC_LIB_NAME_$(1),jemalloc)
292 ifeq ($$(CFG_WINDOWSY_$(1)),1)
293   JEMALLOC_REAL_NAME_$(1) := $$(call CFG_STATIC_LIB_NAME_$(1),jemalloc_s)
294 else
295   JEMALLOC_REAL_NAME_$(1) := $$(call CFG_STATIC_LIB_NAME_$(1),jemalloc_pic)
296 endif
297 JEMALLOC_LIB_$(1) := $$(RT_OUTPUT_DIR_$(1))/$$(JEMALLOC_NAME_$(1))
298 JEMALLOC_BUILD_DIR_$(1) := $$(RT_OUTPUT_DIR_$(1))/jemalloc
299 JEMALLOC_LOCAL_$(1) := $$(JEMALLOC_BUILD_DIR_$(1))/lib/$$(JEMALLOC_REAL_NAME_$(1))
300
301 $$(JEMALLOC_LOCAL_$(1)): $$(JEMALLOC_DEPS) $$(MKFILE_DEPS)
302         @$$(call E, make: jemalloc)
303         cd "$$(JEMALLOC_BUILD_DIR_$(1))"; "$(S)src/jemalloc/configure" \
304                 $$(JEMALLOC_ARGS_$(1)) --with-jemalloc-prefix=je_ $(CFG_JEMALLOC_FLAGS) \
305                 --build=$(CFG_BUILD) --host=$(1) \
306                 CC="$$(CC_$(1))" \
307                 AR="$$(AR_$(1))" \
308                 RANLIB="$$(AR_$(1)) s" \
309                 CPPFLAGS="-I $(S)src/rt/" \
310                 EXTRA_CFLAGS="$$(CFG_CFLAGS_$(1)) $$(CFG_JEMALLOC_CFLAGS_$(1)) -g1"
311         $$(Q)$$(MAKE) -C "$$(JEMALLOC_BUILD_DIR_$(1))" build_lib_static
312
313 ifeq ($$(CFG_DISABLE_JEMALLOC),)
314 RUSTFLAGS_alloc := --cfg jemalloc
315 ifeq ($(1),$$(CFG_BUILD))
316 ifneq ($$(CFG_JEMALLOC_ROOT),)
317 $$(JEMALLOC_LIB_$(1)): $$(CFG_JEMALLOC_ROOT)/libjemalloc_pic.a
318         @$$(call E, copy: jemalloc)
319         $$(Q)cp $$< $$@
320 else
321 $$(JEMALLOC_LIB_$(1)): $$(JEMALLOC_LOCAL_$(1))
322         $$(Q)cp $$< $$@
323 endif
324 else
325 $$(JEMALLOC_LIB_$(1)): $$(JEMALLOC_LOCAL_$(1))
326         $$(Q)cp $$< $$@
327 endif
328 else
329 $$(JEMALLOC_LIB_$(1)): $$(MKFILE_DEPS)
330         $$(Q)touch $$@
331 endif
332
333 ################################################################################
334 # compiler-rt
335 ################################################################################
336
337 ifdef CFG_ENABLE_FAST_MAKE
338 COMPRT_DEPS := $(S)/.gitmodules
339 else
340 COMPRT_DEPS := $(wildcard \
341               $(S)src/compiler-rt/* \
342               $(S)src/compiler-rt/*/* \
343               $(S)src/compiler-rt/*/*/* \
344               $(S)src/compiler-rt/*/*/*/*)
345 endif
346
347 COMPRT_NAME_$(1) := $$(call CFG_STATIC_LIB_NAME_$(1),compiler-rt)
348 COMPRT_LIB_$(1) := $$(RT_OUTPUT_DIR_$(1))/$$(COMPRT_NAME_$(1))
349 COMPRT_BUILD_DIR_$(1) := $$(RT_OUTPUT_DIR_$(1))/compiler-rt
350
351 $$(COMPRT_LIB_$(1)): $$(COMPRT_DEPS) $$(MKFILE_DEPS)
352         @$$(call E, make: compiler-rt)
353         $$(Q)$$(MAKE) -C "$(S)src/compiler-rt" \
354                 ProjSrcRoot="$(S)src/compiler-rt" \
355                 ProjObjRoot="$$(abspath $$(COMPRT_BUILD_DIR_$(1)))" \
356                 CC="$$(CC_$(1))" \
357                 AR="$$(AR_$(1))" \
358                 RANLIB="$$(AR_$(1)) s" \
359                 CFLAGS="$$(CFG_GCCISH_CFLAGS_$(1))" \
360                 TargetTriple=$(1) \
361                 triple-builtins
362         $$(Q)cp $$(COMPRT_BUILD_DIR_$(1))/triple/builtins/libcompiler_rt.a $$(COMPRT_LIB_$(1))
363
364 ################################################################################
365 # libbacktrace
366 #
367 # We use libbacktrace on linux to get symbols in backtraces, but only on linux.
368 # Elsewhere we use other system utilities, so this library is only built on
369 # linux.
370 ################################################################################
371
372 BACKTRACE_NAME_$(1) := $$(call CFG_STATIC_LIB_NAME_$(1),backtrace)
373 BACKTRACE_LIB_$(1) := $$(RT_OUTPUT_DIR_$(1))/$$(BACKTRACE_NAME_$(1))
374 BACKTRACE_BUILD_DIR_$(1) := $$(RT_OUTPUT_DIR_$(1))/libbacktrace
375
376 # We don't use this on platforms that aren't linux-based, so just make the file
377 # available, the compilation of libstd won't actually build it.
378 ifeq ($$(findstring darwin,$$(OSTYPE_$(1))),darwin)
379 # See comment above
380 $$(BACKTRACE_LIB_$(1)):
381         touch $$@
382
383 else
384 ifeq ($$(findstring ios,$$(OSTYPE_$(1))),ios)
385 # See comment above
386 $$(BACKTRACE_LIB_$(1)):
387         touch $$@
388 else
389
390 ifeq ($$(CFG_WINDOWSY_$(1)),1)
391 # See comment above
392 $$(BACKTRACE_LIB_$(1)):
393         touch $$@
394 else
395
396 ifdef CFG_ENABLE_FAST_MAKE
397 BACKTRACE_DEPS := $(S)/.gitmodules
398 else
399 BACKTRACE_DEPS := $(wildcard $(S)src/libbacktrace/*)
400 endif
401
402 # We need to export CFLAGS because otherwise it doesn't pick up cross compile
403 # builds. If libbacktrace doesn't realize this, it will attempt to read 64-bit
404 # elf headers when compiled for a 32-bit system, yielding blank backtraces.
405 #
406 # This also removes the -Werror flag specifically to prevent errors during
407 # configuration.
408 #
409 # Down below you'll also see echos into the config.h generated by the
410 # ./configure script. This is done to force libbacktrace to *not* use the
411 # atomic/sync functionality because it pulls in unnecessary dependencies and we
412 # never use it anyway.
413 $$(BACKTRACE_BUILD_DIR_$(1))/Makefile: \
414                 export CFLAGS:=$$(CFG_GCCISH_CFLAGS_$(1):-Werror=) \
415                                 -fno-stack-protector
416 $$(BACKTRACE_BUILD_DIR_$(1))/Makefile: export CC:=$$(CC_$(1))
417 $$(BACKTRACE_BUILD_DIR_$(1))/Makefile: export AR:=$$(AR_$(1))
418 $$(BACKTRACE_BUILD_DIR_$(1))/Makefile: export RANLIB:=$$(AR_$(1)) s
419 $$(BACKTRACE_BUILD_DIR_$(1))/Makefile: $$(BACKTRACE_DEPS) $$(MKFILE_DEPS)
420         $$(Q)rm -rf $$(BACKTRACE_BUILD_DIR_$(1))
421         $$(Q)mkdir -p $$(BACKTRACE_BUILD_DIR_$(1))
422         $$(Q)(cd $$(BACKTRACE_BUILD_DIR_$(1)) && \
423               $(S)src/libbacktrace/configure --target=$(1) --host=$(CFG_BUILD))
424         $$(Q)echo '#undef HAVE_ATOMIC_FUNCTIONS' >> \
425               $$(BACKTRACE_BUILD_DIR_$(1))/config.h
426         $$(Q)echo '#undef HAVE_SYNC_FUNCTIONS' >> \
427               $$(BACKTRACE_BUILD_DIR_$(1))/config.h
428
429 $$(BACKTRACE_LIB_$(1)): $$(BACKTRACE_BUILD_DIR_$(1))/Makefile $$(MKFILE_DEPS)
430         @$$(call E, make: libbacktrace)
431         $$(Q)$$(MAKE) -C $$(BACKTRACE_BUILD_DIR_$(1)) \
432                 INCDIR=$(S)src/libbacktrace
433         $$(Q)cp $$(BACKTRACE_BUILD_DIR_$(1))/.libs/libbacktrace.a $$@
434
435 endif # endif for windowsy
436 endif # endif for ios
437 endif # endif for darwin
438
439 endef
440
441 # Instantiate template for all stages/targets
442 $(foreach target,$(CFG_TARGET), \
443      $(eval $(call DEF_THIRD_PARTY_TARGETS,$(target))))