source: trunk/kBuild/tools/VCC141AMD64.kmk@ 3340

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

tools/VCC141*: Redid the _DLLS variables as it turns out there might be differences between archs.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 20.4 KB
Line 
1# $Id: VCC141AMD64.kmk 3340 2020-05-19 12:46:14Z bird $
2## @file
3# kBuild Tool Config - Visual C++ 14.1 (aka Visual 2017 and MSC v19.10), targeting AMD64.
4#
5
6#
7# Copyright (c) 2004-2020 knut st. osmundsen <bird-kBuild-spam-xx@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
34ifndef TOOL_VCC141
35 include $(KBUILD_PATH)/tools/VCC141.kmk
36endif
37
38TOOL_VCC141AMD64 := Visual C++ 14.1 (aka Visual 2017 and MSC v19.1), targeting AMD64
39
40#
41# Tool Specific Properties
42#
43ifndef PATH_TOOL_VCC141AMD64
44 PATH_TOOL_VCC141AMD64 := $(PATH_TOOL_VCC141)
45else
46 # Resolve any fancy stuff once and for all.
47 PATH_TOOL_VCC141AMD64 := $(PATH_TOOL_VCC141AMD64)
48endif
49
50ifndef PATH_TOOL_VCC141AMD64_BIN
51PATH_TOOL_VCC141AMD64_BIN := $(PATH_TOOL_VCC141_HOST_BIN)/x64
52else
53PATH_TOOL_VCC141AMD64_BIN := $(PATH_TOOL_VCC141_BIN)
54endif
55PATH_TOOL_VCC141AMD64_BIN_QSH := $(requote sh,$(PATH_TOOL_VCC141AMD64_BIN))
56
57# A bunch of DLLs are only in the subdir matching the host one, so we need to add it to the PATH when cross compiling.
58ifndef PATH_TOOL_VCC141AMD64_DLL_BIN
59 ifneq ($(PATH_TOOL_VCC141_HOST_DLL_BIN),$(PATH_TOOL_VCC141AMD64_BIN))
60PATH_TOOL_VCC141AMD64_DLL_BIN := $(PATH_TOOL_VCC141_HOST_DLL_BIN)
61 endif
62endif
63
64ifndef PATH_TOOL_VCC141AMD64_LIB
65PATH_TOOL_VCC141AMD64_LIB := $(PATH_TOOL_VCC141_LIB.amd64)
66endif
67ifndef PATH_TOOL_VCC141_ONECORE_LIB
68PATH_TOOL_VCC141_ONECORE_LIB := $(PATH_TOOL_VCC141_ONECORE_LIB.amd64)
69endif
70
71ifndef PATH_TOOL_VCC141AMD64_INC
72PATH_TOOL_VCC141AMD64_INC := $(PATH_TOOL_VCC141_INC)
73endif
74
75ifndef PATH_TOOL_VCC141AMD64_ATLMFC_INC
76PATH_TOOL_VCC141AMD64_ATLMFC_INC := $(PATH_TOOL_VCC141_ATLMFC_INC.amd64)
77endif
78ifndef PATH_TOOL_VCC141AMD64_ATLMFC_LIB
79PATH_TOOL_VCC141AMD64_ATLMFC_LIB := $(PATH_TOOL_VCC141_ATLMFC_LIB.amd64)
80endif
81
82TOOL_VCC141AMD64_CC ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC141AMD64_BIN_QSH)/cl.exe
83TOOL_VCC141AMD64_CXX ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC141AMD64_BIN_QSH)/cl.exe
84TOOL_VCC141AMD64_AS ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC141AMD64_BIN_QSH)/ml64.exe
85#TOOL_VCC141AMD64_AR ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC141AMD64_BIN_QSH)/lib.exe - just an exec wrapper for the below
86TOOL_VCC141AMD64_AR ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC141AMD64_BIN_QSH)/link.exe /LIB
87TOOL_VCC141AMD64_LD ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC141AMD64_BIN_QSH)/link.exe
88TOOL_VCC141AMD64_DUMPBIN ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC141AMD64_BIN_QSH)/dumpbin.exe
89TOOL_VCC141AMD64_EDITBIN ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC141AMD64_BIN_QSH)/editbin.exe
90
91TOOL_VCC141AMD64_RC ?= $(EXEC_X86_WIN32) $(call TOOL_VCC141_FN_FIND_SDK_TOOL,rc.exe,[Rr][Cc].[Ee][Xx][Ee],TOOL_VCC141_RC_CACHED)
92TOOL_VCC141AMD64_MT ?= $(EXEC_X86_WIN32) $(call TOOL_VCC141_FN_FIND_SDK_TOOL,mt.exe,[Mm][Tt].[Ee][Xx][Ee],TOOL_VCC141_MT_CACHED)
93
94undefine TOOL_VCC141AMD64_USE_KSUBMIT # for now
95ifdef TOOL_VCC141AMD64_USE_KSUBMIT
96 ifeq ($(KBUILD_HOST),win)
97 ifneq ($(substr $(qdir un,$(PATH_TOOL_VCC141AMD64_BIN)),-3),64/)
98 TOOL_VCC141AMD64_KSUBMIT ?= kmk_builtin_kSubmit --64-bit
99 else
100 TOOL_VCC141AMD64_KSUBMIT ?= kmk_builtin_kSubmit --32-bit
101 endif
102 ifdef PATH_TOOL_VCC141AMD64_DLL_BIN
103 TOOL_VCC141AMD64_KSUBMIT := $(TOOL_VCC141AMD64_KSUBMIT) --prepend "PATH=$(requote shell-in-dq,$(PATH_TOOL_VCC141AMD64_DLL_BIN));"
104 endif
105 TOOL_VCC141AMD64_KSUBMIT_DD := $(TOOL_VCC141AMD64_KSUBMIT) --
106 endif
107endif
108ifdef PATH_TOOL_VCC141AMD64_DLL_BIN
109 TOOL_VCC141AMD64_SETUP_ENV := $(REDIRECT) --prepend "PATH=$(requote shell-in-dq,$(PATH_TOOL_VCC141AMD64_DLL_BIN));" --$(SP)
110 ifndef TOOL_VCC141AMD64_KSUBMIT_DD
111 TOOL_VCC141AMD64_KSUBMIT_DD := $(TOOL_VCC141AMD64_SETUP_ENV)
112 endif
113endif
114
115# Redist (more stuff in VCC141.kmk).
116PATH_TOOL_VCC141AMD64_REDIST ?= $(PATH_TOOL_VCC141_REDIST)/x64
117PATH_TOOL_VCC141AMD64_REDIST_CRT = $(PATH_TOOL_VCC141AMD64_REDIST)/$(TOOL_VCC141_REDIST_CRT_SUBDIR)
118PATH_TOOL_VCC141AMD64_REDIST_DEBUG ?= $(PATH_TOOL_VCC141_REDIST_DEBUG)/x64
119PATH_TOOL_VCC141AMD64_REDIST_DEBUG_CRT = $(PATH_TOOL_VCC141AMD64_REDIST_DEBUG)/$(TOOL_VCC141_REDIST_CRT_SUBDIR)
120TOOL_VCC141AMD64_REDIST_CRT_DLLS = $(TOOL_VCC141_REDIST_CRT_DLLS.amd64)
121TOOL_VCC141AMD64_REDIST_CONCRT_DLLS = $(TOOL_VCC141_REDIST_CONCRT_DLLS.amd64)
122TOOL_VCC141AMD64_REDIST_CPP_DLLS = $(TOOL_VCC141_REDIST_CPP_DLLS.amd64)
123TOOL_VCC141AMD64_REDIST_WINRT_DLLS = $(TOOL_VCC141_REDIST_WINRT_DLLS.amd64)
124
125
126#
127# Properties used by kBuild
128#
129TOOL_VCC141AMD64_COBJSUFF ?= .obj
130TOOL_VCC141AMD64_CFLAGS ?= -TC -nologo -Zi -ZH:SHA_256
131TOOL_VCC141AMD64_CFLAGS.debug ?=
132TOOL_VCC141AMD64_CFLAGS.dbgopt ?= -O2
133TOOL_VCC141AMD64_CFLAGS.release ?= -O2
134TOOL_VCC141AMD64_CFLAGS.profile ?= -O2
135TOOL_VCC141AMD64_CINCS ?= $(PATH_TOOL_VCC141AMD64_INC)
136TOOL_VCC141AMD64_CDEFS ?=
137
138TOOL_VCC141AMD64_CXXOBJSUFF ?= .obj
139TOOL_VCC141AMD64_CXXFLAGS ?= -TP -nologo -Zi -ZH:SHA_256
140TOOL_VCC141AMD64_CXXFLAGS.debug ?=
141TOOL_VCC141AMD64_CXXFLAGS.dbgopt ?= -O2
142TOOL_VCC141AMD64_CXXFLAGS.release ?= -O2
143TOOL_VCC141AMD64_CXXFLAGS.profile ?= -O2
144TOOL_VCC141AMD64_CXXINCS ?= $(PATH_TOOL_VCC141AMD64_INC) $(PATH_TOOL_VCC141AMD64_ATLMFC_INC)
145TOOL_VCC141AMD64_CXXDEFS ?=
146
147TOOL_VCC141AMD64_ASOBJSUFF ?= .obj
148
149TOOL_VCC141AMD64_RCOBJSUFF ?= .res
150TOOL_VCC141AMD64_RCINCS ?= $(PATH_TOOL_VCC141AMD64_INC) $(PATH_TOOL_VCC141AMD64_ATLMFC_INC)
151
152TOOL_VCC141AMD64_ARFLAGS ?= -nologo -machine:amd64
153TOOL_VCC141AMD64_ARLIBSUFF ?= .lib
154
155TOOL_VCC141AMD64_LDFLAGS ?= -nologo -machine:amd64
156TOOL_VCC141AMD64_LDFLAGS.debug ?= -debug
157TOOL_VCC141AMD64_LDFLAGS.dbgopt ?= -debug
158TOOL_VCC141AMD64_LDFLAGS.profile ?= -debug
159TOOL_VCC141AMD64_LDFLAGS.release ?=
160
161
162
163## Compile C source.
164# @param $(target) Normalized main target name.
165# @param $(source) Source filename (relative).
166# @param $(obj) Object file name. This shall be (re)created by the compilation.
167# @param $(dep) Dependcy file. This shall be (re)created by the compilation.
168# @param $(flags) Flags.
169# @param $(defs) Definitions. No -D or something.
170# @param $(incs) Includes. No -I or something.
171# @param $(dirdep) Directory creation dependency.
172# @param $(deps) Other dependencies.
173#
174# @param $(outbase) Output basename (full). Use this for list files and such.
175# @param $(objsuff) Object suffix.
176TOOL_VCC141AMD64_COMPILE_C_DEPEND =
177TOOL_VCC141AMD64_COMPILE_C_DEPORD =
178TOOL_VCC141AMD64_COMPILE_C_OUTPUT =
179TOOL_VCC141AMD64_COMPILE_C_OUTPUT_MAYBE = $(call TOOL_VCC141_PDB, $(outbase)-obj,pdb) $(call TOOL_VCC141_PDB, $(outbase)-obj,idb)
180ifdef TOOL_VCC141AMD64_KSUBMIT
181 TOOL_VCC141AMD64_COMPILE_C_DONT_PURGE_OUTPUT := 1 # speed
182 define TOOL_VCC141AMD64_COMPILE_C_CMDS
183 $(QUIET)$(TOOL_VCC141AMD64_KSUBMIT) -P $(DEP_OBJ_INT) -f -s -q -o $(dep) -t $(obj) $(obj)\
184 -- $(TOOL_VCC141AMD64_CC) -c\
185 $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
186 -Fd$(outbase)-obj.pdb \
187 -Fo$(obj)\
188 $(subst /,\\,$(abspath $(source)))
189 endef
190else
191 define TOOL_VCC141AMD64_COMPILE_C_CMDS
192 $(QUIET)$(TOOL_VCC141AMD64_SETUP_ENV)$(TOOL_VCC141AMD64_CC) -c\
193 $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
194 -Fd$(outbase)-obj.pdb \
195 -Fo$(obj)\
196 $(subst /,\\,$(abspath $(source)))
197 $(QUIET)$(DEP_OBJ) -f -s -q -o $(dep) -t $(obj) $(obj)
198 endef
199endif # !TOOL_VCC141AMD64_KSUBMIT
200
201
202## Compile C++ source.
203# @param $(target) Normalized main target name.
204# @param $(source) Source filename (relative).
205# @param $(obj) Object file name. This shall be (re)created by the compilation.
206# @param $(dep) Dependcy file. This shall be (re)created by the compilation.
207# @param $(flags) Flags.
208# @param $(defs) Definitions. No -D or something.
209# @param $(incs) Includes. No -I or something.
210# @param $(dirdep) Directory creation dependency.
211# @param $(deps) Other dependencies.
212#
213# @param $(outbase) Output basename (full). Use this for list files and such.
214# @param $(objsuff) Object suffix.
215TOOL_VCC141AMD64_COMPILE_CXX_DEPEND = $($(target)_1_VCC_PCH_FILE)
216TOOL_VCC141AMD64_COMPILE_CXX_DEPORD =
217TOOL_VCC141AMD64_COMPILE_CXX_OUTPUT =
218TOOL_VCC141AMD64_COMPILE_CXX_OUTPUT_MAYBE = $(if-expr defined($(target)_1_VCC_COMMON_OBJ_PDB)\
219 ,,$(call TOOL_VCC141_PDB, $(outbase)-obj,pdb) $(call TOOL_VCC141_PDB, $(outbase)-obj,idb))
220ifdef TOOL_VCC141AMD64_KSUBMIT
221 TOOL_VCC141AMD64_COMPILE_CXX_DONT_PURGE_OUTPUT := 1 # speed
222 define TOOL_VCC141AMD64_COMPILE_CXX_CMDS
223 $(QUIET)$(TOOL_VCC141AMD64_KSUBMIT) -P $(DEP_OBJ_INT) -f -s -q -o $(dep) -t $(obj) $(obj)\
224 -- $(TOOL_VCC141AMD64_CXX) -c\
225 $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
226 $(if-expr defined($(target)_PCH_HDR)\
227 ,-FI$($(target)_PCH_HDR) -Yu$($(target)_PCH_HDR) -Fp$($(target)_1_VCC_PCH_FILE) -FS,)\
228 -Fd$(if-expr defined($(target)_1_VCC_COMMON_OBJ_PDB),$($(target)_1_VCC_COMMON_OBJ_PDB),$(outbase)-obj.pdb) \
229 -Fo$(obj)\
230 $(subst /,\\,$(abspath $(source)))
231 endef
232else
233 define TOOL_VCC141AMD64_COMPILE_CXX_CMDS
234 $(QUIET)$(TOOL_VCC141AMD64_SETUP_ENV)$(TOOL_VCC141AMD64_CXX) -c\
235 $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
236 $(if-expr defined($(target)_PCH_HDR)\
237 ,-FI$($(target)_PCH_HDR) -Yu$($(target)_PCH_HDR) -Fp$($(target)_1_VCC_PCH_FILE) -FS,)\
238 -Fd$(if-expr defined($(target)_1_VCC_COMMON_OBJ_PDB),$($(target)_1_VCC_COMMON_OBJ_PDB),$(outbase)-obj.pdb) \
239 -Fo$(obj)\
240 $(subst /,\\,$(abspath $(source)))
241 $(QUIET)$(DEP_OBJ) -f -s -q -o $(dep) -t $(obj) $(obj)
242 endef
243endif # !TOOL_VCC141AMD64_KSUBMIT
244
245
246#
247# Helper tool for creating the precompiled C++ header.
248#
249# It only have the C++ compile bits and it's purpose is to skip bits
250# related _1_VCC_PCH_FILE and add -Yc.
251#
252TOOL_VCC141AMD64-PCH := Helper for creating precompiled header using CXX handling.
253TOOL_VCC141AMD64-PCH_EXTENDS := VCC141AMD64
254TOOL_VCC141AMD64-PCH_CXXOBJSUFF := .obj
255TOOL_VCC141AMD64-PCH_CXXINCS = $(TOOL_VCC141AMD64_CXXINCS)
256TOOL_VCC141AMD64-PCH_CXXFLAGS = $(TOOL_VCC141AMD64_CXXFLAGS) -FS
257TOOL_VCC141AMD64-PCH_CXXFLAGS.debug = $(TOOL_VCC141AMD64_CXXFLAGS.debug)
258TOOL_VCC141AMD64-PCH_CXXFLAGS.dbgopt = $(TOOL_VCC141AMD64_CXXFLAGS.dbgopt)
259TOOL_VCC141AMD64-PCH_CXXFLAGS.release = $(TOOL_VCC141AMD64_CXXFLAGS.release)
260TOOL_VCC141AMD64-PCH_CXXFLAGS.profile = $(TOOL_VCC141AMD64_CXXFLAGS.profile)
261TOOL_VCC141AMD64-PCH_COMPILE_CXX_DEPEND = $(NO_SUCH_VARIABLE)
262TOOL_VCC141AMD64-PCH_COMPILE_CXX_DEPORD = $(NO_SUCH_VARIABLE)
263TOOL_VCC141AMD64-PCH_COMPILE_CXX_OUTPUT = $($(target)_1_VCC_PCH_FILE) $($(target)_1_VCC_COMMON_OBJ_PDB)
264TOOL_VCC141AMD64-PCH_COMPILE_CXX_OUTPUT_MAYBE = $(NO_SUCH_VARIABLE)
265ifdef TOOL_VCC141AMD64_KSUBMIT
266 define TOOL_VCC141AMD64-PCH_COMPILE_CXX_CMDS
267 $(QUIET)$(RM) -f -- $($(target)_1_VCC_PCH_FILE) $($(target)_1_VCC_COMMON_OBJ_PDB)
268 $(QUIET)$(TOOL_VCC141AMD64_KSUBMIT) --no-pch-caching -P $(DEP_OBJ_INT) -f -s -q -e .pch -o $(dep) -t $(obj) $(obj)\
269 -- $(TOOL_VCC141AMD64_CXX) -c -Yc\
270 $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
271 -Fp$($(target)_1_VCC_PCH_FILE) \
272 -Fd$($(target)_1_VCC_COMMON_OBJ_PDB) \
273 -Fo$(obj)\
274 -TP \
275 $(subst /,\\,$(abspath $(source)))
276 endef
277else
278 define TOOL_VCC141AMD64-PCH_COMPILE_CXX_CMDS
279 $(QUIET)$(RM) -f -- $($(target)_1_VCC_PCH_FILE) $($(target)_1_VCC_COMMON_OBJ_PDB)
280 $(QUIET)$(TOOL_VCC141AMD64_SETUP_ENV)$(TOOL_VCC141AMD64_CXX) -c -Yc\
281 $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
282 -Fp$($(target)_1_VCC_PCH_FILE) \
283 -Fd$($(target)_1_VCC_COMMON_OBJ_PDB) \
284 -Fo$(obj)\
285 -TP \
286 $(subst /,\\,$(abspath $(source)))
287 $(QUIET)$(DEP_OBJ) -f -s -q -e .pch -o $(dep) -t $(obj) $(obj)
288
289 endef
290endif # !TOOL_VCC141AMD64_KSUBMIT
291
292
293## @todo configure the assembler template.
294
295## Compile resource source.
296# @param $(target) Normalized main target name.
297# @param $(source) Source filename (relative).
298# @param $(obj) Object file name. This shall be (re)created by the compilation.
299# @param $(dep) Dependcy file. This shall be (re)created by the compilation.
300# @param $(flags) Flags.
301# @param $(defs) Definitions. No -D or something.
302# @param $(incs) Includes. No -I or something.
303# @param $(dirdep) Directory creation dependency.
304# @param $(deps) Other dependencies.
305#
306# @param $(outbase) Output basename (full). Use this for list files and such.
307# @param $(objsuff) Object suffix.
308TOOL_VCC141AMD64_COMPILE_RC_DEPEND =
309TOOL_VCC141AMD64_COMPILE_RC_DEPORD =
310TOOL_VCC141AMD64_COMPILE_RC_OUTPUT =
311define TOOL_VCC141AMD64_COMPILE_RC_CMDS
312 $(QUIET)$(TOOL_VCC141AMD64_RC) \
313 $(flags) $(qaddprefix sh,/i, $(subst /,\\,$(incs))) $(qaddprefix sh,/d, $(defs))\
314 /fo$(obj)\
315 $(subst /,\\,$(abspath $(source)))
316endef
317
318
319## Link library
320# @param $(target) Normalized main target name.
321# @param $(out) Library name.
322# @param $(objs) Object files to put in the library.
323# @param $(flags) Flags.
324# @param $(dirdep) Directory creation dependency.
325# @param $(deps) Other dependencies.
326# @param $(othersrc) Unhandled sources.
327# @param $(outbase) Output basename (full). Use this for list files and such.
328#
329TOOL_VCC141AMD64_LINK_LIBRARY_DEPEND = $(othersrc)
330TOOL_VCC141AMD64_LINK_LIBRARY_DEPORD =
331TOOL_VCC141AMD64_LINK_LIBRARY_OUTPUT = $(outbase).rsp
332TOOL_VCC141AMD64_LINK_LIBRARY_OUTPUT_MAYBE = $(outbase).lst $(outbase).exp $(outbase).pdb
333define TOOL_VCC141AMD64_LINK_LIBRARY_CMDS
334 $(QUIET)$(APPEND) -tn $(outbase).rsp \
335 $(qforeachfile u,arg, $(objs) $(filter-out %.def,$(othersrc)),$(quote-sh "$(subst /,\,$(arg))")) \
336 $(qforeachfile u,arg, $(filter %.def,$(othersrc)),$(quote-sh "/DEF:$(subst /,\,$(arg))"))
337 $(QUIET)$(TOOL_VCC141AMD64_KSUBMIT_DD) $(TOOL_VCC141AMD64_AR) $(flags) /OUT:$(out) @$(outbase).rsp
338endef
339
340
341## Link program
342# @param $(target) Normalized main target name.
343# @param $(out) Program name.
344# @param $(objs) Object files to link together.
345# @param $(libs) Libraries to search.
346# @param $(libpath) Library search paths.
347# @param $(flags) Flags.
348# @param $(dirdep) Directory creation dependency.
349# @param $(deps) Other dependencies.
350# @param $(othersrc) Unhandled sources.
351# @param $(custom_pre) Custom step invoked before linking.
352# @param $(custom_post) Custom step invoked after linking.
353# @param $(outbase) Output basename (full). Use this for list files and such.
354#
355TOOL_VCC141AMD64_LINK_PROGRAM_DEPEND = $(foreachfile lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
356TOOL_VCC141AMD64_LINK_PROGRAM_DEPORD =
357TOOL_VCC141AMD64_LINK_PROGRAM_OUTPUT_MAYBE_PRECIOUS = $(outbase).map $(outbase).rsp
358TOOL_VCC141AMD64_LINK_PROGRAM_OUTPUT_MAYBE = $(outbase).lib $(outbase).exp $(outbase).ilk $(out).manifest
359TOOL_VCC141AMD64_LINK_PROGRAM_OUTPUT_DEBUG = $(outbase).pdb
360TOOL_VCC141AMD64_LINK_PROGRAM_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
361define TOOL_VCC141AMD64_LINK_PROGRAM_CMDS
362 $(QUIET)$(APPEND) -tn $(outbase).rsp \
363 $(qforeachfile u,arg, $(objs) $(libs),$(quote-sh "$(subst /,\,$(arg))"))
364 $(QUIET)$(TOOL_VCC141AMD64_KSUBMIT_DD) $(TOOL_VCC141AMD64_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 $(qaddprefix sh,/LIBPATH:,$(libpath)) \
371 @$(outbase).rsp
372ifndef TOOL_VCC141AMD64_NO_AUTO_MANIFEST
373 $(QUIET)$(TEST) -f $(out).manifest -- \
374 $(TOOL_VCC141AMD64_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_VCC141AMD64_LINK_DLL_DEPEND = $(foreachfile lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
394TOOL_VCC141AMD64_LINK_DLL_DEPORD = $(call DIRDEP,$(PATH_STAGE_LIB))
395TOOL_VCC141AMD64_LINK_DLL_OUTPUT = $(outbase).lib $(outbase).exp
396TOOL_VCC141AMD64_LINK_DLL_OUTPUT_MAYBE = $(outbase).ilk $(out).manifest $(PATH_STAGE_LIB)/$(notdir $(outbase)).exp
397TOOL_VCC141AMD64_LINK_DLL_OUTPUT_MAYBE_PRECIOUS = $(PATH_STAGE_LIB)/$(notdir $(outbase)).lib $(outbase).map $(outbase).rsp
398TOOL_VCC141AMD64_LINK_DLL_OUTPUT_DEBUG = $(outbase).pdb
399TOOL_VCC141AMD64_LINK_DLL_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
400define TOOL_VCC141AMD64_LINK_DLL_CMDS
401 $(QUIET)$(APPEND) -tn $(outbase).rsp \
402 $(qforeachfile u,arg, $(objs) $(libs),$(quote-sh "$(subst /,\,$(arg))"))
403 $(QUIET)$(TOOL_VCC141AMD64_KSUBMIT_DD) $(TOOL_VCC141AMD64_LD) $(flags) \
404 /OUT:$(out) \
405 /IMPLIB:$(outbase).lib \
406 /MAPINFO:EXPORTS /INCREMENTAL:NO \
407 /MAP:$(outbase).map \
408 /DLL \
409 $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
410 $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
411 $(qaddprefix sh,/LIBPATH:,$(libpath)) \
412 @$(outbase).rsp
413ifndef TOOL_VCC141AMD64_NO_AUTO_MANIFEST
414 $(QUIET)$(TEST) -f $(out).manifest -- \
415 $(TOOL_VCC141AMD64_MT) -manifest $(subst /,\\,$(out)).manifest '-outputresource:$(subst /,\\,$(out));#2'
416endif
417 $(QUIET)$(TEST) -f $(outbase).lib -- $(KLIBTWEAKER_EXT) --clear-timestamps $(outbase).lib
418 $(QUIET)$(CP) --changed -v --ignore-non-existing $(outbase).exp $(outbase).lib $(PATH_STAGE_LIB)/
419$(eval _DIRS += $(PATH_STAGE_LIB))
420endef
421
422
423## Link system module (windows aka driver, linux aka kernel module)
424# @param $(target) Normalized main target name.
425# @param $(out) System module name.
426# @param $(objs) Object files to link together.
427# @param $(libs) Libraries to search.
428# @param $(libpath) Library search paths.
429# @param $(flags) Flags.
430# @param $(dirdep) Directory creation dependency.
431# @param $(deps) Other dependencies.
432# @param $(othersrc) Unhandled sources.
433# @param $(custom_pre) Custom step invoked before linking.
434# @param $(custom_post) Custom step invoked after linking.
435#
436# @param $(outbase) Output basename (full). Use this for list files and such.
437TOOL_VCC141AMD64_LINK_SYSMOD_DEPEND = $(foreachfile lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
438TOOL_VCC141AMD64_LINK_SYSMOD_DEPORD =
439TOOL_VCC141AMD64_LINK_SYSMOD_OUTPUT_MAYBE = $(outbase).lib $(outbase).exp $(outbase).ilk $(out).manifest
440TOOL_VCC141AMD64_LINK_SYSMOD_OUTPUT_MAYBE_PRECIOUS = $(outbase).map $(outbase).rsp
441TOOL_VCC141AMD64_LINK_SYSMOD_OUTPUT_DEBUG = $(outbase).pdb
442TOOL_VCC141AMD64_LINK_SYSMOD_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
443define TOOL_VCC141AMD64_LINK_SYSMOD_CMDS
444 $(QUIET)$(APPEND) -tn $(outbase).rsp \
445 $(qforeachfile u,arg, $(objs) $(libs),$(quote-sh "$(subst /,\,$(arg))"))
446 $(QUIET)$(TOOL_VCC141AMD64_KSUBMIT_DD) $(TOOL_VCC141AMD64_LD) $(flags) \
447 /OUT:$(out) \
448 /MAPINFO:EXPORTS /INCREMENTAL:NO \
449 /MAP:$(outbase).map \
450 $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
451 $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
452 $(qaddprefix sh,/LIBPATH:,$(libpath)) \
453 @$(outbase).rsp
454ifndef TOOL_VCC141AMD64_NO_AUTO_MANIFEST
455 $(QUIET)$(TEST) -f $(out).manifest -- \
456 $(TOOL_VCC141AMD64_MT) -manifest $(subst /,\\,$(out)).manifest '-outputresource:$(subst /,\\,$(out));#2'
457endif
458endef
459
Note: See TracBrowser for help on using the repository browser.