VirtualBox

source: kBuild/trunk/kBuild/tools/VCC120AMD64.kmk

Last change on this file was 3303, checked in by bird, 5 years ago

VCC*.kmk,OPENWATCOM*.kmk: Try preserve .map and .rsp files so they can be inspected if linking fails. Fixed mssing .rsp cleaning up in OPENWATCOM.kmk for the archiver.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 21.1 KB
Line 
1# $Id: VCC120AMD64.kmk 3303 2020-01-14 15:09:44Z bird $
2## @file
3# kBuild Tool Config - Visual C++ 12.0 (aka Visual 2013 and MSC v18), targeting AMD64.
4#
5
6#
7# Copyright (c) 2004-2017 knut st. osmundsen <[email protected]>
8#
9# This file is part of kBuild.
10#
11# kBuild is free software; you can redistribute it and/or modify
12# it under the terms of the GNU General Public License as published by
13# the Free Software Foundation; either version 2 of the License, or
14# (at your option) any later version.
15#
16# kBuild is distributed in the hope that it will be useful,
17# but WITHOUT ANY WARRANTY; without even the implied warranty of
18# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19# GNU General Public License for more details.
20#
21# You should have received a copy of the GNU General Public License
22# along with kBuild; if not, write to the Free Software
23# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24#
25#
26# As a special exception you are granted permission to include this file, via
27# the kmk include directive, as you wish without this in itself causing the
28# resulting makefile, program or whatever to be covered by the GPL license.
29# This exception does not however invalidate any other reasons why the makefile,
30# program, whatever should not be covered the GPL.
31#
32#
33
34TOOL_VCC120AMD64 := Visual C++ 12.0 (aka Visual 2013 and MSC v18), targeting AMD64
35
36# Tool Specific Properties
37ifndef PATH_TOOL_VCC120AMD64
38 PATH_TOOL_VCC120AMD64 := $(wildcard $(KBUILD_DEVTOOLS)/win.x86/vcc/v12*)
39 ifeq ($(PATH_TOOL_VCC120AMD64),)
40 PATH_TOOL_VCC120AMD64 := $(PATH_TOOL_VCC120)
41 endif
42 ifeq ($(PATH_TOOL_VCC120AMD64),)
43 PATH_TOOL_VCC120AMD64 := $(PATH_TOOL_VCC120X86)
44 endif
45 ifeq ($(PATH_TOOL_VCC120AMD64),)
46 PATH_TOOL_VCC120AMD64 := $(wildcard $(KBUILD_DEVTOOLS)/win.x86/vcc/v12*)
47 endif
48 ifneq ($(PATH_TOOL_VCC120AMD64),)
49 PATH_TOOL_VCC120AMD64 := $(lastword $(sort $(PATH_TOOL_VCC120AMD64)))
50 else
51 $(warning kBuild: PATH_TOOL_VCC120AMD64 cannot be determined!)
52 PATH_TOOL_VCC120AMD64 := $(KBUILD_DEVTOOLS)/win.x86/vcc/v12
53 endif
54else
55 # Resolve any fancy stuff once and for all.
56 PATH_TOOL_VCC120AMD64 := $(PATH_TOOL_VCC120AMD64)
57endif
58if "$(KBUILD_HOST).$(KBUILD_HOST_ARCH)" == "win.amd64" && exists("$(PATH_TOOL_VCC120AMD64)/bin/amd64") # Missing in express edition.
59PATH_TOOL_VCC120AMD64_BIN ?= $(PATH_TOOL_VCC120AMD64)/bin/amd64
60#$(error works now: $(PATH_TOOL_VCC120AMD64)/bin/amd64)
61else
62#$(error no joy: $(PATH_TOOL_VCC120AMD64)/bin/amd64)
63PATH_TOOL_VCC120AMD64_BIN_DLL ?= $(PATH_TOOL_VCC120AMD64)/bin
64PATH_TOOL_VCC120AMD64_BIN ?= $(PATH_TOOL_VCC120AMD64)/bin/x86_amd64
65endif
66PATH_TOOL_VCC120AMD64_LIB ?= $(PATH_TOOL_VCC120AMD64)/lib/amd64
67PATH_TOOL_VCC120AMD64_INC ?= $(PATH_TOOL_VCC120AMD64)/include
68PATH_TOOL_VCC120AMD64_ATLMFC ?= $(PATH_TOOL_VCC120AMD64)/atlmfc
69PATH_TOOL_VCC120AMD64_ATLMFC_INC ?= $(PATH_TOOL_VCC120AMD64_ATLMFC)/include
70PATH_TOOL_VCC120AMD64_ATLMFC_LIB ?= $(PATH_TOOL_VCC120AMD64_ATLMFC)/lib/amd64
71TOOL_VCC120AMD64_CC ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC120AMD64_BIN)/cl.exe
72TOOL_VCC120AMD64_CXX ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC120AMD64_BIN)/cl.exe
73TOOL_VCC120AMD64_AS ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC120AMD64_BIN)/ml64.exe
74#TOOL_VCC120AMD64_AR ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC120AMD64_BIN)/lib.exe - just an exec wrapper for the below
75TOOL_VCC120AMD64_AR ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC120AMD64_BIN)/link.exe /LIB
76TOOL_VCC120AMD64_LD ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC120AMD64_BIN)/link.exe
77TOOL_VCC120AMD64_DUMPBIN ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC120AMD64_BIN)/dumpbin.exe
78TOOL_VCC120AMD64_EDITBIN ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC120AMD64_BIN)/editbin.exe
79TOOL_VCC120AMD64_RC ?= $(EXEC_X86_WIN32) $(call TOOL_VCC120_FN_FIND_SDK_TOOL,rc.exe,[Rr][Cc].[Ee][Xx][Ee],TOOL_VCC120_RC_CACHED)
80TOOL_VCC120AMD64_MT ?= $(EXEC_X86_WIN32) $(call TOOL_VCC120_FN_FIND_SDK_TOOL,mt.exe,[Mm][Tt].[Ee][Xx][Ee],TOOL_VCC120_MT_CACHED)
81ifdef TOOL_VCC120AMD64_USE_KSUBMIT
82 ifeq ($(KBUILD_HOST),win)
83 ifneq ($(substr $(PATH_TOOL_VCC120AMD64_BIN),-9),x86_amd64)
84 TOOL_VCC120AMD64_KSUBMIT ?= kmk_builtin_kSubmit --64-bit
85 ifdef PATH_TOOL_VCC120AMD64_BIN_DLL
86 TOOL_VCC120AMD64_KSUBMIT += --prepend 'PATH=$(PATH_TOOL_VCC120AMD64_BIN_DLL)$(HOST_PATH_SEP)'
87 endif
88 TOOL_VCC120AMD64_KSUBMIT_DD = $(TOOL_VCC120AMD64_KSUBMIT) --
89 else
90 # "fatal error C1902: Program database manager mismatch; please check your installation" when mixing with the 32-bit compiler.
91 #TOOL_VCC120AMD64_KSUBMIT ?= kmk_builtin_kSubmit --32-bit
92 #TOOL_VCC120AMD64_KSUBMIT_DD = $(TOOL_VCC120AMD64_KSUBMIT) --
93 endif
94 endif
95else ifdef PATH_TOOL_VCC120AMD64_BIN_DLL
96 TOOL_VCC120AMD64_KSUBMIT_DD = $(REDIRECT) --prepend 'PATH=$(PATH_TOOL_VCC120AMD64_BIN_DLL)$(HOST_PATH_SEP)' --
97endif
98
99# The following in duplicated in VCC120.kmk and VCC120X86.kmk.
100TOOL_VCC120_FN_FIND_SDK_TOOL_SUB = $(eval $3 := $(firstword \
101 $(if-expr defined(PATH_SDK_WINPSDK71_BIN), $(wildcard $(PATH_SDK_WINPSDK71_BIN)/$2)) \
102 $(if-expr defined(PATH_SDK_WINPSDK_BIN) , $(wildcard $(PATH_SDK_WINPSDK_BIN)/$2)) \
103 $(rsort $(wildcard $(KBUILD_DEVTOOLS_HST)/sdk/*/[Bb][Ii][Nn]/$2)) \
104 $(rsort $(wildcard $(KBUILD_DEVTOOLS_HST_ALT)/sdk/*/[Bb][Ii][Nn]/$2)) \
105 $1))
106TOOL_VCC120_FN_FIND_SDK_TOOL = $(if-expr !defined($3),$(TOOL_VCC120_FN_FIND_SDK_TOOL_SUB),)$($3)
107
108## Disabled fast DEP_IDB based dependencies.
109#VCC120AMD64_OLD_DEPS = 1
110
111## Constructs the correct .pdb name (the name is lowercased).
112# @param $(1) Base name, no extention.
113# @param $(2) The extension.
114TOOL_VCC120AMD64_PDB = $(dir $(1))$(tolower $(notdir $(1))).$(2)
115
116
117# General Properties used by kBuild
118TOOL_VCC120AMD64_COBJSUFF ?= .obj
119TOOL_VCC120AMD64_CFLAGS ?= -TC -nologo -Zi
120TOOL_VCC120AMD64_CFLAGS.debug ?=
121TOOL_VCC120AMD64_CFLAGS.dbgopt ?= -O2
122TOOL_VCC120AMD64_CFLAGS.release ?= -O2
123TOOL_VCC120AMD64_CFLAGS.profile ?= -O2
124TOOL_VCC120AMD64_CINCS ?= $(PATH_TOOL_VCC120AMD64_INC)
125TOOL_VCC120AMD64_CDEFS ?=
126
127TOOL_VCC120AMD64_CXXOBJSUFF ?= .obj
128TOOL_VCC120AMD64_CXXFLAGS ?= -TP -nologo -Zi
129TOOL_VCC120AMD64_CXXFLAGS.debug ?=
130TOOL_VCC120AMD64_CXXFLAGS.dbgopt ?= -O2
131TOOL_VCC120AMD64_CXXFLAGS.release ?= -O2
132TOOL_VCC120AMD64_CXXFLAGS.profile ?= -O2
133TOOL_VCC120AMD64_CXXINCS ?= $(PATH_TOOL_VCC120AMD64_INC) $(PATH_TOOL_VCC120AMD64_ATLMFC_INC)
134TOOL_VCC120AMD64_CXXDEFS ?=
135
136TOOL_VCC120AMD64_ASOBJSUFF ?= .obj
137
138TOOL_VCC120AMD64_RCOBJSUFF ?= .res
139TOOL_VCC120AMD64_RCINCS ?= $(PATH_TOOL_VCC120AMD64_INC) $(PATH_TOOL_VCC120AMD64_ATLMFC_INC)
140
141TOOL_VCC120AMD64_ARFLAGS ?= -nologo -machine:amd64
142TOOL_VCC120AMD64_ARLIBSUFF ?= .lib
143
144TOOL_VCC120AMD64_LDFLAGS ?= -nologo -machine:amd64
145TOOL_VCC120AMD64_LDFLAGS.debug ?= -debug
146TOOL_VCC120AMD64_LDFLAGS.dbgopt ?= -debug
147TOOL_VCC120AMD64_LDFLAGS.profile ?= -debug
148TOOL_VCC120AMD64_LDFLAGS.release ?=
149
150
151
152## Compile C source.
153# @param $(target) Normalized main target name.
154# @param $(source) Source filename (relative).
155# @param $(obj) Object file name. This shall be (re)created by the compilation.
156# @param $(dep) Dependcy file. This shall be (re)created by the compilation.
157# @param $(flags) Flags.
158# @param $(defs) Definitions. No -D or something.
159# @param $(incs) Includes. No -I or something.
160# @param $(dirdep) Directory creation dependency.
161# @param $(deps) Other dependencies.
162#
163# @param $(outbase) Output basename (full). Use this for list files and such.
164# @param $(objsuff) Object suffix.
165TOOL_VCC120AMD64_COMPILE_C_DEPEND =
166TOOL_VCC120AMD64_COMPILE_C_DEPORD =
167TOOL_VCC120AMD64_COMPILE_C_OUTPUT =
168TOOL_VCC120AMD64_COMPILE_C_OUTPUT_MAYBE = $(call TOOL_VCC120AMD64_PDB, $(outbase)-obj,pdb) $(call TOOL_VCC120AMD64_PDB, $(outbase)-obj,idb)
169ifdef TOOL_VCC120AMD64_KSUBMIT
170 TOOL_VCC120AMD64_COMPILE_C_DONT_PURGE_OUTPUT := 1 # speed
171 define TOOL_VCC120AMD64_COMPILE_C_CMDS
172 $(QUIET)$(TOOL_VCC120AMD64_KSUBMIT) -P $(DEP_OBJ_INT) -f -s -q -o $(dep) -t $(obj) $(obj)\
173 -- $(TOOL_VCC120AMD64_CC) -c\
174 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
175 -Fd$(outbase)-obj.pdb \
176 -Fo$(obj)\
177 $(subst /,\\,$(abspath $(source)))
178 endef
179else
180 define TOOL_VCC120AMD64_COMPILE_C_CMDS
181 $(QUIET)$(if-expr defined(PATH_TOOL_VCC120AMD64_BIN_DLL)\
182 ,$(REDIRECT) --prepend 'PATH=$(PATH_TOOL_VCC120AMD64_BIN_DLL)$(HOST_PATH_SEP)' -- ,)$(TOOL_VCC120AMD64_CC) -c\
183 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
184 -Fd$(outbase)-obj.pdb \
185 -Fo$(obj)\
186 $(subst /,\\,$(abspath $(source)))
187 $(QUIET)$(DEP_OBJ) -f -s -q -o $(dep) -t $(obj) $(obj)
188 endef
189endif # !TOOL_VCC120AMD64_KSUBMIT
190
191
192## Compile C++ source.
193# @param $(target) Normalized main target name.
194# @param $(source) Source filename (relative).
195# @param $(obj) Object file name. This shall be (re)created by the compilation.
196# @param $(dep) Dependcy file. This shall be (re)created by the compilation.
197# @param $(flags) Flags.
198# @param $(defs) Definitions. No -D or something.
199# @param $(incs) Includes. No -I or something.
200# @param $(dirdep) Directory creation dependency.
201# @param $(deps) Other dependencies.
202#
203# @param $(outbase) Output basename (full). Use this for list files and such.
204# @param $(objsuff) Object suffix.
205TOOL_VCC120AMD64_COMPILE_CXX_DEPEND = $($(target)_1_VCC_PCH_FILE)
206TOOL_VCC120AMD64_COMPILE_CXX_DEPORD =
207TOOL_VCC120AMD64_COMPILE_CXX_OUTPUT =
208TOOL_VCC120AMD64_COMPILE_CXX_OUTPUT_MAYBE = $(if-expr defined($(target)_1_VCC_COMMON_OBJ_PDB)\
209 ,,$(call TOOL_VCC120AMD64_PDB, $(outbase)-obj,pdb) $(call TOOL_VCC120AMD64_PDB, $(outbase)-obj,idb))
210ifdef TOOL_VCC120AMD64_KSUBMIT
211 TOOL_VCC120AMD64_COMPILE_CXX_DONT_PURGE_OUTPUT := 1 # speed
212 define TOOL_VCC120AMD64_COMPILE_CXX_CMDS
213 $(QUIET)$(TOOL_VCC120AMD64_KSUBMIT) -P $(DEP_OBJ_INT) -f -s -q -o $(dep) -t $(obj) $(obj)\
214 -- $(TOOL_VCC120AMD64_CXX) -c\
215 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
216 $(if-expr defined($(target)_PCH_HDR)\
217 ,-FI$($(target)_PCH_HDR) -Yu$($(target)_PCH_HDR) -Fp$($(target)_1_VCC_PCH_FILE) -FS,)\
218 -Fd$(if-expr defined($(target)_1_VCC_COMMON_OBJ_PDB),$($(target)_1_VCC_COMMON_OBJ_PDB),$(outbase)-obj.pdb) \
219 -Fo$(obj)\
220 $(subst /,\\,$(abspath $(source)))
221 endef
222else
223 define TOOL_VCC120AMD64_COMPILE_CXX_CMDS
224 $(QUIET)$(if-expr defined(PATH_TOOL_VCC120AMD64_BIN_DLL)\
225 ,$(REDIRECT) --prepend 'PATH=$(PATH_TOOL_VCC120AMD64_BIN_DLL)$(HOST_PATH_SEP)' -- ,)$(TOOL_VCC120AMD64_CXX) -c\
226 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
227 $(if-expr defined($(target)_PCH_HDR)\
228 ,-FI$($(target)_PCH_HDR) -Yu$($(target)_PCH_HDR) -Fp$($(target)_1_VCC_PCH_FILE) -FS,)\
229 -Fd$(if-expr defined($(target)_1_VCC_COMMON_OBJ_PDB),$($(target)_1_VCC_COMMON_OBJ_PDB),$(outbase)-obj.pdb) \
230 -Fo$(obj)\
231 $(subst /,\\,$(abspath $(source)))
232 $(QUIET)$(DEP_OBJ) -f -s -q -o $(dep) -t $(obj) $(obj)
233 endef
234endif # !TOOL_VCC120AMD64_KSUBMIT
235
236
237#
238# Helper tool for creating the precompiled C++ header.
239#
240# It only have the C++ compile bits and it's purpose is to skip bits
241# related _1_VCC_PCH_FILE and add -Yc.
242#
243TOOL_VCC120AMD64-PCH := Helper for creating precompiled header using CXX handling.
244TOOL_VCC120AMD64-PCH_EXTENDS := VCC120AMD64
245TOOL_VCC120AMD64-PCH_CXXOBJSUFF := .obj
246TOOL_VCC120AMD64-PCH_CXXINCS = $(TOOL_VCC120AMD64_CXXINCS)
247TOOL_VCC120AMD64-PCH_CXXFLAGS = $(TOOL_VCC120AMD64_CXXFLAGS) -FS
248TOOL_VCC120AMD64-PCH_CXXFLAGS.debug = $(TOOL_VCC120AMD64_CXXFLAGS.debug)
249TOOL_VCC120AMD64-PCH_CXXFLAGS.dbgopt = $(TOOL_VCC120AMD64_CXXFLAGS.dbgopt)
250TOOL_VCC120AMD64-PCH_CXXFLAGS.release = $(TOOL_VCC120AMD64_CXXFLAGS.release)
251TOOL_VCC120AMD64-PCH_CXXFLAGS.profile = $(TOOL_VCC120AMD64_CXXFLAGS.profile)
252TOOL_VCC120AMD64-PCH_COMPILE_CXX_DEPEND = $(NO_SUCH_VARIABLE)
253TOOL_VCC120AMD64-PCH_COMPILE_CXX_DEPORD = $(NO_SUCH_VARIABLE)
254TOOL_VCC120AMD64-PCH_COMPILE_CXX_OUTPUT = $($(target)_1_VCC_PCH_FILE) $($(target)_1_VCC_COMMON_OBJ_PDB)
255TOOL_VCC120AMD64-PCH_COMPILE_CXX_OUTPUT_MAYBE = $(NO_SUCH_VARIABLE)
256ifdef TOOL_VCC120AMD64_KSUBMIT
257 define TOOL_VCC120AMD64-PCH_COMPILE_CXX_CMDS
258 $(QUIET)$(RM) -f -- $($(target)_1_VCC_PCH_FILE) $($(target)_1_VCC_COMMON_OBJ_PDB)
259 $(QUIET)$(TOOL_VCC120AMD64_KSUBMIT) --no-pch-caching -P $(DEP_OBJ_INT) -f -s -q -e .pch -o $(dep) -t $(obj) $(obj)\
260 -- $(TOOL_VCC120AMD64_CXX) -c -Yc\
261 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
262 -Fp$($(target)_1_VCC_PCH_FILE) \
263 -Fd$($(target)_1_VCC_COMMON_OBJ_PDB) \
264 -Fo$(obj)\
265 -TP \
266 $(subst /,\\,$(abspath $(source)))
267 endef
268else
269 define TOOL_VCC120AMD64-PCH_COMPILE_CXX_CMDS
270 $(QUIET)$(RM) -f -- $($(target)_1_VCC_PCH_FILE) $($(target)_1_VCC_COMMON_OBJ_PDB)
271 $(QUIET)$(if-expr defined(PATH_TOOL_VCC120AMD64_BIN_DLL)\
272 ,$(REDIRECT) --prepend 'PATH=$(PATH_TOOL_VCC120AMD64_BIN_DLL)$(HOST_PATH_SEP)' -- ,)$(TOOL_VCC120AMD64_CXX) -c -Yc\
273 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
274 -Fp$($(target)_1_VCC_PCH_FILE) \
275 -Fd$($(target)_1_VCC_COMMON_OBJ_PDB) \
276 -Fo$(obj)\
277 -TP \
278 $(subst /,\\,$(abspath $(source)))
279 $(QUIET)$(DEP_OBJ) -f -s -q -e .pch -o $(dep) -t $(obj) $(obj)
280
281 endef
282endif # !TOOL_VCC120AMD64_KSUBMIT
283
284
285## @todo configure the assembler template.
286
287## Compile resource source.
288# @param $(target) Normalized main target name.
289# @param $(source) Source filename (relative).
290# @param $(obj) Object file name. This shall be (re)created by the compilation.
291# @param $(dep) Dependcy file. This shall be (re)created by the compilation.
292# @param $(flags) Flags.
293# @param $(defs) Definitions. No -D or something.
294# @param $(incs) Includes. No -I or something.
295# @param $(dirdep) Directory creation dependency.
296# @param $(deps) Other dependencies.
297#
298# @param $(outbase) Output basename (full). Use this for list files and such.
299# @param $(objsuff) Object suffix.
300TOOL_VCC120AMD64_COMPILE_RC_DEPEND =
301TOOL_VCC120AMD64_COMPILE_RC_DEPORD =
302TOOL_VCC120AMD64_COMPILE_RC_OUTPUT =
303## @todo Fix kmk_redirect so we can use it for setting PATH without spawning a shell or two
304define TOOL_VCC120AMD64_COMPILE_RC_CMDS
305 $(QUIET)$(if-expr defined(PATH_TOOL_VCC120AMD64_BIN_DLL)\
306 ,$(REDIRECT) --prepend 'PATH=$(PATH_TOOL_VCC120AMD64_BIN_DLL)$(HOST_PATH_SEP)' -- ,)$(TOOL_VCC120AMD64_RC) \
307 $(flags) $(addprefix /i, $(subst /,\\,$(incs))) $(addprefix /d, $(defs))\
308 /fo$(obj)\
309 $(subst /,\\,$(abspath $(source)))
310endef
311
312
313## Link library
314# @param $(target) Normalized main target name.
315# @param $(out) Library name.
316# @param $(objs) Object files to put in the library.
317# @param $(flags) Flags.
318# @param $(dirdep) Directory creation dependency.
319# @param $(deps) Other dependencies.
320# @param $(othersrc) Unhandled sources.
321# @param $(outbase) Output basename (full). Use this for list files and such.
322#
323TOOL_VCC120AMD64_LINK_LIBRARY_DEPEND = $(othersrc)
324TOOL_VCC120AMD64_LINK_LIBRARY_DEPORD =
325TOOL_VCC120AMD64_LINK_LIBRARY_OUTPUT = $(outbase).rsp
326TOOL_VCC120AMD64_LINK_LIBRARY_OUTPUT_MAYBE = $(outbase).lst $(outbase).exp $(outbase).pdb
327define TOOL_VCC120AMD64_LINK_LIBRARY_CMDS
328 $(QUIET)$(APPEND) -tn $(outbase).rsp \
329 $(foreach arg,\
330 $(subst /,\\,$(objs) \
331 $(filter-out %.def,$(othersrc))) \
332 $(addprefix /DEF:,$(filter %.def,$(othersrc))) \
333 ,\"$(arg)\")
334 $(QUIET)$(TOOL_VCC120AMD64_KSUBMIT_DD) $(TOOL_VCC120AMD64_AR) $(flags) /OUT:$(out) @$(outbase).rsp
335endef
336
337
338## Link program
339# @param $(target) Normalized main target name.
340# @param $(out) Program name.
341# @param $(objs) Object files to link together.
342# @param $(libs) Libraries to search.
343# @param $(libpath) Library search paths.
344# @param $(flags) Flags.
345# @param $(dirdep) Directory creation dependency.
346# @param $(deps) Other dependencies.
347# @param $(othersrc) Unhandled sources.
348# @param $(custom_pre) Custom step invoked before linking.
349# @param $(custom_post) Custom step invoked after linking.
350# @param $(outbase) Output basename (full). Use this for list files and such.
351#
352TOOL_VCC120AMD64_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
353TOOL_VCC120AMD64_LINK_PROGRAM_DEPORD =
354TOOL_VCC120AMD64_LINK_PROGRAM_OUTPUT_MAYBE_PRECIOUS = $(outbase).map $(outbase).rsp
355TOOL_VCC120AMD64_LINK_PROGRAM_OUTPUT_MAYBE = $(outbase).lib $(outbase).exp $(outbase).ilk $(out).manifest
356TOOL_VCC120AMD64_LINK_PROGRAM_OUTPUT_DEBUG = $(outbase).pdb
357TOOL_VCC120AMD64_LINK_PROGRAM_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
358define TOOL_VCC120AMD64_LINK_PROGRAM_CMDS
359 $(QUIET)$(APPEND) -tn $(outbase).rsp \
360 $(foreach arg,\
361 $(subst /,\\,$(objs)) \
362 $(subst /,\\,$(libs)) \
363 ,\"$(arg)\")
364 $(QUIET)$(TOOL_VCC120AMD64_KSUBMIT_DD) $(TOOL_VCC120AMD64_LD) $(flags) \
365 /OUT:$(out) \
366 /MAPINFO:EXPORTS /INCREMENTAL:NO \
367 /MAP:$(outbase).map \
368 $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
369 $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
370 $(foreach p,$(libpath), /LIBPATH:$(p)) \
371 @$(outbase).rsp
372ifndef TOOL_VCC120AMD64_NO_AUTO_MANIFEST
373 $(QUIET)$(TEST) -f $(out).manifest -- \
374 $(TOOL_VCC120AMD64_MT) -manifest $(subst /,\\,$(out)).manifest -outputresource:$(subst /,\\,$(out))
375endif
376endef
377
378
379## Link DLL.
380# @param $(target) Normalized main target name.
381# @param $(out) DLL name.
382# @param $(objs) Object files to link together.
383# @param $(libs) Libraries to search.
384# @param $(libpath) Library search paths.
385# @param $(flags) Flags.
386# @param $(dirdep) Directory creation dependency.
387# @param $(deps) Other dependencies.
388# @param $(othersrc) Unhandled sources.
389# @param $(custom_pre) Custom step invoked before linking.
390# @param $(custom_post) Custom step invoked after linking.
391#
392# @param $(outbase) Output basename (full). Use this for list files and such.
393TOOL_VCC120AMD64_LINK_DLL_DEPEND = $(objs) $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
394TOOL_VCC120AMD64_LINK_DLL_DEPORD = $(call DIRDEP,$(PATH_STAGE_LIB))
395TOOL_VCC120AMD64_LINK_DLL_OUTPUT = $(outbase).lib $(outbase).exp
396TOOL_VCC120AMD64_LINK_DLL_OUTPUT_MAYBE = $(outbase).ilk $(out).manifest $(PATH_STAGE_LIB)/$(notdir $(outbase)).exp
397TOOL_VCC120AMD64_LINK_DLL_OUTPUT_MAYBE_PRECIOUS = $(PATH_STAGE_LIB)/$(notdir $(outbase)).lib $(outbase).map $(outbase).rsp
398TOOL_VCC120AMD64_LINK_DLL_OUTPUT_DEBUG = $(outbase).pdb
399TOOL_VCC120AMD64_LINK_DLL_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
400define TOOL_VCC120AMD64_LINK_DLL_CMDS
401 $(QUIET)$(APPEND) -tn $(outbase).rsp \
402 $(foreach arg,\
403 $(subst /,\\,$(objs)) \
404 $(subst /,\\,$(libs)) \
405 ,\"$(arg)\")
406 $(QUIET)$(TOOL_VCC120AMD64_KSUBMIT_DD) $(TOOL_VCC120AMD64_LD) $(flags) \
407 /OUT:$(out) \
408 /IMPLIB:$(outbase).lib \
409 /MAPINFO:EXPORTS /INCREMENTAL:NO \
410 /MAP:$(outbase).map \
411 /DLL \
412 $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
413 $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
414 $(foreach p,$(libpath), /LIBPATH:$(p)) \
415 @$(outbase).rsp
416ifndef TOOL_VCC120AMD64_NO_AUTO_MANIFEST
417 $(QUIET)$(TEST) -f $(out).manifest -- \
418 $(TOOL_VCC120AMD64_MT) -manifest $(subst /,\\,$(out)).manifest '-outputresource:$(subst /,\\,$(out));#2'
419endif
420 $(QUIET)$(TEST) -f $(outbase).lib -- $(KLIBTWEAKER_EXT) --clear-timestamps $(outbase).lib
421 $(QUIET)$(CP) --changed -v --ignore-non-existing $(outbase).exp $(outbase).lib $(PATH_STAGE_LIB)/
422$(eval _DIRS += $(PATH_STAGE_LIB))
423endef
424
425
426## Link system module (windows aka driver, linux aka kernel module)
427# @param $(target) Normalized main target name.
428# @param $(out) System module name.
429# @param $(objs) Object files to link together.
430# @param $(libs) Libraries to search.
431# @param $(libpath) Library search paths.
432# @param $(flags) Flags.
433# @param $(dirdep) Directory creation dependency.
434# @param $(deps) Other dependencies.
435# @param $(othersrc) Unhandled sources.
436# @param $(custom_pre) Custom step invoked before linking.
437# @param $(custom_post) Custom step invoked after linking.
438#
439# @param $(outbase) Output basename (full). Use this for list files and such.
440TOOL_VCC120AMD64_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
441TOOL_VCC120AMD64_LINK_SYSMOD_DEPORD =
442TOOL_VCC120AMD64_LINK_SYSMOD_OUTPUT_MAYBE = $(outbase).lib $(outbase).exp $(outbase).ilk $(out).manifest
443TOOL_VCC120AMD64_LINK_SYSMOD_OUTPUT_MAYBE_PRECIOUS = $(outbase).map $(outbase).rsp
444TOOL_VCC120AMD64_LINK_SYSMOD_OUTPUT_DEBUG = $(outbase).pdb
445TOOL_VCC120AMD64_LINK_SYSMOD_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
446define TOOL_VCC120AMD64_LINK_SYSMOD_CMDS
447 $(QUIET)$(APPEND) -tn $(outbase).rsp \
448 $(foreach arg,\
449 $(subst /,\\,$(objs)) \
450 $(subst /,\\,$(libs)) \
451 ,\"$(arg)\")
452 $(QUIET)$(TOOL_VCC120AMD64_KSUBMIT_DD) $(TOOL_VCC120AMD64_LD) $(flags) \
453 /OUT:$(out) \
454 /MAPINFO:EXPORTS /INCREMENTAL:NO \
455 /MAP:$(outbase).map \
456 $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
457 $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
458 $(foreach p,$(libpath), /LIBPATH:$(p)) \
459 @$(outbase).rsp
460ifndef TOOL_VCC120AMD64_NO_AUTO_MANIFEST
461 $(QUIET)$(TEST) -f $(out).manifest -- \
462 $(TOOL_VCC120AMD64_MT) -manifest $(subst /,\\,$(out)).manifest '-outputresource:$(subst /,\\,$(out));#2'
463endif
464endef
465
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