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

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

tools/VCC141*: Redist DLLs and stuff.

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