source: trunk/kBuild/tools/VCC120X86.kmk

Last change on this file was 3303, checked in by bird, 6 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: 20.4 KB
Line 
1# $Id: VCC120X86.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 x86.
4#
5
6#
7# Copyright (c) 2004-2017 knut st. osmundsen <bird-kBuild-spam-xviiv@anduin.net>
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_VCC120X86 := Visual C++ 12.0 (aka Visual 2013 and MSC v18), targeting x86.
35
36# Tool Specific Properties
37ifndef PATH_TOOL_VCC120X86
38 PATH_TOOL_VCC120X86 := $(wildcard $(KBUILD_DEVTOOLS)/win.x86/vcc/v12*)
39 ifeq ($(PATH_TOOL_VCC120X86),)
40 PATH_TOOL_VCC120X86 := $(PATH_TOOL_VCC120)
41 endif
42 ifeq ($(PATH_TOOL_VCC120X86),)
43 PATH_TOOL_VCC120X86 := $(PATH_TOOL_VCC120AMD64)
44 endif
45 ifeq ($(PATH_TOOL_VCC120X86),)
46 PATH_TOOL_VCC120X86 := $(wildcard $(KBUILD_DEVTOOLS)/x86.win32/vcc/v12*)
47 endif
48 ifeq ($(PATH_TOOL_VCC120X86),)
49 PATH_TOOL_VCC120X86 := $(wildcard $(KBUILD_DEVTOOLS)/win.amd64/vcc/v12*)
50 endif
51 ifneq ($(PATH_TOOL_VCC120X86),)
52 PATH_TOOL_VCC120X86 := $(lastword $(sort $(PATH_TOOL_VCC120X86)))
53 else
54 $(warning kBuild: PATH_TOOL_VCC120X86 cannot be determined!)
55 PATH_TOOL_VCC120X86 := $(KBUILD_DEVTOOLS)/x86.win/vcc/v12
56 endif
57else
58 # Resolve any fancy stuff once and for all.
59 PATH_TOOL_VCC120X86 := $(PATH_TOOL_VCC120X86)
60endif
61
62if "$(KBUILD_HOST).$(KBUILD_HOST_ARCH)" == "win.amd64" && exists("$(PATH_TOOL_VCC120AMD64)/bin/amd64_x86") # Missing in express edition.
63 PATH_TOOL_VCC120X86_BIN_DLL ?= $(PATH_TOOL_VCC120X86)/bin/amd64
64 PATH_TOOL_VCC120X86_BIN ?= $(PATH_TOOL_VCC120X86)/bin/amd64_x86
65else
66 PATH_TOOL_VCC120X86_BIN_DLL ?=
67 PATH_TOOL_VCC120X86_BIN ?= $(PATH_TOOL_VCC120X86)/bin
68endif
69PATH_TOOL_VCC120X86_BIN ?= $(PATH_TOOL_VCC120X86)/bin
70PATH_TOOL_VCC120X86_LIB ?= $(PATH_TOOL_VCC120X86)/lib
71PATH_TOOL_VCC120X86_INC ?= $(PATH_TOOL_VCC120X86)/include
72PATH_TOOL_VCC120X86_ATLMFC ?= $(PATH_TOOL_VCC120X86)/atlmfc
73PATH_TOOL_VCC120X86_ATLMFC_INC ?= $(PATH_TOOL_VCC120X86_ATLMFC)/include
74PATH_TOOL_VCC120X86_ATLMFC_LIB ?= $(PATH_TOOL_VCC120X86_ATLMFC)/lib
75TOOL_VCC120X86_CC ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC120X86_BIN)/cl.exe
76TOOL_VCC120X86_CXX ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC120X86_BIN)/cl.exe
77TOOL_VCC120X86_AS ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC120X86_BIN)/ml.exe
78#TOOL_VCC120X86_AR ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC120X86_BIN)/lib.exe - just an exec wrapper for the below
79TOOL_VCC120X86_AR ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC120X86_BIN)/link.exe /LIB
80TOOL_VCC120X86_LD ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC120X86_BIN)/link.exe
81TOOL_VCC120X86_DUMPBIN ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC120X86_BIN)/dumpbin.exe
82TOOL_VCC120X86_EDITBIN ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC120X86_BIN)/editbin.exe
83TOOL_VCC120X86_RC ?= $(EXEC_X86_WIN32) $(call TOOL_VCC120_FN_FIND_SDK_TOOL,rc.exe,[Rr][Cc].[Ee][Xx][Ee],TOOL_VCC120_RC_CACHED)
84TOOL_VCC120X86_MT ?= $(EXEC_X86_WIN32) $(call TOOL_VCC120_FN_FIND_SDK_TOOL,mt.exe,[Mm][Tt].[Ee][Xx][Ee],TOOL_VCC120_MT_CACHED)
85ifdef TOOL_VCC120X86_USE_KSUBMIT
86 ifeq ($(KBUILD_HOST),win)
87 if "$(substr $(PATH_TOOL_VCC120X86_BIN),-10)" == "/amd64_x86"
88 TOOL_VCC120X86_KSUBMIT ?= kmk_builtin_kSubmit --64-bit
89 else
90 TOOL_VCC120X86_KSUBMIT ?= kmk_builtin_kSubmit --32-bit
91 endif
92 ifdef PATH_TOOL_VCC120X86_BIN_DLL
93 TOOL_VCC120X86_KSUBMIT += --prepend 'PATH=$(PATH_TOOL_VCC120X86_BIN_DLL)$(HOST_PATH_SEP)'
94 endif
95 TOOL_VCC120X86_KSUBMIT_DD = $(TOOL_VCC120X86_KSUBMIT) --
96 endif
97else ifdef PATH_TOOL_VCC120X86_BIN_DLL
98 TOOL_VCC120X86_KSUBMIT_DD = $(REDIRECT) --prepend 'PATH=$(PATH_TOOL_VCC120X86_BIN_DLL)$(HOST_PATH_SEP)' --
99endif
100
101# The following in duplicated in VCC120.kmk and VCC120X86.kmk.
102TOOL_VCC120_FN_FIND_SDK_TOOL_SUB = $(eval $3 := $(firstword \
103 $(if-expr defined(PATH_SDK_WINPSDK71_BIN), $(wildcard $(PATH_SDK_WINPSDK71_BIN)/$2)) \
104 $(if-expr defined(PATH_SDK_WINPSDK_BIN) , $(wildcard $(PATH_SDK_WINPSDK_BIN)/$2)) \
105 $(rsort $(wildcard $(KBUILD_DEVTOOLS_HST)/sdk/*/[Bb][Ii][Nn]/$2)) \
106 $(rsort $(wildcard $(KBUILD_DEVTOOLS_HST_ALT)/sdk/*/[Bb][Ii][Nn]/$2)) \
107 $1))
108TOOL_VCC120_FN_FIND_SDK_TOOL = $(if-expr !defined($3),$(TOOL_VCC120_FN_FIND_SDK_TOOL_SUB),)$($3)
109
110## Disabled fast DEP_IDB based dependencies.
111#VCC120X86_OLD_DEPS = 1
112
113## Constructs the correct .pdb name (the name is lowercased).
114# @param $(1) Base name, no extention.
115# @param $(2) The extension.
116TOOL_VCC120X86_PDB = $(dir $(1))$(tolower $(notdir $(1))).$(2)
117
118
119# General Properties used by kBuild
120TOOL_VCC120X86_COBJSUFF ?= .obj
121TOOL_VCC120X86_CFLAGS ?= -TC -nologo -Zi
122TOOL_VCC120X86_CFLAGS.debug ?=
123TOOL_VCC120X86_CFLAGS.dbgopt ?= -O2
124TOOL_VCC120X86_CFLAGS.release ?= -O2
125TOOL_VCC120X86_CFLAGS.profile ?= -O2
126TOOL_VCC120X86_CINCS ?= $(PATH_TOOL_VCC120X86_INC)
127TOOL_VCC120X86_CDEFS ?=
128
129TOOL_VCC120X86_CXXOBJSUFF ?= .obj
130TOOL_VCC120X86_CXXFLAGS ?= -TP -nologo -Zi
131TOOL_VCC120X86_CXXFLAGS.debug ?=
132TOOL_VCC120X86_CXXFLAGS.dbgopt ?= -O2
133TOOL_VCC120X86_CXXFLAGS.release ?= -O2
134TOOL_VCC120X86_CXXFLAGS.profile ?= -O2
135TOOL_VCC120X86_CXXINCS ?= $(PATH_TOOL_VCC120X86_INC) $(PATH_TOOL_VCC120X86_ATLMFC_INC)
136TOOL_VCC120X86_CXXDEFS ?=
137
138TOOL_VCC120X86_ASOBJSUFF ?= .obj
139
140TOOL_VCC120X86_RCOBJSUFF ?= .res
141TOOL_VCC120X86_RCINCS ?= $(PATH_TOOL_VCC120X86_INC) $(PATH_TOOL_VCC120X86_ATLMFC_INC)
142
143TOOL_VCC120X86_ARFLAGS ?= -nologo -machine:x86
144TOOL_VCC120X86_ARLIBSUFF ?= .lib
145
146TOOL_VCC120X86_LDFLAGS ?= -nologo -machine:x86
147TOOL_VCC120X86_LDFLAGS.debug ?= -debug
148TOOL_VCC120X86_LDFLAGS.dbgopt ?= -debug
149TOOL_VCC120X86_LDFLAGS.profile ?= -debug
150TOOL_VCC120X86_LDFLAGS.release ?=
151
152
153
154## Compile C source.
155# @param $(target) Normalized main target name.
156# @param $(source) Source filename (relative).
157# @param $(obj) Object file name. This shall be (re)created by the compilation.
158# @param $(dep) Dependcy file. This shall be (re)created by the compilation.
159# @param $(flags) Flags.
160# @param $(defs) Definitions. No -D or something.
161# @param $(incs) Includes. No -I or something.
162# @param $(dirdep) Directory creation dependency.
163# @param $(deps) Other dependencies.
164#
165# @param $(outbase) Output basename (full). Use this for list files and such.
166# @param $(objsuff) Object suffix.
167TOOL_VCC120X86_COMPILE_C_DEPEND =
168TOOL_VCC120X86_COMPILE_C_DEPORD =
169TOOL_VCC120X86_COMPILE_C_OUTPUT =
170TOOL_VCC120X86_COMPILE_C_OUTPUT_MAYBE = $(call TOOL_VCC120X86_PDB, $(outbase)-obj,pdb) $(call TOOL_VCC120X86_PDB, $(outbase)-obj,idb)
171ifdef TOOL_VCC120X86_KSUBMIT
172 TOOL_VCC120X86_COMPILE_C_DONT_PURGE_OUTPUT = 1 # speed
173 define TOOL_VCC120X86_COMPILE_C_CMDS
174 $(QUIET)$(TOOL_VCC120X86_KSUBMIT) -P $(DEP_OBJ_INT) -f -s -q -o $(dep) -t $(obj) $(obj)\
175 -- $(TOOL_VCC120X86_CC) -c\
176 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
177 -Fd$(outbase)-obj.pdb \
178 -Fo$(obj)\
179 $(subst /,\\,$(abspath $(source)))
180 endef
181else
182 define TOOL_VCC120X86_COMPILE_C_CMDS
183 $(QUIET)$(if-expr defined(PATH_TOOL_VCC120X86_BIN_DLL)\
184 ,$(REDIRECT) --prepend 'PATH=$(PATH_TOOL_VCC120X86_BIN_DLL)$(HOST_PATH_SEP)' -- ,)$(TOOL_VCC120X86_CC) -c\
185 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
186 -Fd$(outbase)-obj.pdb \
187 -Fo$(obj)\
188 $(subst /,\\,$(abspath $(source)))
189 $(QUIET)$(DEP_OBJ) -f -s -q -o $(dep) -t $(obj) $(obj)
190 endef
191endif # !TOOL_VCC120X86_KSUBMIT
192
193
194## Compile C++ source.
195# @param $(target) Normalized main target name.
196# @param $(source) Source filename (relative).
197# @param $(obj) Object file name. This shall be (re)created by the compilation.
198# @param $(dep) Dependcy file. This shall be (re)created by the compilation.
199# @param $(flags) Flags.
200# @param $(defs) Definitions. No -D or something.
201# @param $(incs) Includes. No -I or something.
202# @param $(dirdep) Directory creation dependency.
203# @param $(deps) Other dependencies.
204#
205# @param $(outbase) Output basename (full). Use this for list files and such.
206# @param $(objsuff) Object suffix.
207TOOL_VCC120X86_COMPILE_CXX_DEPEND = $($(target)_1_VCC_PCH_FILE)
208TOOL_VCC120X86_COMPILE_CXX_DEPORD =
209TOOL_VCC120X86_COMPILE_CXX_OUTPUT =
210TOOL_VCC120X86_COMPILE_CXX_OUTPUT_MAYBE = $(if-expr defined($(target)_1_VCC_COMMON_OBJ_PDB)\
211 ,,$(call TOOL_VCC120X86_PDB, $(outbase)-obj,pdb) $(call TOOL_VCC120X86_PDB, $(outbase)-obj,idb))
212ifdef TOOL_VCC120X86_KSUBMIT
213 TOOL_VCC120X86_COMPILE_CXX_DONT_PURGE_OUTPUT = 1 # speed
214 define TOOL_VCC120X86_COMPILE_CXX_CMDS
215 $(QUIET)$(TOOL_VCC120X86_KSUBMIT) -P $(DEP_OBJ_INT) -f -s -q -o $(dep) -t $(obj) $(obj)\
216 -- $(TOOL_VCC120X86_CXX) -c\
217 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
218 $(if-expr defined($(target)_PCH_HDR)\
219 ,-FI$($(target)_PCH_HDR) -Yu$($(target)_PCH_HDR) -Fp$($(target)_1_VCC_PCH_FILE) -FS,)\
220 -Fd$(if-expr defined($(target)_1_VCC_COMMON_OBJ_PDB),$($(target)_1_VCC_COMMON_OBJ_PDB),$(outbase)-obj.pdb) \
221 -Fo$(obj)\
222 $(subst /,\\,$(abspath $(source)))
223 endef
224else
225 define TOOL_VCC120X86_COMPILE_CXX_CMDS
226 $(QUIET)$(if-expr defined(PATH_TOOL_VCC120X86_BIN_DLL)\
227 ,$(REDIRECT) --prepend 'PATH=$(PATH_TOOL_VCC120X86_BIN_DLL)$(HOST_PATH_SEP)' -- ,)$(TOOL_VCC120X86_CXX) -c\
228 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
229 $(if-expr defined($(target)_PCH_HDR)\
230 ,-FI$($(target)_PCH_HDR) -Yu$($(target)_PCH_HDR) -Fp$($(target)_1_VCC_PCH_FILE) -FS,)\
231 -Fd$(if-expr defined($(target)_1_VCC_COMMON_OBJ_PDB),$($(target)_1_VCC_COMMON_OBJ_PDB),$(outbase)-obj.pdb) \
232 -Fo$(obj)\
233 $(subst /,\\,$(abspath $(source)))
234 $(QUIET)$(DEP_OBJ) -f -s -q -o $(dep) -t $(obj) $(obj)
235 endef
236endif # !TOOL_VCC120X86_KSUBMIT
237
238
239#
240# Helper tool for creating the precompiled C++ header.
241#
242# It only have the C++ compile bits and it's purpose is to skip bits
243# related _1_VCC_PCH_FILE and add -Yc.
244#
245TOOL_VCC120X86-PCH := Helper for creating precompiled header using CXX handling.
246TOOL_VCC120X86-PCH_EXTENDS := VCC120X86
247TOOL_VCC120X86-PCH_CXXOBJSUFF := .obj
248TOOL_VCC120X86-PCH_CXXINCS = $(TOOL_VCC120X86_CXXINCS)
249TOOL_VCC120X86-PCH_CXXFLAGS = $(TOOL_VCC120X86_CXXFLAGS) -FS
250TOOL_VCC120X86-PCH_CXXFLAGS.debug = $(TOOL_VCC120X86_CXXFLAGS.debug)
251TOOL_VCC120X86-PCH_CXXFLAGS.dbgopt = $(TOOL_VCC120X86_CXXFLAGS.dbgopt)
252TOOL_VCC120X86-PCH_CXXFLAGS.release = $(TOOL_VCC120X86_CXXFLAGS.release)
253TOOL_VCC120X86-PCH_CXXFLAGS.profile = $(TOOL_VCC120X86_CXXFLAGS.profile)
254TOOL_VCC120X86-PCH_COMPILE_CXX_DEPEND = $(NO_SUCH_VARIABLE)
255TOOL_VCC120X86-PCH_COMPILE_CXX_DEPORD = $(NO_SUCH_VARIABLE)
256TOOL_VCC120X86-PCH_COMPILE_CXX_OUTPUT = $($(target)_1_VCC_PCH_FILE) $($(target)_1_VCC_COMMON_OBJ_PDB)
257TOOL_VCC120X86-PCH_COMPILE_CXX_OUTPUT_MAYBE = $(NO_SUCH_VARIABLE)
258ifdef TOOL_VCC120X86_KSUBMIT
259 define TOOL_VCC120X86-PCH_COMPILE_CXX_CMDS
260 $(QUIET)$(TOOL_VCC120X86_KSUBMIT) --no-pch-caching -P $(DEP_OBJ_INT) -f -s -q -e .pch -o $(dep) -t $(obj) $(obj)\
261 -- $(TOOL_VCC120X86_CXX) -c -Yc\
262 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
263 -Fp$($(target)_1_VCC_PCH_FILE) \
264 -Fd$($(target)_1_VCC_COMMON_OBJ_PDB) \
265 -Fo$(obj)\
266 -TP \
267 $(subst /,\\,$(abspath $(source)))
268 endef
269else
270 define TOOL_VCC120X86-PCH_COMPILE_CXX_CMDS
271 $(QUIET)$(if-expr defined(PATH_TOOL_VCC120X86_BIN_DLL)\
272 ,$(REDIRECT) --prepend 'PATH=$(PATH_TOOL_VCC120X86_BIN_DLL)$(HOST_PATH_SEP)' -- ,)$(TOOL_VCC120X86_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_VCC120X86_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_VCC120X86_COMPILE_RC_DEPEND =
301TOOL_VCC120X86_COMPILE_RC_DEPORD =
302TOOL_VCC120X86_COMPILE_RC_OUTPUT =
303## @todo Fix kmk_redirect so we can use it for setting PATH without spawning a shell or two
304define TOOL_VCC120X86_COMPILE_RC_CMDS
305 $(QUIET)$(if-expr defined(PATH_TOOL_VCC120X86_BIN_DLL)\
306 ,$(REDIRECT) --prepend 'PATH=$(PATH_TOOL_VCC120X86_BIN_DLL)$(HOST_PATH_SEP)' -- ,) $(TOOL_VCC120X86_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_VCC120X86_LINK_LIBRARY_DEPEND = $(othersrc)
324TOOL_VCC120X86_LINK_LIBRARY_DEPORD =
325TOOL_VCC120X86_LINK_LIBRARY_OUTPUT = $(outbase).rsp
326TOOL_VCC120X86_LINK_LIBRARY_OUTPUT_MAYBE = $(outbase).lst $(outbase).exp $(outbase).pdb
327define TOOL_VCC120X86_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_VCC120X86_KSUBMIT_DD) $(TOOL_VCC120X86_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_VCC120X86_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
353TOOL_VCC120X86_LINK_PROGRAM_DEPORD =
354TOOL_VCC120X86_LINK_PROGRAM_OUTPUT_MAYBE_PRECIOUS = $(outbase).map $(outbase).rsp
355TOOL_VCC120X86_LINK_PROGRAM_OUTPUT_MAYBE = $(outbase).lib $(outbase).exp $(outbase).ilk $(out).manifest
356TOOL_VCC120X86_LINK_PROGRAM_OUTPUT_DEBUG = $(outbase).pdb
357TOOL_VCC120X86_LINK_PROGRAM_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
358define TOOL_VCC120X86_LINK_PROGRAM_CMDS
359 $(QUIET)$(APPEND) -tn $(outbase).rsp \
360 $(foreach arg,\
361 $(subst /,\\,$(objs)) \
362 $(subst /,\\,$(libs)) \
363 ,\"$(arg)\")
364 $(QUIET)$(TOOL_VCC120X86_KSUBMIT_DD) $(TOOL_VCC120X86_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_VCC120X86_NO_AUTO_MANIFEST
373 $(QUIET)$(TEST) -f $(out).manifest -- \
374 $(TOOL_VCC120X86_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_VCC120X86_LINK_DLL_DEPEND = $(objs) $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
394TOOL_VCC120X86_LINK_DLL_DEPORD = $(call DIRDEP,$(PATH_STAGE_LIB))
395TOOL_VCC120X86_LINK_DLL_OUTPUT = $(outbase).lib $(outbase).exp
396TOOL_VCC120X86_LINK_DLL_OUTPUT_MAYBE = $(outbase).ilk $(out).manifest $(PATH_STAGE_LIB)/$(notdir $(outbase)).exp
397TOOL_VCC120X86_LINK_DLL_OUTPUT_MAYBE_PRECIOUS = $(PATH_STAGE_LIB)/$(notdir $(outbase)).lib $(outbase).map $(outbase).rsp
398TOOL_VCC120X86_LINK_DLL_OUTPUT_DEBUG = $(outbase).pdb
399TOOL_VCC120X86_LINK_DLL_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
400define TOOL_VCC120X86_LINK_DLL_CMDS
401 $(QUIET)$(APPEND) -tn $(outbase).rsp \
402 $(foreach arg,\
403 $(subst /,\\,$(objs)) \
404 $(subst /,\\,$(libs)) \
405 ,\"$(arg)\")
406 $(QUIET)$(TOOL_VCC120X86_KSUBMIT_DD) $(TOOL_VCC120X86_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_VCC120X86_NO_AUTO_MANIFEST
417 $(QUIET)$(TEST) -f $(out).manifest -- \
418 $(TOOL_VCC120X86_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 --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_VCC120X86_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
441TOOL_VCC120X86_LINK_SYSMOD_DEPORD =
442TOOL_VCC120X86_LINK_SYSMOD_OUTPUT_MAYBE = $(outbase).lib $(outbase).exp $(outbase).ilk $(out).manifest
443TOOL_VCC120X86_LINK_SYSMOD_OUTPUT_MAYBE_PRECIOUS = $(outbase).map $(outbase).rsp
444TOOL_VCC120X86_LINK_SYSMOD_OUTPUT_DEBUG = $(outbase).pdb
445TOOL_VCC120X86_LINK_SYSMOD_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
446define TOOL_VCC120X86_LINK_SYSMOD_CMDS
447 $(QUIET)$(APPEND) -tn $(outbase).rsp \
448 $(foreach arg,\
449 $(subst /,\\,$(objs)) \
450 $(subst /,\\,$(libs)) \
451 ,\"$(arg)\")
452 $(QUIET)$(TOOL_VCC120X86_KSUBMIT_DD) $(TOOL_VCC120X86_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_VCC120X86_NO_AUTO_MANIFEST
461 $(QUIET)$(TEST) -f $(out).manifest -- \
462 $(TOOL_VCC120X86_MT) -manifest $(subst /,\\,$(out)).manifest '-outputresource:$(subst /,\\,$(out));#2'
463endif
464endef
465
Note: See TracBrowser for help on using the repository browser.