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

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

tools/VCC141*.kmk: Early commit of Visual C++ 14.1 tools.

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