source: trunk/kBuild/tools/VCC141AMD64.kmk

Last change on this file was 3597, checked in by bird, 2 years ago

win-common.kmk,tools/VCC14[012]*.kmk,retry-10-delay-500ms.sh: Retry mt.exe operations as we sometimes run into a race with AV software when adding a manifest right after linking.

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