VirtualBox

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

Last change on this file since 61480 was 60968, checked in by vboxsync, 9 years ago

Hacked up a VBoxXcode62 kBuild tool to put some of the hacks we have in Config.kmk in the right place.

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

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette