3 # kBuild Tool Config - Visual C++ 14.0 (aka Visual 2015 and MSC v19.0x), targeting AMD64.
7 # Copyright (c) 2004-2020 knut st. osmundsen <bird-kBuild-spam-xx@anduin.net>
9 # This file is part of kBuild.
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.
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.
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
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.
35 include $(KBUILD_PATH
)/tools
/VCC140.kmk
38 TOOL_VCC140AMD64
:= Visual C
++ 14.0 (aka Visual
2015 and MSC v19.0x
), targeting AMD64
41 # Tool Specific Properties
43 ifndef PATH_TOOL_VCC140AMD64_BIN
44 ifeq ($(KBUILD_HOST_ARCH
),amd64
)
45 PATH_TOOL_VCC140AMD64_BIN
:= $(PATH_TOOL_VCC140_BASE_BIN
)/amd64
47 PATH_TOOL_VCC140AMD64_BIN
:= $(PATH_TOOL_VCC140_BASE_BIN
)/x86_amd64
50 PATH_TOOL_VCC140AMD64_BIN
:= $(PATH_TOOL_VCC140AMD64_BIN
)
52 PATH_TOOL_VCC140AMD64_BIN_QSH
:= $(requote sh
,$(PATH_TOOL_VCC140AMD64_BIN
))
54 # 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.
55 ifndef PATH_TOOL_VCC140AMD64_DLL_BIN
56 ifneq ($(PATH_TOOL_VCC140_HOST_DLL_BIN
),$(PATH_TOOL_VCC140AMD64_BIN
))
57 PATH_TOOL_VCC140AMD64_DLL_BIN
:= $(PATH_TOOL_VCC140_HOST_DLL_BIN
)
61 ifndef PATH_TOOL_VCC140AMD64_LIB
62 PATH_TOOL_VCC140AMD64_LIB
:= $(PATH_TOOL_VCC140_LIB.amd64
)
64 ifndef PATH_TOOL_VCC140_ONECORE_LIB
65 PATH_TOOL_VCC140_ONECORE_LIB
:= $(PATH_TOOL_VCC140_ONECORE_LIB.amd64
)
68 ifndef PATH_TOOL_VCC140AMD64_INC
69 PATH_TOOL_VCC140AMD64_INC
:= $(PATH_TOOL_VCC140_INC
)
72 ifndef PATH_TOOL_VCC140AMD64_ATLMFC_INC
73 PATH_TOOL_VCC140AMD64_ATLMFC_INC
:= $(PATH_TOOL_VCC140_ATLMFC_INC.amd64
)
75 ifndef PATH_TOOL_VCC140AMD64_ATLMFC_LIB
76 PATH_TOOL_VCC140AMD64_ATLMFC_LIB
:= $(PATH_TOOL_VCC140_ATLMFC_LIB.amd64
)
79 TOOL_VCC140AMD64_CC ?
= $(EXEC_X86_WIN32
) $(PATH_TOOL_VCC140AMD64_BIN_QSH
)/cl.exe
80 TOOL_VCC140AMD64_CXX ?
= $(EXEC_X86_WIN32
) $(PATH_TOOL_VCC140AMD64_BIN_QSH
)/cl.exe
81 TOOL_VCC140AMD64_AS ?
= $(EXEC_X86_WIN32
) $(PATH_TOOL_VCC140AMD64_BIN_QSH
)/ml64.exe
82 #TOOL_VCC140AMD64_AR ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC140AMD64_BIN_QSH)/lib.exe - just an exec wrapper for the below
83 TOOL_VCC140AMD64_AR ?
= $(EXEC_X86_WIN32
) $(PATH_TOOL_VCC140AMD64_BIN_QSH
)/link.exe
/LIB
84 TOOL_VCC140AMD64_LD ?
= $(EXEC_X86_WIN32
) $(PATH_TOOL_VCC140AMD64_BIN_QSH
)/link.exe
85 TOOL_VCC140AMD64_DUMPBIN ?
= $(EXEC_X86_WIN32
) $(PATH_TOOL_VCC140AMD64_BIN_QSH
)/dumpbin.exe
86 TOOL_VCC140AMD64_EDITBIN ?
= $(EXEC_X86_WIN32
) $(PATH_TOOL_VCC140AMD64_BIN_QSH
)/editbin.exe
88 TOOL_VCC140AMD64_RC ?
= $(EXEC_X86_WIN32
) $(call TOOL_VCC140_FN_FIND_SDK_TOOL
,rc.exe
,[Rr
][Cc
].
[Ee
][Xx
][Ee
],TOOL_VCC140_RC_CACHED
)
89 TOOL_VCC140AMD64_MT ?
= $(TOOL_VCC140AMD64_MT_RETRY
) $(EXEC_X86_WIN32
) $(call TOOL_VCC140_FN_FIND_SDK_TOOL
,mt.exe
,[Mm
][Tt
].
[Ee
][Xx
][Ee
],TOOL_VCC140_MT_CACHED
)
90 TOOL_VCC140AMD64_MT_RETRY ?
= $(TOOL_VCC140_MT_RETRY
)
92 undefine TOOL_VCC140AMD64_USE_KSUBMIT
# for now
93 ifdef TOOL_VCC140AMD64_USE_KSUBMIT
94 ifeq ($(KBUILD_HOST
),win
)
95 ifneq ($(substr
$(qdir un
,$(PATH_TOOL_VCC140AMD64_BIN
)),-3),64/)
96 TOOL_VCC140AMD64_KSUBMIT ?
= kmk_builtin_kSubmit
--64-bit
98 TOOL_VCC140AMD64_KSUBMIT ?
= kmk_builtin_kSubmit
--32-bit
100 ifdef PATH_TOOL_VCC140AMD64_DLL_BIN
101 TOOL_VCC140AMD64_KSUBMIT
:= $(TOOL_VCC140AMD64_KSUBMIT
) --prepend
"PATH=$(requote shell-in-dq,$(PATH_TOOL_VCC140AMD64_DLL_BIN));"
103 TOOL_VCC140AMD64_KSUBMIT_DD
:= $(TOOL_VCC140AMD64_KSUBMIT
) --
106 ifdef PATH_TOOL_VCC140AMD64_DLL_BIN
107 TOOL_VCC140AMD64_SETUP_ENV
:= $(REDIRECT
) --prepend
"PATH=$(requote shell-in-dq,$(PATH_TOOL_VCC140AMD64_DLL_BIN));" --$(SP
)
108 ifndef TOOL_VCC140AMD64_KSUBMIT_DD
109 TOOL_VCC140AMD64_KSUBMIT_DD
:= $(TOOL_VCC140AMD64_SETUP_ENV
)
113 # Redist (more stuff in VCC140.kmk).
114 PATH_TOOL_VCC140AMD64_REDIST ?
= $(PATH_TOOL_VCC140_REDIST
)/x64
115 PATH_TOOL_VCC140AMD64_REDIST_CRT
= $(PATH_TOOL_VCC140AMD64_REDIST
)/$(TOOL_VCC140_REDIST_CRT_SUBDIR
)
116 PATH_TOOL_VCC140AMD64_REDIST_DEBUG ?
= $(PATH_TOOL_VCC140_REDIST_DEBUG
)/x64
117 PATH_TOOL_VCC140AMD64_REDIST_DEBUG_CRT
= $(PATH_TOOL_VCC140AMD64_REDIST_DEBUG
)/$(TOOL_VCC140_REDIST_DEBUG_CRT_SUBDIR
)
118 TOOL_VCC140AMD64_REDIST_CRT_DLLS
= $(TOOL_VCC140_REDIST_CRT_DLLS.amd64
)
119 TOOL_VCC140AMD64_REDIST_CONCRT_DLLS
= $(TOOL_VCC140_REDIST_CONCRT_DLLS.amd64
)
120 TOOL_VCC140AMD64_REDIST_CPP_DLLS
= $(TOOL_VCC140_REDIST_CPP_DLLS.amd64
)
121 TOOL_VCC140AMD64_REDIST_WINRT_DLLS
= $(TOOL_VCC140_REDIST_WINRT_DLLS.amd64
)
125 # Properties used by kBuild
127 TOOL_VCC140AMD64_COBJSUFF ?
= .obj
128 TOOL_VCC140AMD64_CFLAGS ?
= -TC
-nologo
-Zi
-ZH
:SHA_256
129 TOOL_VCC140AMD64_CFLAGS.debug ?
=
130 TOOL_VCC140AMD64_CFLAGS.dbgopt ?
= -O2
131 TOOL_VCC140AMD64_CFLAGS.release ?
= -O2
132 TOOL_VCC140AMD64_CFLAGS.profile ?
= -O2
133 TOOL_VCC140AMD64_CINCS ?
= $(PATH_TOOL_VCC140AMD64_INC
)
134 TOOL_VCC140AMD64_CDEFS ?
=
136 TOOL_VCC140AMD64_CXXOBJSUFF ?
= .obj
137 TOOL_VCC140AMD64_CXXFLAGS ?
= -TP
-nologo
-Zi
-ZH
:SHA_256
138 TOOL_VCC140AMD64_CXXFLAGS.debug ?
=
139 TOOL_VCC140AMD64_CXXFLAGS.dbgopt ?
= -O2
140 TOOL_VCC140AMD64_CXXFLAGS.release ?
= -O2
141 TOOL_VCC140AMD64_CXXFLAGS.profile ?
= -O2
142 TOOL_VCC140AMD64_CXXINCS ?
= $(PATH_TOOL_VCC140AMD64_INC
) $(PATH_TOOL_VCC140AMD64_ATLMFC_INC
)
143 TOOL_VCC140AMD64_CXXDEFS ?
=
145 TOOL_VCC140AMD64_ASOBJSUFF ?
= .obj
147 TOOL_VCC140AMD64_RCOBJSUFF ?
= .res
148 TOOL_VCC140AMD64_RCINCS ?
= $(PATH_TOOL_VCC140AMD64_INC
) $(PATH_TOOL_VCC140AMD64_ATLMFC_INC
)
150 TOOL_VCC140AMD64_ARFLAGS ?
= -nologo
-machine
:amd64
151 TOOL_VCC140AMD64_ARLIBSUFF ?
= .lib
153 TOOL_VCC140AMD64_LDFLAGS ?
= -nologo
-machine
:amd64
154 TOOL_VCC140AMD64_LDFLAGS.debug ?
= -debug
155 TOOL_VCC140AMD64_LDFLAGS.dbgopt ?
= -debug
156 TOOL_VCC140AMD64_LDFLAGS.profile ?
= -debug
157 TOOL_VCC140AMD64_LDFLAGS.release ?
=
162 # @param $(target) Normalized main target name.
163 # @param $(source) Source filename (relative).
164 # @param $(obj) Object file name. This shall be (re)created by the compilation.
165 # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
166 # @param $(flags) Flags.
167 # @param $(defs) Definitions. No -D or something.
168 # @param $(incs) Includes. No -I or something.
169 # @param $(dirdep) Directory creation dependency.
170 # @param $(deps) Other dependencies.
172 # @param $(outbase) Output basename (full). Use this for list files and such.
173 # @param $(objsuff) Object suffix.
174 TOOL_VCC140AMD64_COMPILE_C_DEPEND
=
175 TOOL_VCC140AMD64_COMPILE_C_DEPORD
=
176 TOOL_VCC140AMD64_COMPILE_C_OUTPUT
=
177 TOOL_VCC140AMD64_COMPILE_C_OUTPUT_MAYBE
= $(call TOOL_VCC140_PDB
, $(outbase
)-obj
,pdb
) $(call TOOL_VCC140_PDB
, $(outbase
)-obj
,idb
)
178 ifdef TOOL_VCC140AMD64_KSUBMIT
179 TOOL_VCC140AMD64_COMPILE_C_DONT_PURGE_OUTPUT
:= 1 # speed
180 define TOOL_VCC140AMD64_COMPILE_C_CMDS
181 $(QUIET
)$(TOOL_VCC140AMD64_KSUBMIT
) -P
$(DEP_OBJ_INT
) -f
-s
-q
-o
$(dep
) -t
$(obj
) $(obj
)\
182 -- $(TOOL_VCC140AMD64_CC
) -c\
183 $(flags
) $(qaddprefix sh
,-I
, $(incs
)) $(qaddprefix sh
,-D
, $(defs
))\
184 -Fd
$(outbase
)-obj.pdb \
186 $(subst /,\\,$(abspath
$(source
)))
189 define TOOL_VCC140AMD64_COMPILE_C_CMDS
190 $(QUIET
)$(TOOL_VCC140AMD64_SETUP_ENV
)$(TOOL_VCC140AMD64_CC
) -c\
191 $(flags
) $(qaddprefix sh
,-I
, $(incs
)) $(qaddprefix sh
,-D
, $(defs
))\
192 -Fd
$(outbase
)-obj.pdb \
194 $(subst /,\\,$(abspath
$(source
)))
195 $(QUIET
)$(DEP_OBJ
) -f
-s
-q
-o
$(dep
) -t
$(obj
) $(obj
)
197 endif # !TOOL_VCC140AMD64_KSUBMIT
200 ## Compile C++ source.
201 # @param $(target) Normalized main target name.
202 # @param $(source) Source filename (relative).
203 # @param $(obj) Object file name. This shall be (re)created by the compilation.
204 # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
205 # @param $(flags) Flags.
206 # @param $(defs) Definitions. No -D or something.
207 # @param $(incs) Includes. No -I or something.
208 # @param $(dirdep) Directory creation dependency.
209 # @param $(deps) Other dependencies.
211 # @param $(outbase) Output basename (full). Use this for list files and such.
212 # @param $(objsuff) Object suffix.
213 TOOL_VCC140AMD64_COMPILE_CXX_DEPEND
= $($(target
)_1_VCC_PCH_FILE
)
214 TOOL_VCC140AMD64_COMPILE_CXX_DEPORD
=
215 TOOL_VCC140AMD64_COMPILE_CXX_OUTPUT
=
216 TOOL_VCC140AMD64_COMPILE_CXX_OUTPUT_MAYBE
= $(if-expr defined
($(target
)_1_VCC_COMMON_OBJ_PDB
)\
217 ,,$(call TOOL_VCC140_PDB
, $(outbase
)-obj
,pdb
) $(call TOOL_VCC140_PDB
, $(outbase
)-obj
,idb
))
218 ifdef TOOL_VCC140AMD64_KSUBMIT
219 TOOL_VCC140AMD64_COMPILE_CXX_DONT_PURGE_OUTPUT
:= 1 # speed
220 define TOOL_VCC140AMD64_COMPILE_CXX_CMDS
221 $(QUIET
)$(TOOL_VCC140AMD64_KSUBMIT
) -P
$(DEP_OBJ_INT
) -f
-s
-q
-o
$(dep
) -t
$(obj
) $(obj
)\
222 -- $(TOOL_VCC140AMD64_CXX
) -c\
223 $(flags
) $(qaddprefix sh
,-I
, $(incs
)) $(qaddprefix sh
,-D
, $(defs
))\
224 $(if-expr defined
($(target
)_PCH_HDR
)\
225 ,-FI
$($(target
)_PCH_HDR
) -Yu
$($(target
)_PCH_HDR
) -Fp
$($(target
)_1_VCC_PCH_FILE
) -FS
,)\
226 -Fd
$(if-expr defined
($(target
)_1_VCC_COMMON_OBJ_PDB
),$($(target
)_1_VCC_COMMON_OBJ_PDB
),$(outbase
)-obj.pdb
) \
228 $(subst /,\\,$(abspath
$(source
)))
231 define TOOL_VCC140AMD64_COMPILE_CXX_CMDS
232 $(QUIET
)$(TOOL_VCC140AMD64_SETUP_ENV
)$(TOOL_VCC140AMD64_CXX
) -c\
233 $(flags
) $(qaddprefix sh
,-I
, $(incs
)) $(qaddprefix sh
,-D
, $(defs
))\
234 $(if-expr defined
($(target
)_PCH_HDR
)\
235 ,-FI
$($(target
)_PCH_HDR
) -Yu
$($(target
)_PCH_HDR
) -Fp
$($(target
)_1_VCC_PCH_FILE
) -FS
,)\
236 -Fd
$(if-expr defined
($(target
)_1_VCC_COMMON_OBJ_PDB
),$($(target
)_1_VCC_COMMON_OBJ_PDB
),$(outbase
)-obj.pdb
) \
238 $(subst /,\\,$(abspath
$(source
)))
239 $(QUIET
)$(DEP_OBJ
) -f
-s
-q
-o
$(dep
) -t
$(obj
) $(obj
)
241 endif # !TOOL_VCC140AMD64_KSUBMIT
245 # Helper tool for creating the precompiled C++ header.
247 # It only have the C++ compile bits and it's purpose is to skip bits
248 # related _1_VCC_PCH_FILE and add -Yc.
250 TOOL_VCC140AMD64-PCH
:= Helper for creating precompiled header using CXX handling.
251 TOOL_VCC140AMD64-PCH_EXTENDS
:= VCC140AMD64
252 TOOL_VCC140AMD64-PCH_CXXOBJSUFF
:= .obj
253 TOOL_VCC140AMD64-PCH_CXXINCS
= $(TOOL_VCC140AMD64_CXXINCS
)
254 TOOL_VCC140AMD64-PCH_CXXFLAGS
= $(TOOL_VCC140AMD64_CXXFLAGS
)
255 TOOL_VCC140AMD64-PCH_CXXFLAGS.debug
= $(TOOL_VCC140AMD64_CXXFLAGS.debug
)
256 TOOL_VCC140AMD64-PCH_CXXFLAGS.dbgopt
= $(TOOL_VCC140AMD64_CXXFLAGS.dbgopt
)
257 TOOL_VCC140AMD64-PCH_CXXFLAGS.release
= $(TOOL_VCC140AMD64_CXXFLAGS.release
)
258 TOOL_VCC140AMD64-PCH_CXXFLAGS.profile
= $(TOOL_VCC140AMD64_CXXFLAGS.profile
)
259 TOOL_VCC140AMD64-PCH_COMPILE_CXX_DEPEND
= $(NO_SUCH_VARIABLE
)
260 TOOL_VCC140AMD64-PCH_COMPILE_CXX_DEPORD
= $(NO_SUCH_VARIABLE
)
261 TOOL_VCC140AMD64-PCH_COMPILE_CXX_OUTPUT
= $($(target
)_1_VCC_PCH_FILE
) $($(target
)_1_VCC_COMMON_OBJ_PDB
)
262 TOOL_VCC140AMD64-PCH_COMPILE_CXX_OUTPUT_MAYBE
= $(NO_SUCH_VARIABLE
)
263 ifdef TOOL_VCC140AMD64_KSUBMIT
264 define TOOL_VCC140AMD64-PCH_COMPILE_CXX_CMDS
265 $(QUIET
)$(RM
) -f
-- $($(target
)_1_VCC_PCH_FILE
) $($(target
)_1_VCC_COMMON_OBJ_PDB
)
266 $(QUIET
)$(TOOL_VCC140AMD64_KSUBMIT
) --no-pch-caching
-P
$(DEP_OBJ_INT
) -f
-s
-q
-e .pch
-o
$(dep
) -t
$(obj
) $(obj
)\
267 -- $(TOOL_VCC140AMD64_CXX
) -c
-Yc\
268 $(flags
) $(qaddprefix sh
,-I
, $(incs
)) $(qaddprefix sh
,-D
, $(defs
))\
269 $(if-expr defined
($(target
)_PCH_HDR
),-FI
$($(target
)_PCH_HDR
),)\
270 -Fp
$($(target
)_1_VCC_PCH_FILE
) \
271 -Fd
$($(target
)_1_VCC_COMMON_OBJ_PDB
) \
274 $(subst /,\\,$(abspath
$(source
)))
277 define TOOL_VCC140AMD64-PCH_COMPILE_CXX_CMDS
278 $(QUIET
)$(RM
) -f
-- $($(target
)_1_VCC_PCH_FILE
) $($(target
)_1_VCC_COMMON_OBJ_PDB
)
279 $(QUIET
)$(TOOL_VCC140AMD64_SETUP_ENV
)$(TOOL_VCC140AMD64_CXX
) -c
-Yc\
280 $(flags
) $(qaddprefix sh
,-I
, $(incs
)) $(qaddprefix sh
,-D
, $(defs
))\
281 $(if-expr defined
($(target
)_PCH_HDR
),-FI
$($(target
)_PCH_HDR
),)\
282 -Fp
$($(target
)_1_VCC_PCH_FILE
) \
283 -Fd
$($(target
)_1_VCC_COMMON_OBJ_PDB
) \
286 $(subst /,\\,$(abspath
$(source
)))
287 $(QUIET
)$(DEP_OBJ
) -f
-s
-q
-e .pch
-o
$(dep
) -t
$(obj
) $(obj
)
290 endif # !TOOL_VCC140AMD64_KSUBMIT
293 ## @todo configure the assembler template.
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.
306 # @param $(outbase) Output basename (full). Use this for list files and such.
307 # @param $(objsuff) Object suffix.
308 TOOL_VCC140AMD64_COMPILE_RC_DEPEND
=
309 TOOL_VCC140AMD64_COMPILE_RC_DEPORD
=
310 TOOL_VCC140AMD64_COMPILE_RC_OUTPUT
=
311 define TOOL_VCC140AMD64_COMPILE_RC_CMDS
312 $(QUIET
)$(TOOL_VCC140AMD64_RC
) \
313 $(flags
) $(qaddprefix sh
,/i
, $(subst /,\\,$(incs
))) $(qaddprefix sh
,/d
, $(defs
))\
315 $(subst /,\\,$(abspath
$(source
)))
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.
329 TOOL_VCC140AMD64_LINK_LIBRARY_DEPEND
= $(othersrc
)
330 TOOL_VCC140AMD64_LINK_LIBRARY_DEPORD
=
331 TOOL_VCC140AMD64_LINK_LIBRARY_OUTPUT
= $(outbase
).rsp
332 TOOL_VCC140AMD64_LINK_LIBRARY_OUTPUT_MAYBE
= $(outbase
).lst
$(outbase
).exp
$(outbase
).pdb
333 define TOOL_VCC140AMD64_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_VCC140AMD64_KSUBMIT_DD
) $(TOOL_VCC140AMD64_AR
) $(flags
) /OUT
:$(out
) @
$(outbase
).rsp
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.
355 TOOL_VCC140AMD64_LINK_PROGRAM_DEPEND
= $(foreachfile lib
,$(libs
),$(if
$(findstring $(lib
),$(subst /,x
,$(lib
))),, $(lib
))) $(othersrc
)
356 TOOL_VCC140AMD64_LINK_PROGRAM_DEPORD
=
357 TOOL_VCC140AMD64_LINK_PROGRAM_OUTPUT_MAYBE_PRECIOUS
= $(outbase
).map
$(outbase
).rsp
358 TOOL_VCC140AMD64_LINK_PROGRAM_OUTPUT_MAYBE
= $(outbase
).lib
$(outbase
).exp
$(outbase
).ilk
$(out
).manifest
359 TOOL_VCC140AMD64_LINK_PROGRAM_OUTPUT_DEBUG
= $(outbase
).pdb
360 TOOL_VCC140AMD64_LINK_PROGRAM_DEBUG_INSTALL_FN
= $(2).pdb
=>$(basename $(3)).pdb
361 define TOOL_VCC140AMD64_LINK_PROGRAM_CMDS
362 $(QUIET
)$(APPEND
) -tn
$(outbase
).rsp \
363 $(qforeachfile u
,arg
, $(objs
) $(libs
),$(quote-sh
"$(subst /,\,$(arg))"))
364 $(QUIET
)$(TOOL_VCC140AMD64_KSUBMIT_DD
) $(TOOL_VCC140AMD64_LD
) $(flags
) \
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
)) \
372 ifndef TOOL_VCC140AMD64_NO_AUTO_MANIFEST
373 $(QUIET
)$(TEST
) -f
$(out
).manifest
-- \
374 $(TOOL_VCC140AMD64_MT
) -manifest
$(subst /,\\,$(out
)).manifest
-outputresource
:$(subst /,\\,$(out
))
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.
392 # @param $(outbase) Output basename (full). Use this for list files and such.
393 TOOL_VCC140AMD64_LINK_DLL_DEPEND
= $(foreachfile lib
,$(libs
),$(if
$(findstring $(lib
),$(subst /,x
,$(lib
))),, $(lib
))) $(othersrc
)
394 TOOL_VCC140AMD64_LINK_DLL_DEPORD
= $(call DIRDEP
,$(PATH_STAGE_LIB
))
395 TOOL_VCC140AMD64_LINK_DLL_OUTPUT
= $(outbase
).lib
$(outbase
).exp
396 TOOL_VCC140AMD64_LINK_DLL_OUTPUT_MAYBE
= $(outbase
).ilk
$(out
).manifest
$(PATH_STAGE_LIB
)/$(notdir $(outbase
)).exp
397 TOOL_VCC140AMD64_LINK_DLL_OUTPUT_MAYBE_PRECIOUS
= $(PATH_STAGE_LIB
)/$(notdir $(outbase
)).lib
$(outbase
).map
$(outbase
).rsp
398 TOOL_VCC140AMD64_LINK_DLL_OUTPUT_DEBUG
= $(outbase
).pdb
399 TOOL_VCC140AMD64_LINK_DLL_DEBUG_INSTALL_FN
= $(2).pdb
=>$(basename $(3)).pdb
400 define TOOL_VCC140AMD64_LINK_DLL_CMDS
401 $(QUIET
)$(APPEND
) -tn
$(outbase
).rsp \
402 $(qforeachfile u
,arg
, $(objs
) $(libs
),$(quote-sh
"$(subst /,\,$(arg))"))
403 $(QUIET
)$(TOOL_VCC140AMD64_KSUBMIT_DD
) $(TOOL_VCC140AMD64_LD
) $(flags
) \
405 /IMPLIB
:$(outbase
).lib \
406 /MAPINFO
:EXPORTS
/INCREMENTAL
:NO \
407 /MAP
:$(outbase
).map \
409 $(foreach def
,$(filter %.def
,$(othersrc
)), /DEF
:$(def
)) \
410 $(subst /,\\,$(filter %.exp
%.res
,$(othersrc
))) \
411 $(qaddprefix sh
,/LIBPATH
:,$(libpath
)) \
413 ifndef TOOL_VCC140AMD64_NO_AUTO_MANIFEST
414 $(QUIET
)$(TEST
) -f
$(out
).manifest
-- \
415 $(TOOL_VCC140AMD64_MT
) -manifest
$(subst /,\\,$(out
)).manifest
'-outputresource:$(subst /,\\,$(out));#2'
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
))
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.
436 # @param $(outbase) Output basename (full). Use this for list files and such.
437 TOOL_VCC140AMD64_LINK_SYSMOD_DEPEND
= $(foreachfile lib
,$(libs
),$(if
$(findstring $(lib
),$(subst /,x
,$(lib
))),, $(lib
))) $(othersrc
)
438 TOOL_VCC140AMD64_LINK_SYSMOD_DEPORD
=
439 TOOL_VCC140AMD64_LINK_SYSMOD_OUTPUT_MAYBE
= $(outbase
).lib
$(outbase
).exp
$(outbase
).ilk
$(out
).manifest
440 TOOL_VCC140AMD64_LINK_SYSMOD_OUTPUT_MAYBE_PRECIOUS
= $(outbase
).map
$(outbase
).rsp
441 TOOL_VCC140AMD64_LINK_SYSMOD_OUTPUT_DEBUG
= $(outbase
).pdb
442 TOOL_VCC140AMD64_LINK_SYSMOD_DEBUG_INSTALL_FN
= $(2).pdb
=>$(basename $(3)).pdb
443 define TOOL_VCC140AMD64_LINK_SYSMOD_CMDS
444 $(QUIET
)$(APPEND
) -tn
$(outbase
).rsp \
445 $(qforeachfile u
,arg
, $(objs
) $(libs
),$(quote-sh
"$(subst /,\,$(arg))"))
446 $(QUIET
)$(TOOL_VCC140AMD64_KSUBMIT_DD
) $(TOOL_VCC140AMD64_LD
) $(flags
) \
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
)) \
454 ifndef TOOL_VCC140AMD64_NO_AUTO_MANIFEST
455 $(QUIET
)$(TEST
) -f
$(out
).manifest
-- \
456 $(TOOL_VCC140AMD64_MT
) -manifest
$(subst /,\\,$(out
)).manifest
'-outputresource:$(subst /,\\,$(out));#2'