VirtualBox

source: vbox/trunk/tools/kBuildTools/VBoxXcode62.kmk

Last change on this file was 98443, checked in by vboxsync, 16 months ago

tools/*.kmk: Automatic scm cleanups. bugref:10348

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 21.4 KB
Line 
1# $Id: VBoxXcode62.kmk 98443 2023-02-02 13:03:05Z vboxsync $
2## @file
3# kBuild Tool Config - Xcode 6.2 from tools, dmg or similar.
4#
5
6#
7# Copyright (C) 2016-2023 Oracle and/or its affiliates.
8#
9# This file is part of VirtualBox base platform packages, as
10# available from https://www.virtualbox.org.
11#
12# This program is free software; you can redistribute it and/or
13# modify it under the terms of the GNU General Public License
14# as published by the Free Software Foundation, in version 3 of the
15# License.
16#
17# This program is distributed in the hope that it will be useful, but
18# WITHOUT ANY WARRANTY; without even the implied warranty of
19# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20# General Public License for more details.
21#
22# You should have received a copy of the GNU General Public License
23# along with this program; if not, see <https://www.gnu.org/licenses>.
24#
25# SPDX-License-Identifier: GPL-3.0-only
26#
27
28TOOL_VBoxXcode62 := Xcode 6.2 from tools, dmg or similar
29
30# Figure out the path of the Xcode.app/Contents/Developer/.
31ifndef PATH_TOOL_VBoxXcode62
32 PATH_TOOL_VBoxXcode62 := $(wildcard $(KBUILD_DEVTOOLS_TRG)/xcode/v6.2*/*.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk)
33 ifeq ($(PATH_TOOL_VBoxXcode62),)
34 PATH_TOOL_VBoxXcode62 := $(wildcard $(KBUILD_DEVTOOLS)/darwin.amd64/xcode/v6.2*/*.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk)
35 ifeq ($(PATH_TOOL_VBoxXcode62),)
36 PATH_TOOL_VBoxXcode62 := $(wildcard $(KBUILD_DEVTOOLS)/darwin.x86/xcode/v6.2*/*.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk)
37 ifeq ($(PATH_TOOL_VBoxXcode62),)
38 PATH_TOOL_VBoxXcode62 := $(wildcard $(KBUILD_DEVTOOLS)/darwin.x86/xcode/v6.2*/*.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk)
39 ifeq ($(PATH_TOOL_VBoxXcode62),)
40 PATH_TOOL_VBoxXcode62 := $(wildcard /Applications/*Xcode*.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk)
41 ifeq ($(PATH_TOOL_VBoxXcode62),)
42 PATH_TOOL_VBoxXcode62 := $(wildcard /Volumes/Xcode/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk)
43 endif
44 endif
45 endif
46 endif
47 endif
48 ifneq ($(PATH_TOOL_VBoxXcode62),)
49 PATH_TOOL_VBoxXcode62 := $(patsubst %/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk,%,$(firstword $(rsort $(PATH_TOOL_VBoxXcode62))))
50 endif
51else
52 # Resolve any fance stuff once and for all.
53 PATH_TOOL_VBoxXcode62 := $(PATH_TOOL_VBoxXcode62)
54endif
55
56# Additional paths derived from the above (external usage as well as tool internal).
57PATH_TOOL_VBoxXcode62_SDKS ?= $(PATH_TOOL_VBoxXcode62)/Platforms/MacOSX.platform/Developer/SDKs
58PATH_TOOL_VBoxXcode62_TOOLCHAIN ?= $(PATH_TOOL_VBoxXcode62)/Toolchains/XcodeDefault.xctoolchain
59PATH_TOOL_VBoxXcode62_TOOLCHAIN_BIN_SLASH ?= $(PATH_TOOL_VBoxXcode62_TOOLCHAIN)/usr/bin/
60
61# Tools macros.
62TOOL_VBoxXcode62_CC ?= $(PATH_TOOL_VBoxXcode62_TOOLCHAIN_BIN_SLASH)clang$(HOSTSUFF_EXE)
63TOOL_VBoxXcode62_CXX ?= $(PATH_TOOL_VBoxXcode62_TOOLCHAIN_BIN_SLASH)clang++$(HOSTSUFF_EXE)
64TOOL_VBoxXcode62_OBJC ?= $(PATH_TOOL_VBoxXcode62_TOOLCHAIN_BIN_SLASH)clang$(HOSTSUFF_EXE)
65TOOL_VBoxXcode62_OBJCXX ?= $(PATH_TOOL_VBoxXcode62_TOOLCHAIN_BIN_SLASH)clang$(HOSTSUFF_EXE)
66TOOL_VBoxXcode62_AS ?= $(PATH_TOOL_VBoxXcode62_TOOLCHAIN_BIN_SLASH)clang$(HOSTSUFF_EXE)
67TOOL_VBoxXcode62_LD ?= $(PATH_TOOL_VBoxXcode62_TOOLCHAIN_BIN_SLASH)clang++$(HOSTSUFF_EXE)
68TOOL_VBoxXcode62_LD_SYSMOD ?= $(PATH_TOOL_VBoxXcode62_TOOLCHAIN_BIN_SLASH)clang++$(HOSTSUFF_EXE)
69ifndef TOOL_VBoxXcode62_LDFLAGS.$(KBUILD_TARGET)
70 TOOL_VBoxXcode62_LDFLAGS.dll ?= -dynamiclib
71else
72 TOOL_VBoxXcode62_LDFLAGS.dll ?= $(TOOL_VBoxXcode62_LDFLAGS.$(KBUILD_TARGET))
73endif
74TOOL_VBoxXcode62_LDFLAGS.sysmod ?= -r
75TOOL_VBoxXcode62_DSYMUTIL ?= $(PATH_TOOL_VBoxXcode62_TOOLCHAIN_BIN_SLASH)dsymutil$(HOSTSUFF_EXE)
76
77ifdef SLKRUNS
78 TOOL_VBoxXcode62_CC += -fmessage-length=0
79 TOOL_VBoxXcode62_CXX += -fmessage-length=0
80 TOOL_VBoxXcode62_OBJC += -fmessage-length=0
81 TOOL_VBoxXcode62_OBJCXX += -fmessage-length=0
82endif
83
84# Set up environment macros.
85TOOL_VBoxXcode62_ENV_SETUP ?= $(REDIRECT) \
86 -E 'DEVELOPER_DIR=$(PATH_TOOL_VBoxXcode62)' \
87 -E 'PATH=$(PATH_TOOL_VBoxXcode62)/usr/bin/:$(PATH_TOOL_VBoxXcode62)/Toolchains/XcodeDefault.xctoolchain/usr/bin:$(PATH)' \
88 --
89TOOL_VBoxXcode62_ENV_SETUP_EXT ?= $(REDIRECT_EXT) \
90 -E 'DEVELOPER_DIR=$(PATH_TOOL_VBoxXcode62)' \
91 -E 'PATH=$(PATH_TOOL_VBoxXcode62)/usr/bin/:$(PATH_TOOL_VBoxXcode62)/Toolchains/XcodeDefault.xctoolchain/usr/bin:$(PATH)' \
92 --
93
94# General Properties used by kBuild
95TOOL_VBoxXcode62_COBJSUFF ?= .o
96TOOL_VBoxXcode62_CFLAGS ?=
97TOOL_VBoxXcode62_CFLAGS.debug ?= -g
98TOOL_VBoxXcode62_CFLAGS.profile ?= -O2 #-g -pg
99TOOL_VBoxXcode62_CFLAGS.release ?= -O2
100TOOL_VBoxXcode62_CINCS ?=
101TOOL_VBoxXcode62_CDEFS ?=
102
103TOOL_VBoxXcode62_CXXOBJSUFF ?= .o
104TOOL_VBoxXcode62_CXXFLAGS ?=
105TOOL_VBoxXcode62_CXXFLAGS.debug ?= -g
106TOOL_VBoxXcode62_CXXFLAGS.profile ?= -O2 #-g -pg
107TOOL_VBoxXcode62_CXXFLAGS.release ?= -O2
108TOOL_VBoxXcode62_CXXINCS ?=
109TOOL_VBoxXcode62_CXXDEFS ?=
110
111TOOL_VBoxXcode62_OBJCOBJSUFF ?= .o
112TOOL_VBoxXcode62_OBJCFLAGS ?=
113TOOL_VBoxXcode62_OBJCFLAGS.debug ?= -g
114TOOL_VBoxXcode62_OBJCFLAGS.profile ?= -O2 #-g -pg
115TOOL_VBoxXcode62_OBJCFLAGS.release ?= -O2
116TOOL_VBoxXcode62_OBJCINCS ?=
117TOOL_VBoxXcode62_OBJCDEFS ?=
118
119TOOL_VBoxXcode62_OBJCXXOBJSUFF ?= .o
120TOOL_VBoxXcode62_OBJCXXFLAGS ?=
121TOOL_VBoxXcode62_OBJCXXFLAGS.debug ?= -g
122TOOL_VBoxXcode62_OBJCXXFLAGS.profile ?= -O2 #-g -pg
123TOOL_VBoxXcode62_OBJCXXFLAGS.release ?= -O2
124TOOL_VBoxXcode62_OBJCXXINCS ?=
125TOOL_VBoxXcode62_OBJCXXDEFS ?=
126
127TOOL_VBoxXcode62_ASFLAGS ?= -x assembler-with-cpp
128TOOL_VBoxXcode62_ASFLAGS.debug ?= -g
129TOOL_VBoxXcode62_ASFLAGS.profile ?= -g
130TOOL_VBoxXcode62_ASOBJSUFF ?= .o
131
132TOOL_VBoxXcode62_AR ?= $(PATH_TOOL_VBoxXcode62_TOOLCHAIN_BIN_SLASH)ar$(HOSTSUFF_EXE)
133TOOL_VBoxXcode62_ARFLAGS ?= -c -rs
134TOOL_VBoxXcode62_ARLIBSUFF ?= .a
135
136TOOL_VBoxXcode62_LDFLAGS ?=
137TOOL_VBoxXcode62_LDFLAGS.debug ?= -g
138TOOL_VBoxXcode62_LDFLAGS.profile ?= -g
139
140TOOL_VBoxXcode62_STRIP_PROGRAM ?= $(PATH_TOOL_VBoxXcode62_TOOLCHAIN_BIN_SLASH)strip -SXxru
141TOOL_VBoxXcode62_STRIP_DLL ?= $(PATH_TOOL_VBoxXcode62_TOOLCHAIN_BIN_SLASH)strip -Sxru
142TOOL_VBoxXcode62_STRIP_SYSMOD ?= $(PATH_TOOL_VBoxXcode62_TOOLCHAIN_BIN_SLASH)strip -Sru
143
144
145##
146# Calculate the files in the debug bundle.
147# @param 1 The whole output filename.
148# @param 2 The output filename sans suffix.
149TOOL_VBoxXcode62_DEBUG_BUNDLE_FN = \
150 $(1).dSYM/Contents/Info.plist \
151 $(1).dSYM/Contents/Resources/DWARF/$(notdir $(1))
152
153##
154# Calculate the files in the debug bundle.
155# @param 1 The whole linker output filename.
156# @param 2 The linker output filename sans suffix.
157# @param 3 The desired install name (no dir slash).
158# @remarks The Info.plist has some reference to the original name, but gdb
159# does not care and only check for a symbol file in the DWARF
160# directory with the same name as the debugged module.
161TOOL_VBoxXcode62_DEBUG_INSTALL_FN = \
162 $(3).dSYM/ \
163 $(3).dSYM/Contents/ \
164 $(3).dSYM/Contents/Resources/ \
165 $(3).dSYM/Contents/Resources/DWARF/ \
166 $(1).dSYM/Contents/Info.plist=>$(3).dSYM/Contents/Info.plist \
167 $(1).dSYM/Contents/Resources/DWARF/$(notdir $(1))=>$(3).dSYM/Contents/Resources/DWARF/$(notdir $(3))
168
169
170## Compile C source.
171# @param $(target) Normalized main target name.
172# @param $(source) Source filename (relative).
173# @param $(obj) Object file name. This shall be (re)created by the compilation.
174# @param $(dep) Dependcy file. This shall be (re)created by the compilation.
175# @param $(flags) Flags.
176# @param $(defs) Definitions. No -D or something.
177# @param $(incs) Includes. No -I or something.
178# @param $(dirdep) Directory creation dependency.
179# @param $(deps) Other dependencies.
180#
181# @param $(outbase) Output basename (full). Use this for list files and such.
182# @param $(objsuff) Object suffix.
183TOOL_VBoxXcode62_COMPILE_C_DEPEND =
184TOOL_VBoxXcode62_COMPILE_C_DEPORD =
185ifdef KBUILD_USE_KOBJCACHE
186 TOOL_VBoxXcode62_COMPILE_C_USES_KOBJCACHE = 1
187 TOOL_VBoxXcode62_COMPILE_C_OUTPUT = $(outbase).i
188 define TOOL_VBoxXcode62_COMPILE_C_CMDS
189 $(QUIET)$(TOOL_VBoxXcode62_ENV_SETUP) $(KOBJCACHE) -f $(outbase).koc -d $(PATH_OBJCACHE) -t $(bld_trg).$(bld_trg_arch) -p\
190 --kObjCache-cpp $(outbase).i\
191 $(TOOL_VBoxXcode62_CC) -E -o -\
192 $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
193 -Wp,-MD,$(dep) -Wp,-MP\
194 $(abspath $(source))\
195 --kObjCache-cc $(obj)\
196 $(TOOL_VBoxXcode62_CC) -c\
197 $(flags) -x c\
198 -o $(obj)\
199 -
200 %$(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
201 endef
202else # !KBUILD_USE_KOBJCACHE
203 TOOL_VBoxXcode62_COMPILE_C_OUTPUT =
204 define TOOL_VBoxXcode62_COMPILE_C_CMDS
205 $(QUIET)$(TOOL_VBoxXcode62_ENV_SETUP) $(TOOL_VBoxXcode62_CC) -c\
206 $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
207 -Wp,-MD,$(dep) -Wp,-MP\
208 -o $(obj)\
209 $(abspath $(source))
210 %$(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
211 endef
212endif # !KUSE_OBJCACHE
213
214
215## Compile C++ source.
216# @param $(target) Normalized main target name.
217# @param $(source) Source filename (relative).
218# @param $(obj) Object file name. This shall be (re)created by the compilation.
219# @param $(dep) Dependcy file. This shall be (re)created by the compilation.
220# @param $(flags) Flags.
221# @param $(defs) Definitions. No -D or something.
222# @param $(incs) Includes. No -I or something.
223# @param $(dirdep) Directory creation dependency.
224# @param $(deps) Other dependencies.
225# @param $(outbase) Output basename (full). Use this for list files and such.
226# @param $(objsuff) Object suffix.
227TOOL_VBoxXcode62_COMPILE_CXX_DEPEND =
228TOOL_VBoxXcode62_COMPILE_CXX_DEPORD =
229ifdef KBUILD_USE_KOBJCACHE
230 TOOL_VBoxXcode62_COMPILE_CXX_USES_KOBJCACHE = 1
231 TOOL_VBoxXcode62_COMPILE_CXX_OUTPUT = $(outbase).ii
232 define TOOL_VBoxXcode62_COMPILE_CXX_CMDS
233 $(QUIET)$(TOOL_VBoxXcode62_ENV_SETUP) $(KOBJCACHE) -f $(outbase).koc -d $(PATH_OBJCACHE) -t $(bld_trg).$(bld_trg_arch) -p\
234 --kObjCache-cpp $(outbase).ii\
235 $(TOOL_VBoxXcode62_CXX) -E -o -\
236 $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
237 -Wp,-MD,$(dep)\
238 -Wp,-MP\
239 $(abspath $(source))\
240 --kObjCache-cc $(obj)\
241 $(TOOL_VBoxXcode62_CXX) -c\
242 $(flags) -x c++\
243 -o $(obj)\
244 -
245 %$(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
246 endef
247else # !KBUILD_USE_KOBJCACHE
248 TOOL_VBoxXcode62_COMPILE_CXX_OUTPUT =
249 define TOOL_VBoxXcode62_COMPILE_CXX_CMDS
250 $(QUIET)$(TOOL_VBoxXcode62_ENV_SETUP) $(TOOL_VBoxXcode62_CXX) -c\
251 $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
252 -Wp,-MD,$(dep)\
253 -Wp,-MP\
254 -o $(obj)\
255 $(abspath $(source))
256 %$(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
257 endef
258endif # !KBUILD_USE_KOBJCACHE
259
260
261## Compile Objective-C source.
262# @param $(target) Normalized main target name.
263# @param $(source) Source filename (relative).
264# @param $(obj) Object file name. This shall be (re)created by the compilation.
265# @param $(dep) Dependcy file. This shall be (re)created by the compilation.
266# @param $(flags) Flags.
267# @param $(defs) Definitions. No -D or something.
268# @param $(incs) Includes. No -I or something.
269# @param $(dirdep) Directory creation dependency.
270# @param $(deps) Other dependencies.
271# @param $(outbase) Output basename (full). Use this for list files and such.
272# @param $(objsuff) Object suffix.
273TOOL_VBoxXcode62_COMPILE_OBJC_DEPEND =
274TOOL_VBoxXcode62_COMPILE_OBJC_DEPORD =
275ifdef KBUILD_USE_KOBJCACHE
276 TOOL_VBoxXcode62_COMPILE_OBJC_USES_KOBJCACHE = 1
277 TOOL_VBoxXcode62_COMPILE_OBJC_OUTPUT = $(outbase).mi
278 define TOOL_VBoxXcode62_COMPILE_OBJC_CMDS
279 $(QUIET)$(TOOL_VBoxXcode62_ENV_SETUP) $(KOBJCACHE) -f $(outbase).koc -d $(PATH_OBJCACHE) -t $(bld_trg).$(bld_trg_arch) -p\
280 --kObjCache-cpp $(outbase).ii\
281 $(TOOL_VBoxXcode62_OBJC) -E -o -\
282 $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
283 -Wp,-MD,$(dep) -Wp,-MP\
284 $(abspath $(source))\
285 --kObjCache-cc $(obj)\
286 $(TOOL_VBoxXcode62_OBJC) -c\
287 $(flags) -x objective-c \
288 -o $(obj)\
289 -
290 %$(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
291 endef
292else # !KBUILD_USE_KOBJCACHE
293 TOOL_VBoxXcode62_COMPILE_OBJC_OUTPUT =
294 define TOOL_VBoxXcode62_COMPILE_OBJC_CMDS
295 $(QUIET)$(TOOL_VBoxXcode62_ENV_SETUP) $(TOOL_VBoxXcode62_OBJC) -c\
296 $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
297 -Wp,-MD,$(dep) -Wp,-MP\
298 -o $(obj)\
299 $(abspath $(source))
300 %$(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
301 endef
302endif # !KBUILD_USE_KOBJCACHE
303
304
305## Compile Objective-C++ source.
306# @param $(target) Normalized main target name.
307# @param $(source) Source filename (relative).
308# @param $(obj) Object file name. This shall be (re)created by the compilation.
309# @param $(dep) Dependcy file. This shall be (re)created by the compilation.
310# @param $(flags) Flags.
311# @param $(defs) Definitions. No -D or something.
312# @param $(incs) Includes. No -I or something.
313# @param $(dirdep) Directory creation dependency.
314# @param $(deps) Other dependencies.
315# @param $(outbase) Output basename (full). Use this for list files and such.
316# @param $(objsuff) Object suffix.
317TOOL_VBoxXcode62_COMPILE_OBJCXX_DEPEND =
318TOOL_VBoxXcode62_COMPILE_OBJCXX_DEPORD =
319ifdef KBUILD_USE_KOBJCACHE
320 TOOL_VBoxXcode62_COMPILE_OBJCXX_USES_KOBJCACHE = 1
321 TOOL_VBoxXcode62_COMPILE_OBJCXX_OUTPUT = $(outbase).mii
322 define TOOL_VBoxXcode62_COMPILE_OBJCXX_CMDS
323 $(QUIET)$(TOOL_VBoxXcode62_ENV_SETUP) $(KOBJCACHE) -f $(outbase).koc -d $(PATH_OBJCACHE) -t $(bld_trg).$(bld_trg_arch) -p\
324 --kObjCache-cpp $(outbase).mii\
325 $(TOOL_VBoxXcode62_OBJCXX) -E -o -\
326 $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
327 -Wp,-MD,$(dep) -Wp,-MP\
328 $(abspath $(source))\
329 --kObjCache-cc $(obj)\
330 $(TOOL_VBoxXcode62_OBJCXX) -c\
331 $(flags) -x objective-c++ \
332 -o $(obj)\
333 -
334 %$(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
335 endef
336else # !KBUILD_USE_KOBJCACHE
337 TOOL_VBoxXcode62_COMPILE_OBJCXX_OUTPUT =
338 define TOOL_VBoxXcode62_COMPILE_OBJCXX_CMDS
339 $(QUIET)$(TOOL_VBoxXcode62_ENV_SETUP) $(TOOL_VBoxXcode62_OBJCXX) -c\
340 $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
341 -Wp,-MD,$(dep) -Wp,-MP\
342 -o $(obj)\
343 $(abspath $(source))
344 %$(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
345 endef
346endif # !KBUILD_USE_KOBJCACHE
347
348
349## Compile Assembly source.
350# @param $(target) Normalized main target name.
351# @param $(source) Source filename (relative).
352# @param $(obj) Object file name. This shall be (re)created by the compilation.
353# @param $(dep) Dependcy file. This shall be (re)created by the compilation.
354# @param $(flags) Flags.
355# @param $(defs) Definitions. No -D or something.
356# @param $(incs) Includes. No -I or something.
357# @param $(dirdep) Directory creation dependency.
358# @param $(deps) Other dependencies.
359# @param $(outbase) Output basename (full). Use this for list files and such.
360# @param $(objsuff) Object suffix.
361#
362TOOL_VBoxXcode62_COMPILE_AS_OUTPUT =
363TOOL_VBoxXcode62_COMPILE_AS_DEPEND =
364TOOL_VBoxXcode62_COMPILE_AS_DEPORD =
365define TOOL_VBoxXcode62_COMPILE_AS_CMDS
366 $(QUIET)$(TOOL_VBoxXcode62_ENV_SETUP) $(TOOL_VBoxXcode62_AS) -c\
367 $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
368 -Wp,-MD,$(dep) -Wp,-MP\
369 -o $(obj)\
370 $(abspath $(source))
371 %$(QUIET)$(APPEND) -n "$(dep)" "" "$(source):" ""
372endef
373
374
375## Link library
376# @param $(target) Normalized main target name.
377# @param $(out) Library name.
378# @param $(objs) Object files to put in the library.
379# @param $(flags) Flags.
380# @param $(dirdep) Directory creation dependency.
381# @param $(deps) Other dependencies.
382# @param $(othersrc) Unhandled sources.
383# @param $(outbase) Output basename (full). Use this for list files and such.
384TOOL_VBoxXcode62_LINK_LIBRARY_OUTPUT =
385TOOL_VBoxXcode62_LINK_LIBRARY_DEPEND = $(othersrc)
386TOOL_VBoxXcode62_LINK_LIBRARY_DEPORD =
387define TOOL_VBoxXcode62_LINK_LIBRARY_CMDS
388 $(if $(strip $(objs)),$(call xargs,$(QUIET)$(TOOL_VBoxXcode62_ENV_SETUP) $(TOOL_VBoxXcode62_AR) $(flags) $(out),$(objs)))
389 $(foreach lib,$(othersrc)\
390 ,$(NL)$(TAB)$(call MSG_AR_MERGE,$(target),$(out),$(lib)) \
391 $(NL)$(TAB)$(QUIET)$(RM_EXT) -f $(dir $(outbase))ar.tmp.dir/* \
392 $(NL)$(TAB)$(QUIET)$(MKDIR) -p $(dir $(outbase))/ar.tmp.dir/ \
393 $(NL)$(TAB)$(QUIET)(cd $(dir $(outbase))ar.tmp.dir/ \
394 && $(TOOL_VBoxXcode62_ENV_SETUP_EXT) $(TOOL_VBoxXcode62_AR) -x $(abspath $(lib)) \
395 && $(RM_EXT) -f ./__.SYMDEF* \
396 && $(TOOL_VBoxXcode62_ENV_SETUP_EXT) $(TOOL_VBoxXcode62_AR) $(flags) $(out) *) \
397 $(NL)$(TAB)$(QUIET)$(RM_EXT) -f $(dir $(outbase))/ar.tmp.dir/* \
398 $(NL)$(TAB)$(QUIET)$(RMDIR) $(dir $(outbase))ar.tmp.dir/)
399endef
400
401
402## Link program
403# @param $(target) Normalized main target name.
404# @param $(out) Program name.
405# @param $(objs) Object files to link together.
406# @param $(libs) Libraries to search.
407# @param $(libpath) Library search paths.
408# @param $(flags) Flags.
409# @param $(dirdep) Directory creation dependency.
410# @param $(deps) Other dependencies.
411# @param $(othersrc) Unhandled sources.
412# @param $(custom_pre) Custom step invoked before linking.
413# @param $(custom_post) Custom step invoked after linking.
414# @param $(outbase) Output basename (full). Use this for list files and such.
415TOOL_VBoxXcode62_LINK_PROGRAM_OUTPUT = $(outbase).rsp
416TOOL_VBoxXcode62_LINK_PROGRAM_OUTPUT_DEBUG = $(call TOOL_VBoxXcode62_DEBUG_BUNDLE_FN,$(out))
417TOOL_VBoxXcode62_LINK_PROGRAM_DEBUG_INSTALL_FN = $(TOOL_VBoxXcode62_DEBUG_INSTALL_FN)
418TOOL_VBoxXcode62_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))
419TOOL_VBoxXcode62_LINK_PROGRAM_DEPORD =
420define TOOL_VBoxXcode62_LINK_PROGRAM_CMDS
421 $(QUIET)$(APPEND) -n $(outbase).rsp $(objs)
422 $(QUIET)$(TOOL_VBoxXcode62_ENV_SETUP) $(TOOL_VBoxXcode62_LD) $(flags) -o $(out)\
423 -filelist $(outbase).rsp\
424 $(foreach p,$(libpath), -L$(p))\
425 $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))
426 ifeq ($(ld_debug),split)
427 $(QUIET)$(TOOL_VBoxXcode62_ENV_SETUP) $(TOOL_VBoxXcode62_DSYMUTIL) -o $(out).dSYM/ $(out)
428 $(QUIET)$(TOOL_VBoxXcode62_ENV_SETUP) $(TOOL_VBoxXcode62_STRIP_PROGRAM) $(out)
429 endif
430endef
431
432
433## Link DLL
434# @param $(target) Normalized main target name.
435# @param $(out) Program name.
436# @param $(objs) Object files to link together.
437# @param $(libs) Libraries to search.
438# @param $(libpath) Library search paths.
439# @param $(flags) Flags.
440# @param $(dirdep) Directory creation dependency.
441# @param $(deps) Other dependencies.
442# @param $(othersrc) Unhandled sources.
443# @param $(custom_pre) Custom step invoked before linking.
444# @param $(custom_post) Custom step invoked after linking.
445# @param $(outbase) Output basename (full). Use this for list files and such.
446TOOL_VBoxXcode62_LINK_DLL_OUTPUT = $(outbase).rsp
447TOOL_VBoxXcode62_LINK_DLL_OUTPUT_DEBUG = $(call TOOL_VBoxXcode62_DEBUG_BUNDLE_FN,$(out))
448TOOL_VBoxXcode62_LINK_DLL_DEBUG_INSTALL_FN = $(TOOL_VBoxXcode62_DEBUG_INSTALL_FN)
449TOOL_VBoxXcode62_LINK_DLL_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))
450TOOL_VBoxXcode62_LINK_DLL_DEPORD =
451define TOOL_VBoxXcode62_LINK_DLL_CMDS
452 $(QUIET)$(APPEND) -n $(outbase).rsp $(objs)
453 $(QUIET)$(TOOL_VBoxXcode62_ENV_SETUP) $(TOOL_VBoxXcode62_LD) $(TOOL_VBoxXcode62_LDFLAGS.dll) $(flags) -o $(out)\
454 $(call TOOL_VBoxXcode62_LD_SONAME,$(target),$(out))\
455 -filelist $(outbase).rsp\
456 $(foreach p,$(libpath), -L$(p))\
457 $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))
458 ifeq ($(ld_debug),split)
459 $(QUIET)$(TOOL_VBoxXcode62_ENV_SETUP) $(TOOL_VBoxXcode62_DSYMUTIL) -o $(out).dSYM/ $(out)
460 $(QUIET)$(TOOL_VBoxXcode62_ENV_SETUP) $(TOOL_VBoxXcode62_STRIP_DLL) $(out)
461 endif
462endef
463
464
465## Link system module (windows aka driver, linux aka kernel module)
466# @param $(target) Normalized main target name.
467# @param $(out) System module name.
468# @param $(objs) Object files to link together.
469# @param $(libs) Libraries to search.
470# @param $(libpath) Library search paths.
471# @param $(flags) Flags.
472# @param $(dirdep) Directory creation dependency.
473# @param $(deps) Other dependencies.
474# @param $(othersrc) Unhandled sources.
475# @param $(custom_pre) Custom step invoked before linking.
476# @param $(custom_post) Custom step invoked after linking.
477# @param $(outbase) Output basename (full). Use this for list files and such.
478TOOL_VBoxXcode62_LINK_SYSMOD_OUTPUT = $(outbase).rsp
479TOOL_VBoxXcode62_LINK_SYSMOD_OUTPUT_DEBUG = $(call TOOL_VBoxXcode62_DEBUG_BUNDLE_FN,$(out))
480TOOL_VBoxXcode62_LINK_SYSMOD_DEBUG_INSTALL_FN = $(TOOL_VBoxXcode62_DEBUG_INSTALL_FN)
481TOOL_VBoxXcode62_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib)))
482TOOL_VBoxXcode62_LINK_SYSMOD_DEPORD =
483define TOOL_VBoxXcode62_LINK_SYSMOD_CMDS
484 $(QUIET)$(APPEND) -n $(outbase).rsp $(objs)
485 $(QUIET)$(TOOL_VBoxXcode62_ENV_SETUP) $(TOOL_VBoxXcode62_LD_SYSMOD) $(TOOL_VBoxXcode62_LDFLAGS.sysmod) $(flags) -o $(out)\
486 -filelist $(outbase).rsp\
487 $(foreach p,$(libpath), -L$(p))\
488 $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(lib)), $(lib)))
489 ifeq ($(ld_debug),split)
490 $(QUIET)$(TOOL_VBoxXcode62_ENV_SETUP) $(TOOL_VBoxXcode62_DSYMUTIL) -o $(out).dSYM/ $(out)
491 $(QUIET)$(TOOL_VBoxXcode62_ENV_SETUP) $(TOOL_VBoxXcode62_STRIP_SYSMOD) $(out)
492 endif
493endef
494
Note: See TracBrowser for help on using the repository browser.

© 2023 Oracle
ContactPrivacy policyTerms of Use