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 |
|
---|
34 | ifndef TOOL_VCC141
|
---|
35 | include $(KBUILD_PATH)/tools/VCC141.kmk
|
---|
36 | endif
|
---|
37 |
|
---|
38 | TOOL_VCC141AMD64 := Visual C++ 14.1 (aka Visual 2017 and MSC v19.1), targeting AMD64
|
---|
39 |
|
---|
40 | #
|
---|
41 | # Tool Specific Properties
|
---|
42 | #
|
---|
43 | ifndef PATH_TOOL_VCC141AMD64
|
---|
44 | PATH_TOOL_VCC141AMD64 := $(PATH_TOOL_VCC141)
|
---|
45 | else
|
---|
46 | # Resolve any fancy stuff once and for all.
|
---|
47 | PATH_TOOL_VCC141AMD64 := $(PATH_TOOL_VCC141AMD64)
|
---|
48 | endif
|
---|
49 |
|
---|
50 | ifndef PATH_TOOL_VCC141AMD64_BIN
|
---|
51 | PATH_TOOL_VCC141AMD64_BIN := $(PATH_TOOL_VCC141_HOST_BIN)/x64
|
---|
52 | else
|
---|
53 | PATH_TOOL_VCC141AMD64_BIN := $(PATH_TOOL_VCC141_BIN)
|
---|
54 | endif
|
---|
55 | PATH_TOOL_VCC141AMD64_BIN_QSH := $(requote sh,$(PATH_TOOL_VCC141AMD64_BIN))
|
---|
56 |
|
---|
57 | ifndef PATH_TOOL_VCC141AMD64_LIB
|
---|
58 | PATH_TOOL_VCC141AMD64_LIB := $(PATH_TOOL_VCC141_LIB.amd64)
|
---|
59 | endif
|
---|
60 | ifndef PATH_TOOL_VCC141_ONECORE_LIB
|
---|
61 | PATH_TOOL_VCC141_ONECORE_LIB := $(PATH_TOOL_VCC141_ONECORE_LIB.amd64)
|
---|
62 | endif
|
---|
63 |
|
---|
64 | ifndef PATH_TOOL_VCC141AMD64_INC
|
---|
65 | PATH_TOOL_VCC141AMD64_INC := $(PATH_TOOL_VCC141_INC)
|
---|
66 | endif
|
---|
67 |
|
---|
68 | ifndef PATH_TOOL_VCC141AMD64_ATLMFC_INC
|
---|
69 | PATH_TOOL_VCC141AMD64_ATLMFC_INC := $(PATH_TOOL_VCC141_ATLMFC_INC.amd64)
|
---|
70 | endif
|
---|
71 | ifndef PATH_TOOL_VCC141AMD64_ATLMFC_LIB
|
---|
72 | PATH_TOOL_VCC141AMD64_ATLMFC_LIB := $(PATH_TOOL_VCC141_ATLMFC_LIB.amd64)
|
---|
73 | endif
|
---|
74 |
|
---|
75 | TOOL_VCC141AMD64_CC ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC141AMD64_BIN_QSH)/cl.exe
|
---|
76 | TOOL_VCC141AMD64_CXX ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC141AMD64_BIN_QSH)/cl.exe
|
---|
77 | TOOL_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
|
---|
79 | TOOL_VCC141AMD64_AR ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC141AMD64_BIN_QSH)/link.exe /LIB
|
---|
80 | TOOL_VCC141AMD64_LD ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC141AMD64_BIN_QSH)/link.exe
|
---|
81 | TOOL_VCC141AMD64_DUMPBIN ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC141AMD64_BIN_QSH)/dumpbin.exe
|
---|
82 | TOOL_VCC141AMD64_EDITBIN ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC141AMD64_BIN_QSH)/editbin.exe
|
---|
83 |
|
---|
84 | TOOL_VCC141AMD64_RC ?= $(EXEC_X86_WIN32) $(call TOOL_VCC141_FN_FIND_SDK_TOOL,rc.exe,[Rr][Cc].[Ee][Xx][Ee],TOOL_VCC141_RC_CACHED)
|
---|
85 | TOOL_VCC141AMD64_MT ?= $(EXEC_X86_WIN32) $(call TOOL_VCC141_FN_FIND_SDK_TOOL,mt.exe,[Mm][Tt].[Ee][Xx][Ee],TOOL_VCC141_MT_CACHED)
|
---|
86 |
|
---|
87 | undefine TOOL_VCC141AMD64_USE_KSUBMIT # for now
|
---|
88 | ifdef 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
|
---|
98 | endif
|
---|
99 |
|
---|
100 |
|
---|
101 | #
|
---|
102 | # Properties used by kBuild
|
---|
103 | #
|
---|
104 | TOOL_VCC141AMD64_COBJSUFF ?= .obj
|
---|
105 | TOOL_VCC141AMD64_CFLAGS ?= -TC -nologo -Zi
|
---|
106 | TOOL_VCC141AMD64_CFLAGS.debug ?=
|
---|
107 | TOOL_VCC141AMD64_CFLAGS.dbgopt ?= -O2
|
---|
108 | TOOL_VCC141AMD64_CFLAGS.release ?= -O2
|
---|
109 | TOOL_VCC141AMD64_CFLAGS.profile ?= -O2
|
---|
110 | TOOL_VCC141AMD64_CINCS ?= $(PATH_TOOL_VCC141AMD64_INC)
|
---|
111 | TOOL_VCC141AMD64_CDEFS ?=
|
---|
112 |
|
---|
113 | TOOL_VCC141AMD64_CXXOBJSUFF ?= .obj
|
---|
114 | TOOL_VCC141AMD64_CXXFLAGS ?= -TP -nologo -Zi
|
---|
115 | TOOL_VCC141AMD64_CXXFLAGS.debug ?=
|
---|
116 | TOOL_VCC141AMD64_CXXFLAGS.dbgopt ?= -O2
|
---|
117 | TOOL_VCC141AMD64_CXXFLAGS.release ?= -O2
|
---|
118 | TOOL_VCC141AMD64_CXXFLAGS.profile ?= -O2
|
---|
119 | TOOL_VCC141AMD64_CXXINCS ?= $(PATH_TOOL_VCC141AMD64_INC) $(PATH_TOOL_VCC141AMD64_ATLMFC_INC)
|
---|
120 | TOOL_VCC141AMD64_CXXDEFS ?=
|
---|
121 |
|
---|
122 | TOOL_VCC141AMD64_ASOBJSUFF ?= .obj
|
---|
123 |
|
---|
124 | TOOL_VCC141AMD64_RCOBJSUFF ?= .res
|
---|
125 | TOOL_VCC141AMD64_RCINCS ?= $(PATH_TOOL_VCC141AMD64_INC) $(PATH_TOOL_VCC141AMD64_ATLMFC_INC)
|
---|
126 |
|
---|
127 | TOOL_VCC141AMD64_ARFLAGS ?= -nologo -machine:amd64
|
---|
128 | TOOL_VCC141AMD64_ARLIBSUFF ?= .lib
|
---|
129 |
|
---|
130 | TOOL_VCC141AMD64_LDFLAGS ?= -nologo -machine:amd64
|
---|
131 | TOOL_VCC141AMD64_LDFLAGS.debug ?= -debug
|
---|
132 | TOOL_VCC141AMD64_LDFLAGS.dbgopt ?= -debug
|
---|
133 | TOOL_VCC141AMD64_LDFLAGS.profile ?= -debug
|
---|
134 | TOOL_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.
|
---|
151 | TOOL_VCC141AMD64_COMPILE_C_DEPEND =
|
---|
152 | TOOL_VCC141AMD64_COMPILE_C_DEPORD =
|
---|
153 | TOOL_VCC141AMD64_COMPILE_C_OUTPUT =
|
---|
154 | TOOL_VCC141AMD64_COMPILE_C_OUTPUT_MAYBE = $(call TOOL_VCC141_PDB, $(outbase)-obj,pdb) $(call TOOL_VCC141_PDB, $(outbase)-obj,idb)
|
---|
155 | ifdef 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
|
---|
165 | else
|
---|
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
|
---|
174 | endif # !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.
|
---|
190 | TOOL_VCC141AMD64_COMPILE_CXX_DEPEND = $($(target)_1_VCC_PCH_FILE)
|
---|
191 | TOOL_VCC141AMD64_COMPILE_CXX_DEPORD =
|
---|
192 | TOOL_VCC141AMD64_COMPILE_CXX_OUTPUT =
|
---|
193 | TOOL_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))
|
---|
195 | ifdef 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
|
---|
207 | else
|
---|
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
|
---|
218 | endif # !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 | #
|
---|
227 | TOOL_VCC141AMD64-PCH := Helper for creating precompiled header using CXX handling.
|
---|
228 | TOOL_VCC141AMD64-PCH_EXTENDS := VCC141AMD64
|
---|
229 | TOOL_VCC141AMD64-PCH_CXXOBJSUFF := .obj
|
---|
230 | TOOL_VCC141AMD64-PCH_CXXINCS = $(TOOL_VCC141AMD64_CXXINCS)
|
---|
231 | TOOL_VCC141AMD64-PCH_CXXFLAGS = $(TOOL_VCC141AMD64_CXXFLAGS) -FS
|
---|
232 | TOOL_VCC141AMD64-PCH_CXXFLAGS.debug = $(TOOL_VCC141AMD64_CXXFLAGS.debug)
|
---|
233 | TOOL_VCC141AMD64-PCH_CXXFLAGS.dbgopt = $(TOOL_VCC141AMD64_CXXFLAGS.dbgopt)
|
---|
234 | TOOL_VCC141AMD64-PCH_CXXFLAGS.release = $(TOOL_VCC141AMD64_CXXFLAGS.release)
|
---|
235 | TOOL_VCC141AMD64-PCH_CXXFLAGS.profile = $(TOOL_VCC141AMD64_CXXFLAGS.profile)
|
---|
236 | TOOL_VCC141AMD64-PCH_COMPILE_CXX_DEPEND = $(NO_SUCH_VARIABLE)
|
---|
237 | TOOL_VCC141AMD64-PCH_COMPILE_CXX_DEPORD = $(NO_SUCH_VARIABLE)
|
---|
238 | TOOL_VCC141AMD64-PCH_COMPILE_CXX_OUTPUT = $($(target)_1_VCC_PCH_FILE) $($(target)_1_VCC_COMMON_OBJ_PDB)
|
---|
239 | TOOL_VCC141AMD64-PCH_COMPILE_CXX_OUTPUT_MAYBE = $(NO_SUCH_VARIABLE)
|
---|
240 | ifdef 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
|
---|
252 | else
|
---|
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
|
---|
265 | endif # !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.
|
---|
283 | TOOL_VCC141AMD64_COMPILE_RC_DEPEND =
|
---|
284 | TOOL_VCC141AMD64_COMPILE_RC_DEPORD =
|
---|
285 | TOOL_VCC141AMD64_COMPILE_RC_OUTPUT =
|
---|
286 | define 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)))
|
---|
291 | endef
|
---|
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 | #
|
---|
304 | TOOL_VCC141AMD64_LINK_LIBRARY_DEPEND = $(othersrc)
|
---|
305 | TOOL_VCC141AMD64_LINK_LIBRARY_DEPORD =
|
---|
306 | TOOL_VCC141AMD64_LINK_LIBRARY_OUTPUT = $(outbase).rsp
|
---|
307 | TOOL_VCC141AMD64_LINK_LIBRARY_OUTPUT_MAYBE = $(outbase).lst $(outbase).exp $(outbase).pdb
|
---|
308 | define 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
|
---|
313 | endef
|
---|
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 | #
|
---|
330 | TOOL_VCC141AMD64_LINK_PROGRAM_DEPEND = $(foreachfile lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
|
---|
331 | TOOL_VCC141AMD64_LINK_PROGRAM_DEPORD =
|
---|
332 | TOOL_VCC141AMD64_LINK_PROGRAM_OUTPUT_MAYBE_PRECIOUS = $(outbase).map $(outbase).rsp
|
---|
333 | TOOL_VCC141AMD64_LINK_PROGRAM_OUTPUT_MAYBE = $(outbase).lib $(outbase).exp $(outbase).ilk $(out).manifest
|
---|
334 | TOOL_VCC141AMD64_LINK_PROGRAM_OUTPUT_DEBUG = $(outbase).pdb
|
---|
335 | TOOL_VCC141AMD64_LINK_PROGRAM_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
|
---|
336 | define 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
|
---|
347 | ifndef TOOL_VCC141AMD64_NO_AUTO_MANIFEST
|
---|
348 | $(QUIET)$(TEST) -f $(out).manifest -- \
|
---|
349 | $(TOOL_VCC141AMD64_MT) -manifest $(subst /,\\,$(out)).manifest -outputresource:$(subst /,\\,$(out))
|
---|
350 | endif
|
---|
351 | endef
|
---|
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.
|
---|
368 | TOOL_VCC141AMD64_LINK_DLL_DEPEND = $(foreachfile lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
|
---|
369 | TOOL_VCC141AMD64_LINK_DLL_DEPORD = $(call DIRDEP,$(PATH_STAGE_LIB))
|
---|
370 | TOOL_VCC141AMD64_LINK_DLL_OUTPUT = $(outbase).lib $(outbase).exp
|
---|
371 | TOOL_VCC141AMD64_LINK_DLL_OUTPUT_MAYBE = $(outbase).ilk $(out).manifest $(PATH_STAGE_LIB)/$(notdir $(outbase)).exp
|
---|
372 | TOOL_VCC141AMD64_LINK_DLL_OUTPUT_MAYBE_PRECIOUS = $(PATH_STAGE_LIB)/$(notdir $(outbase)).lib $(outbase).map $(outbase).rsp
|
---|
373 | TOOL_VCC141AMD64_LINK_DLL_OUTPUT_DEBUG = $(outbase).pdb
|
---|
374 | TOOL_VCC141AMD64_LINK_DLL_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
|
---|
375 | define 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
|
---|
388 | ifndef TOOL_VCC141AMD64_NO_AUTO_MANIFEST
|
---|
389 | $(QUIET)$(TEST) -f $(out).manifest -- \
|
---|
390 | $(TOOL_VCC141AMD64_MT) -manifest $(subst /,\\,$(out)).manifest '-outputresource:$(subst /,\\,$(out));#2'
|
---|
391 | endif
|
---|
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))
|
---|
395 | endef
|
---|
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.
|
---|
412 | TOOL_VCC141AMD64_LINK_SYSMOD_DEPEND = $(foreachfile lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
|
---|
413 | TOOL_VCC141AMD64_LINK_SYSMOD_DEPORD =
|
---|
414 | TOOL_VCC141AMD64_LINK_SYSMOD_OUTPUT_MAYBE = $(outbase).lib $(outbase).exp $(outbase).ilk $(out).manifest
|
---|
415 | TOOL_VCC141AMD64_LINK_SYSMOD_OUTPUT_MAYBE_PRECIOUS = $(outbase).map $(outbase).rsp
|
---|
416 | TOOL_VCC141AMD64_LINK_SYSMOD_OUTPUT_DEBUG = $(outbase).pdb
|
---|
417 | TOOL_VCC141AMD64_LINK_SYSMOD_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
|
---|
418 | define 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
|
---|
429 | ifndef TOOL_VCC141AMD64_NO_AUTO_MANIFEST
|
---|
430 | $(QUIET)$(TEST) -f $(out).manifest -- \
|
---|
431 | $(TOOL_VCC141AMD64_MT) -manifest $(subst /,\\,$(out)).manifest '-outputresource:$(subst /,\\,$(out));#2'
|
---|
432 | endif
|
---|
433 | endef
|
---|
434 |
|
---|