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