1 | # $Id: VCC142AMD64.kmk 3370 2020-06-10 10:45:05Z bird $
|
---|
2 | ## @file
|
---|
3 | # kBuild Tool Config - Visual C++ 14.2 (aka Visual 2019 and MSC v19.20), 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_VCC142
|
---|
35 | include $(KBUILD_PATH)/tools/VCC142.kmk
|
---|
36 | endif
|
---|
37 |
|
---|
38 | TOOL_VCC142AMD64 := Visual C++ 14.2 (aka Visual 2019 and MSC v19.20), targeting AMD64
|
---|
39 |
|
---|
40 | #
|
---|
41 | # Tool Specific Properties
|
---|
42 | #
|
---|
43 | ifndef PATH_TOOL_VCC142AMD64
|
---|
44 | PATH_TOOL_VCC142AMD64 := $(PATH_TOOL_VCC142)
|
---|
45 | else
|
---|
46 | # Resolve any fancy stuff once and for all.
|
---|
47 | PATH_TOOL_VCC142AMD64 := $(PATH_TOOL_VCC142AMD64)
|
---|
48 | endif
|
---|
49 |
|
---|
50 | ifndef PATH_TOOL_VCC142AMD64_BIN
|
---|
51 | PATH_TOOL_VCC142AMD64_BIN := $(PATH_TOOL_VCC142_HOST_BIN)/x64
|
---|
52 | else
|
---|
53 | PATH_TOOL_VCC142AMD64_BIN := $(PATH_TOOL_VCC142AMD64_BIN)
|
---|
54 | endif
|
---|
55 | PATH_TOOL_VCC142AMD64_BIN_QSH := $(requote sh,$(PATH_TOOL_VCC142AMD64_BIN))
|
---|
56 |
|
---|
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.
|
---|
58 | ifndef PATH_TOOL_VCC142AMD64_DLL_BIN
|
---|
59 | ifneq ($(PATH_TOOL_VCC142_HOST_DLL_BIN),$(PATH_TOOL_VCC142AMD64_BIN))
|
---|
60 | PATH_TOOL_VCC142AMD64_DLL_BIN := $(PATH_TOOL_VCC142_HOST_DLL_BIN)
|
---|
61 | endif
|
---|
62 | endif
|
---|
63 |
|
---|
64 | ifndef PATH_TOOL_VCC142AMD64_LIB
|
---|
65 | PATH_TOOL_VCC142AMD64_LIB := $(PATH_TOOL_VCC142_LIB.amd64)
|
---|
66 | endif
|
---|
67 | ifndef PATH_TOOL_VCC142_ONECORE_LIB
|
---|
68 | PATH_TOOL_VCC142_ONECORE_LIB := $(PATH_TOOL_VCC142_ONECORE_LIB.amd64)
|
---|
69 | endif
|
---|
70 |
|
---|
71 | ifndef PATH_TOOL_VCC142AMD64_INC
|
---|
72 | PATH_TOOL_VCC142AMD64_INC := $(PATH_TOOL_VCC142_INC)
|
---|
73 | endif
|
---|
74 |
|
---|
75 | ifndef PATH_TOOL_VCC142AMD64_ATLMFC_INC
|
---|
76 | PATH_TOOL_VCC142AMD64_ATLMFC_INC := $(PATH_TOOL_VCC142_ATLMFC_INC.amd64)
|
---|
77 | endif
|
---|
78 | ifndef PATH_TOOL_VCC142AMD64_ATLMFC_LIB
|
---|
79 | PATH_TOOL_VCC142AMD64_ATLMFC_LIB := $(PATH_TOOL_VCC142_ATLMFC_LIB.amd64)
|
---|
80 | endif
|
---|
81 |
|
---|
82 | TOOL_VCC142AMD64_CC ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC142AMD64_BIN_QSH)/cl.exe
|
---|
83 | TOOL_VCC142AMD64_CXX ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC142AMD64_BIN_QSH)/cl.exe
|
---|
84 | TOOL_VCC142AMD64_AS ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC142AMD64_BIN_QSH)/ml64.exe
|
---|
85 | #TOOL_VCC142AMD64_AR ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC142AMD64_BIN_QSH)/lib.exe - just an exec wrapper for the below
|
---|
86 | TOOL_VCC142AMD64_AR ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC142AMD64_BIN_QSH)/link.exe /LIB
|
---|
87 | TOOL_VCC142AMD64_LD ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC142AMD64_BIN_QSH)/link.exe
|
---|
88 | TOOL_VCC142AMD64_DUMPBIN ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC142AMD64_BIN_QSH)/dumpbin.exe
|
---|
89 | TOOL_VCC142AMD64_EDITBIN ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC142AMD64_BIN_QSH)/editbin.exe
|
---|
90 |
|
---|
91 | TOOL_VCC142AMD64_RC ?= $(EXEC_X86_WIN32) $(call TOOL_VCC142_FN_FIND_SDK_TOOL,rc.exe,[Rr][Cc].[Ee][Xx][Ee],TOOL_VCC142_RC_CACHED)
|
---|
92 | TOOL_VCC142AMD64_MT ?= $(EXEC_X86_WIN32) $(call TOOL_VCC142_FN_FIND_SDK_TOOL,mt.exe,[Mm][Tt].[Ee][Xx][Ee],TOOL_VCC142_MT_CACHED)
|
---|
93 |
|
---|
94 | ifdef TOOL_VCC142AMD64_USE_KSUBMIT
|
---|
95 | ifeq ($(KBUILD_HOST),win)
|
---|
96 | ifeq ($(findstring /HostX86/,$(PATH_TOOL_VCC142AMD64_BIN)),/HostX86/)
|
---|
97 | TOOL_VCC142AMD64_KSUBMIT ?= kmk_builtin_kSubmit --32-bit
|
---|
98 | else
|
---|
99 | TOOL_VCC142AMD64_KSUBMIT ?= kmk_builtin_kSubmit --64-bit
|
---|
100 | endif
|
---|
101 | ifdef PATH_TOOL_VCC142AMD64_DLL_BIN
|
---|
102 | TOOL_VCC142AMD64_KSUBMIT := $(TOOL_VCC142AMD64_KSUBMIT) --prepend "PATH=$(requote shell-in-dq,$(PATH_TOOL_VCC142AMD64_DLL_BIN));"
|
---|
103 | endif
|
---|
104 | TOOL_VCC142AMD64_KSUBMIT_DD := $(TOOL_VCC142AMD64_KSUBMIT) --
|
---|
105 | endif
|
---|
106 | endif
|
---|
107 | ifdef PATH_TOOL_VCC142AMD64_DLL_BIN
|
---|
108 | TOOL_VCC142AMD64_SETUP_ENV := $(REDIRECT) --prepend "PATH=$(requote shell-in-dq,$(PATH_TOOL_VCC142AMD64_DLL_BIN));" --$(SP)
|
---|
109 | ifndef TOOL_VCC142AMD64_KSUBMIT_DD
|
---|
110 | TOOL_VCC142AMD64_KSUBMIT_DD := $(TOOL_VCC142AMD64_SETUP_ENV)
|
---|
111 | endif
|
---|
112 | endif
|
---|
113 |
|
---|
114 | # Redist (more stuff in VCC142.kmk).
|
---|
115 | PATH_TOOL_VCC142AMD64_REDIST ?= $(PATH_TOOL_VCC142_REDIST)/x64
|
---|
116 | PATH_TOOL_VCC142AMD64_REDIST_CRT = $(PATH_TOOL_VCC142AMD64_REDIST)/$(TOOL_VCC142_REDIST_CRT_SUBDIR)
|
---|
117 | PATH_TOOL_VCC142AMD64_REDIST_DEBUG ?= $(PATH_TOOL_VCC142_REDIST_DEBUG)/x64
|
---|
118 | PATH_TOOL_VCC142AMD64_REDIST_DEBUG_CRT = $(PATH_TOOL_VCC142AMD64_REDIST_DEBUG)/$(TOOL_VCC142_REDIST_CRT_SUBDIR)
|
---|
119 | TOOL_VCC142AMD64_REDIST_CRT_DLLS = $(TOOL_VCC142_REDIST_CRT_DLLS.amd64)
|
---|
120 | TOOL_VCC142AMD64_REDIST_CONCRT_DLLS = $(TOOL_VCC142_REDIST_CONCRT_DLLS.amd64)
|
---|
121 | TOOL_VCC142AMD64_REDIST_CPP_DLLS = $(TOOL_VCC142_REDIST_CPP_DLLS.amd64)
|
---|
122 | TOOL_VCC142AMD64_REDIST_WINRT_DLLS = $(TOOL_VCC142_REDIST_WINRT_DLLS.amd64)
|
---|
123 |
|
---|
124 |
|
---|
125 | #
|
---|
126 | # Properties used by kBuild
|
---|
127 | #
|
---|
128 | TOOL_VCC142AMD64_COBJSUFF ?= .obj
|
---|
129 | TOOL_VCC142AMD64_CFLAGS ?= -TC -nologo -Zi -ZH:SHA_256
|
---|
130 | TOOL_VCC142AMD64_CFLAGS.debug ?=
|
---|
131 | TOOL_VCC142AMD64_CFLAGS.dbgopt ?= -O2
|
---|
132 | TOOL_VCC142AMD64_CFLAGS.release ?= -O2
|
---|
133 | TOOL_VCC142AMD64_CFLAGS.profile ?= -O2
|
---|
134 | TOOL_VCC142AMD64_CINCS ?= $(PATH_TOOL_VCC142AMD64_INC)
|
---|
135 | TOOL_VCC142AMD64_CDEFS ?=
|
---|
136 |
|
---|
137 | TOOL_VCC142AMD64_CXXOBJSUFF ?= .obj
|
---|
138 | TOOL_VCC142AMD64_CXXFLAGS ?= -TP -nologo -Zi -ZH:SHA_256
|
---|
139 | TOOL_VCC142AMD64_CXXFLAGS.debug ?=
|
---|
140 | TOOL_VCC142AMD64_CXXFLAGS.dbgopt ?= -O2
|
---|
141 | TOOL_VCC142AMD64_CXXFLAGS.release ?= -O2
|
---|
142 | TOOL_VCC142AMD64_CXXFLAGS.profile ?= -O2
|
---|
143 | TOOL_VCC142AMD64_CXXINCS ?= $(PATH_TOOL_VCC142AMD64_INC) $(PATH_TOOL_VCC142AMD64_ATLMFC_INC)
|
---|
144 | TOOL_VCC142AMD64_CXXDEFS ?=
|
---|
145 |
|
---|
146 | TOOL_VCC142AMD64_ASOBJSUFF ?= .obj
|
---|
147 |
|
---|
148 | TOOL_VCC142AMD64_RCOBJSUFF ?= .res
|
---|
149 | TOOL_VCC142AMD64_RCINCS ?= $(PATH_TOOL_VCC142AMD64_INC) $(PATH_TOOL_VCC142AMD64_ATLMFC_INC)
|
---|
150 |
|
---|
151 | TOOL_VCC142AMD64_ARFLAGS ?= -nologo -machine:amd64
|
---|
152 | TOOL_VCC142AMD64_ARLIBSUFF ?= .lib
|
---|
153 |
|
---|
154 | TOOL_VCC142AMD64_LDFLAGS ?= -nologo -machine:amd64
|
---|
155 | TOOL_VCC142AMD64_LDFLAGS.debug ?= -debug
|
---|
156 | TOOL_VCC142AMD64_LDFLAGS.dbgopt ?= -debug
|
---|
157 | TOOL_VCC142AMD64_LDFLAGS.profile ?= -debug
|
---|
158 | TOOL_VCC142AMD64_LDFLAGS.release ?=
|
---|
159 |
|
---|
160 |
|
---|
161 |
|
---|
162 | ## Compile C source.
|
---|
163 | # @param $(target) Normalized main target name.
|
---|
164 | # @param $(source) Source filename (relative).
|
---|
165 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
---|
166 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
---|
167 | # @param $(flags) Flags.
|
---|
168 | # @param $(defs) Definitions. No -D or something.
|
---|
169 | # @param $(incs) Includes. No -I or something.
|
---|
170 | # @param $(dirdep) Directory creation dependency.
|
---|
171 | # @param $(deps) Other dependencies.
|
---|
172 | #
|
---|
173 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
174 | # @param $(objsuff) Object suffix.
|
---|
175 | # @note The -d1scalableinclude- option disables include directory caching as the cache goes
|
---|
176 | # stale in kWorker. Besides, kWorker does it's own caching, so it is not necessary.
|
---|
177 | TOOL_VCC142AMD64_COMPILE_C_DEPEND =
|
---|
178 | TOOL_VCC142AMD64_COMPILE_C_DEPORD =
|
---|
179 | TOOL_VCC142AMD64_COMPILE_C_OUTPUT =
|
---|
180 | TOOL_VCC142AMD64_COMPILE_C_OUTPUT_MAYBE = $(call TOOL_VCC142_PDB, $(outbase)-obj,pdb) $(call TOOL_VCC142_PDB, $(outbase)-obj,idb)
|
---|
181 | ifdef TOOL_VCC142AMD64_KSUBMIT
|
---|
182 | TOOL_VCC142AMD64_COMPILE_C_DONT_PURGE_OUTPUT := 1 # speed
|
---|
183 | define TOOL_VCC142AMD64_COMPILE_C_CMDS
|
---|
184 | $(QUIET)$(TOOL_VCC142AMD64_KSUBMIT) -P $(DEP_OBJ_INT) -f -s -q -o $(dep) -t $(obj) $(obj)\
|
---|
185 | -- $(TOOL_VCC142AMD64_CC) -c -d1scalableinclude-\
|
---|
186 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
187 | -Fd$(outbase)-obj.pdb \
|
---|
188 | -Fo$(obj)\
|
---|
189 | $(subst /,\\,$(abspath $(source)))
|
---|
190 | endef
|
---|
191 | else
|
---|
192 | define TOOL_VCC142AMD64_COMPILE_C_CMDS
|
---|
193 | $(QUIET)$(TOOL_VCC142AMD64_SETUP_ENV)$(TOOL_VCC142AMD64_CC) -c\
|
---|
194 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
195 | -Fd$(outbase)-obj.pdb \
|
---|
196 | -Fo$(obj)\
|
---|
197 | $(subst /,\\,$(abspath $(source)))
|
---|
198 | $(QUIET)$(DEP_OBJ) -f -s -q -o $(dep) -t $(obj) $(obj)
|
---|
199 | endef
|
---|
200 | endif # !TOOL_VCC142AMD64_KSUBMIT
|
---|
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.
|
---|
216 | # @note The -d1scalableinclude- option disables include directory caching as the cache goes
|
---|
217 | # stale in kWorker. Besides, kWorker does it's own caching, so it is not necessary.
|
---|
218 | # ('-d1' means it's passed to c1.dll/c1xx.dll and 'scalableinclude-' is the actual option.)
|
---|
219 | TOOL_VCC142AMD64_COMPILE_CXX_DEPEND = $($(target)_1_VCC_PCH_FILE)
|
---|
220 | TOOL_VCC142AMD64_COMPILE_CXX_DEPORD =
|
---|
221 | TOOL_VCC142AMD64_COMPILE_CXX_OUTPUT =
|
---|
222 | TOOL_VCC142AMD64_COMPILE_CXX_OUTPUT_MAYBE = $(if-expr defined($(target)_1_VCC_COMMON_OBJ_PDB)\
|
---|
223 | ,,$(call TOOL_VCC142_PDB, $(outbase)-obj,pdb) $(call TOOL_VCC142_PDB, $(outbase)-obj,idb))
|
---|
224 | ifdef TOOL_VCC142AMD64_KSUBMIT
|
---|
225 | TOOL_VCC142AMD64_COMPILE_CXX_DONT_PURGE_OUTPUT := 1 # speed
|
---|
226 | define TOOL_VCC142AMD64_COMPILE_CXX_CMDS
|
---|
227 | $(QUIET)$(TOOL_VCC142AMD64_KSUBMIT) -P $(DEP_OBJ_INT) -f -s -q -o $(dep) -t $(obj) $(obj)\
|
---|
228 | -- $(TOOL_VCC142AMD64_CXX) -c -d1scalableinclude-\
|
---|
229 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
230 | $(if-expr defined($(target)_PCH_HDR)\
|
---|
231 | ,-FI$($(target)_PCH_HDR) -Yu$($(target)_PCH_HDR) -Fp$($(target)_1_VCC_PCH_FILE) -FS,)\
|
---|
232 | -Fd$(if-expr defined($(target)_1_VCC_COMMON_OBJ_PDB),$($(target)_1_VCC_COMMON_OBJ_PDB),$(outbase)-obj.pdb) \
|
---|
233 | -Fo$(obj)\
|
---|
234 | $(subst /,\\,$(abspath $(source)))
|
---|
235 | endef
|
---|
236 | else
|
---|
237 | define TOOL_VCC142AMD64_COMPILE_CXX_CMDS
|
---|
238 | $(QUIET)$(TOOL_VCC142AMD64_SETUP_ENV)$(TOOL_VCC142AMD64_CXX) -c\
|
---|
239 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
240 | $(if-expr defined($(target)_PCH_HDR)\
|
---|
241 | ,-FI$($(target)_PCH_HDR) -Yu$($(target)_PCH_HDR) -Fp$($(target)_1_VCC_PCH_FILE) -FS,)\
|
---|
242 | -Fd$(if-expr defined($(target)_1_VCC_COMMON_OBJ_PDB),$($(target)_1_VCC_COMMON_OBJ_PDB),$(outbase)-obj.pdb) \
|
---|
243 | -Fo$(obj)\
|
---|
244 | $(subst /,\\,$(abspath $(source)))
|
---|
245 | $(QUIET)$(DEP_OBJ) -f -s -q -o $(dep) -t $(obj) $(obj)
|
---|
246 | endef
|
---|
247 | endif # !TOOL_VCC142AMD64_KSUBMIT
|
---|
248 |
|
---|
249 |
|
---|
250 | #
|
---|
251 | # Helper tool for creating the precompiled C++ header.
|
---|
252 | #
|
---|
253 | # It only have the C++ compile bits and it's purpose is to skip bits
|
---|
254 | # related _1_VCC_PCH_FILE and add -Yc.
|
---|
255 | #
|
---|
256 | TOOL_VCC142AMD64-PCH := Helper for creating precompiled header using CXX handling.
|
---|
257 | TOOL_VCC142AMD64-PCH_EXTENDS := VCC142AMD64
|
---|
258 | TOOL_VCC142AMD64-PCH_CXXOBJSUFF := .obj
|
---|
259 | TOOL_VCC142AMD64-PCH_CXXINCS = $(TOOL_VCC142AMD64_CXXINCS)
|
---|
260 | TOOL_VCC142AMD64-PCH_CXXFLAGS = $(TOOL_VCC142AMD64_CXXFLAGS) -FS
|
---|
261 | TOOL_VCC142AMD64-PCH_CXXFLAGS.debug = $(TOOL_VCC142AMD64_CXXFLAGS.debug)
|
---|
262 | TOOL_VCC142AMD64-PCH_CXXFLAGS.dbgopt = $(TOOL_VCC142AMD64_CXXFLAGS.dbgopt)
|
---|
263 | TOOL_VCC142AMD64-PCH_CXXFLAGS.release = $(TOOL_VCC142AMD64_CXXFLAGS.release)
|
---|
264 | TOOL_VCC142AMD64-PCH_CXXFLAGS.profile = $(TOOL_VCC142AMD64_CXXFLAGS.profile)
|
---|
265 | TOOL_VCC142AMD64-PCH_COMPILE_CXX_DEPEND = $(NO_SUCH_VARIABLE)
|
---|
266 | TOOL_VCC142AMD64-PCH_COMPILE_CXX_DEPORD = $(NO_SUCH_VARIABLE)
|
---|
267 | TOOL_VCC142AMD64-PCH_COMPILE_CXX_OUTPUT = $($(target)_1_VCC_PCH_FILE) $($(target)_1_VCC_COMMON_OBJ_PDB)
|
---|
268 | TOOL_VCC142AMD64-PCH_COMPILE_CXX_OUTPUT_MAYBE = $(NO_SUCH_VARIABLE)
|
---|
269 | ifdef TOOL_VCC142AMD64_KSUBMIT
|
---|
270 | define TOOL_VCC142AMD64-PCH_COMPILE_CXX_CMDS
|
---|
271 | $(QUIET)$(RM) -f -- $($(target)_1_VCC_PCH_FILE) $($(target)_1_VCC_COMMON_OBJ_PDB)
|
---|
272 | $(QUIET)$(TOOL_VCC142AMD64_KSUBMIT) --no-pch-caching -P $(DEP_OBJ_INT) -f -s -q -e .pch -o $(dep) -t $(obj) $(obj)\
|
---|
273 | -- $(TOOL_VCC142AMD64_CXX) -c -Yc -d1scalableinclude-\
|
---|
274 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
275 | -Fp$($(target)_1_VCC_PCH_FILE) \
|
---|
276 | -Fd$($(target)_1_VCC_COMMON_OBJ_PDB) \
|
---|
277 | -Fo$(obj)\
|
---|
278 | -TP \
|
---|
279 | $(subst /,\\,$(abspath $(source)))
|
---|
280 | endef
|
---|
281 | else
|
---|
282 | define TOOL_VCC142AMD64-PCH_COMPILE_CXX_CMDS
|
---|
283 | $(QUIET)$(RM) -f -- $($(target)_1_VCC_PCH_FILE) $($(target)_1_VCC_COMMON_OBJ_PDB)
|
---|
284 | $(QUIET)$(TOOL_VCC142AMD64_SETUP_ENV)$(TOOL_VCC142AMD64_CXX) -c -Yc\
|
---|
285 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
286 | -Fp$($(target)_1_VCC_PCH_FILE) \
|
---|
287 | -Fd$($(target)_1_VCC_COMMON_OBJ_PDB) \
|
---|
288 | -Fo$(obj)\
|
---|
289 | -TP \
|
---|
290 | $(subst /,\\,$(abspath $(source)))
|
---|
291 | $(QUIET)$(DEP_OBJ) -f -s -q -e .pch -o $(dep) -t $(obj) $(obj)
|
---|
292 |
|
---|
293 | endef
|
---|
294 | endif # !TOOL_VCC142AMD64_KSUBMIT
|
---|
295 |
|
---|
296 |
|
---|
297 | ## @todo configure the assembler template.
|
---|
298 |
|
---|
299 | ## Compile resource source.
|
---|
300 | # @param $(target) Normalized main target name.
|
---|
301 | # @param $(source) Source filename (relative).
|
---|
302 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
---|
303 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
---|
304 | # @param $(flags) Flags.
|
---|
305 | # @param $(defs) Definitions. No -D or something.
|
---|
306 | # @param $(incs) Includes. No -I or something.
|
---|
307 | # @param $(dirdep) Directory creation dependency.
|
---|
308 | # @param $(deps) Other dependencies.
|
---|
309 | #
|
---|
310 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
311 | # @param $(objsuff) Object suffix.
|
---|
312 | TOOL_VCC142AMD64_COMPILE_RC_DEPEND =
|
---|
313 | TOOL_VCC142AMD64_COMPILE_RC_DEPORD =
|
---|
314 | TOOL_VCC142AMD64_COMPILE_RC_OUTPUT =
|
---|
315 | define TOOL_VCC142AMD64_COMPILE_RC_CMDS
|
---|
316 | $(QUIET)$(TOOL_VCC142AMD64_RC) \
|
---|
317 | $(flags) $(qaddprefix sh,/i, $(subst /,\\,$(incs))) $(qaddprefix sh,/d, $(defs))\
|
---|
318 | /fo$(obj)\
|
---|
319 | $(subst /,\\,$(abspath $(source)))
|
---|
320 | endef
|
---|
321 |
|
---|
322 |
|
---|
323 | ## Link library
|
---|
324 | # @param $(target) Normalized main target name.
|
---|
325 | # @param $(out) Library name.
|
---|
326 | # @param $(objs) Object files to put in the library.
|
---|
327 | # @param $(flags) Flags.
|
---|
328 | # @param $(dirdep) Directory creation dependency.
|
---|
329 | # @param $(deps) Other dependencies.
|
---|
330 | # @param $(othersrc) Unhandled sources.
|
---|
331 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
332 | #
|
---|
333 | TOOL_VCC142AMD64_LINK_LIBRARY_DEPEND = $(othersrc)
|
---|
334 | TOOL_VCC142AMD64_LINK_LIBRARY_DEPORD =
|
---|
335 | TOOL_VCC142AMD64_LINK_LIBRARY_OUTPUT = $(outbase).rsp
|
---|
336 | TOOL_VCC142AMD64_LINK_LIBRARY_OUTPUT_MAYBE = $(outbase).lst $(outbase).exp $(outbase).pdb
|
---|
337 | define TOOL_VCC142AMD64_LINK_LIBRARY_CMDS
|
---|
338 | $(QUIET)$(APPEND) -tn $(outbase).rsp \
|
---|
339 | $(qforeachfile u,arg, $(objs) $(filter-out %.def,$(othersrc)),$(quote-sh "$(subst /,\,$(arg))")) \
|
---|
340 | $(qforeachfile u,arg, $(filter %.def,$(othersrc)),$(quote-sh "/DEF:$(subst /,\,$(arg))"))
|
---|
341 | $(QUIET)$(TOOL_VCC142AMD64_KSUBMIT_DD) $(TOOL_VCC142AMD64_AR) $(flags) /OUT:$(out) @$(outbase).rsp
|
---|
342 | endef
|
---|
343 |
|
---|
344 |
|
---|
345 | ## Link program
|
---|
346 | # @param $(target) Normalized main target name.
|
---|
347 | # @param $(out) Program name.
|
---|
348 | # @param $(objs) Object files to link together.
|
---|
349 | # @param $(libs) Libraries to search.
|
---|
350 | # @param $(libpath) Library search paths.
|
---|
351 | # @param $(flags) Flags.
|
---|
352 | # @param $(dirdep) Directory creation dependency.
|
---|
353 | # @param $(deps) Other dependencies.
|
---|
354 | # @param $(othersrc) Unhandled sources.
|
---|
355 | # @param $(custom_pre) Custom step invoked before linking.
|
---|
356 | # @param $(custom_post) Custom step invoked after linking.
|
---|
357 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
358 | #
|
---|
359 | TOOL_VCC142AMD64_LINK_PROGRAM_DEPEND = $(foreachfile lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
|
---|
360 | TOOL_VCC142AMD64_LINK_PROGRAM_DEPORD =
|
---|
361 | TOOL_VCC142AMD64_LINK_PROGRAM_OUTPUT_MAYBE_PRECIOUS = $(outbase).map $(outbase).rsp
|
---|
362 | TOOL_VCC142AMD64_LINK_PROGRAM_OUTPUT_MAYBE = $(outbase).lib $(outbase).exp $(outbase).ilk $(out).manifest
|
---|
363 | TOOL_VCC142AMD64_LINK_PROGRAM_OUTPUT_DEBUG = $(outbase).pdb
|
---|
364 | TOOL_VCC142AMD64_LINK_PROGRAM_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
|
---|
365 | define TOOL_VCC142AMD64_LINK_PROGRAM_CMDS
|
---|
366 | $(QUIET)$(APPEND) -tn $(outbase).rsp \
|
---|
367 | $(qforeachfile u,arg, $(objs) $(libs),$(quote-sh "$(subst /,\,$(arg))"))
|
---|
368 | $(QUIET)$(TOOL_VCC142AMD64_KSUBMIT_DD) $(TOOL_VCC142AMD64_LD) $(flags) \
|
---|
369 | /OUT:$(out) \
|
---|
370 | /MAPINFO:EXPORTS /INCREMENTAL:NO \
|
---|
371 | /MAP:$(outbase).map \
|
---|
372 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
|
---|
373 | $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
|
---|
374 | $(qaddprefix sh,/LIBPATH:,$(libpath)) \
|
---|
375 | @$(outbase).rsp
|
---|
376 | ifndef TOOL_VCC142AMD64_NO_AUTO_MANIFEST
|
---|
377 | $(QUIET)$(TEST) -f $(out).manifest -- \
|
---|
378 | $(TOOL_VCC142AMD64_MT) -manifest $(subst /,\\,$(out)).manifest -outputresource:$(subst /,\\,$(out))
|
---|
379 | endif
|
---|
380 | endef
|
---|
381 |
|
---|
382 |
|
---|
383 | ## Link DLL.
|
---|
384 | # @param $(target) Normalized main target name.
|
---|
385 | # @param $(out) DLL name.
|
---|
386 | # @param $(objs) Object files to link together.
|
---|
387 | # @param $(libs) Libraries to search.
|
---|
388 | # @param $(libpath) Library search paths.
|
---|
389 | # @param $(flags) Flags.
|
---|
390 | # @param $(dirdep) Directory creation dependency.
|
---|
391 | # @param $(deps) Other dependencies.
|
---|
392 | # @param $(othersrc) Unhandled sources.
|
---|
393 | # @param $(custom_pre) Custom step invoked before linking.
|
---|
394 | # @param $(custom_post) Custom step invoked after linking.
|
---|
395 | #
|
---|
396 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
397 | TOOL_VCC142AMD64_LINK_DLL_DEPEND = $(foreachfile lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
|
---|
398 | TOOL_VCC142AMD64_LINK_DLL_DEPORD = $(call DIRDEP,$(PATH_STAGE_LIB))
|
---|
399 | TOOL_VCC142AMD64_LINK_DLL_OUTPUT = $(outbase).lib $(outbase).exp
|
---|
400 | TOOL_VCC142AMD64_LINK_DLL_OUTPUT_MAYBE = $(outbase).ilk $(out).manifest $(PATH_STAGE_LIB)/$(notdir $(outbase)).exp
|
---|
401 | TOOL_VCC142AMD64_LINK_DLL_OUTPUT_MAYBE_PRECIOUS = $(PATH_STAGE_LIB)/$(notdir $(outbase)).lib $(outbase).map $(outbase).rsp
|
---|
402 | TOOL_VCC142AMD64_LINK_DLL_OUTPUT_DEBUG = $(outbase).pdb
|
---|
403 | TOOL_VCC142AMD64_LINK_DLL_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
|
---|
404 | define TOOL_VCC142AMD64_LINK_DLL_CMDS
|
---|
405 | $(QUIET)$(APPEND) -tn $(outbase).rsp \
|
---|
406 | $(qforeachfile u,arg, $(objs) $(libs),$(quote-sh "$(subst /,\,$(arg))"))
|
---|
407 | $(QUIET)$(TOOL_VCC142AMD64_KSUBMIT_DD) $(TOOL_VCC142AMD64_LD) $(flags) \
|
---|
408 | /OUT:$(out) \
|
---|
409 | /IMPLIB:$(outbase).lib \
|
---|
410 | /MAPINFO:EXPORTS /INCREMENTAL:NO \
|
---|
411 | /MAP:$(outbase).map \
|
---|
412 | /DLL \
|
---|
413 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
|
---|
414 | $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
|
---|
415 | $(qaddprefix sh,/LIBPATH:,$(libpath)) \
|
---|
416 | @$(outbase).rsp
|
---|
417 | ifndef TOOL_VCC142AMD64_NO_AUTO_MANIFEST
|
---|
418 | $(QUIET)$(TEST) -f $(out).manifest -- \
|
---|
419 | $(TOOL_VCC142AMD64_MT) -manifest $(subst /,\\,$(out)).manifest '-outputresource:$(subst /,\\,$(out));#2'
|
---|
420 | endif
|
---|
421 | $(QUIET)$(TEST) -f $(outbase).lib -- $(KLIBTWEAKER_EXT) --clear-timestamps $(outbase).lib
|
---|
422 | $(QUIET)$(CP) --changed -v --ignore-non-existing $(outbase).exp $(outbase).lib $(PATH_STAGE_LIB)/
|
---|
423 | $(eval _DIRS += $(PATH_STAGE_LIB))
|
---|
424 | endef
|
---|
425 |
|
---|
426 |
|
---|
427 | ## Link system module (windows aka driver, linux aka kernel module)
|
---|
428 | # @param $(target) Normalized main target name.
|
---|
429 | # @param $(out) System module name.
|
---|
430 | # @param $(objs) Object files to link together.
|
---|
431 | # @param $(libs) Libraries to search.
|
---|
432 | # @param $(libpath) Library search paths.
|
---|
433 | # @param $(flags) Flags.
|
---|
434 | # @param $(dirdep) Directory creation dependency.
|
---|
435 | # @param $(deps) Other dependencies.
|
---|
436 | # @param $(othersrc) Unhandled sources.
|
---|
437 | # @param $(custom_pre) Custom step invoked before linking.
|
---|
438 | # @param $(custom_post) Custom step invoked after linking.
|
---|
439 | #
|
---|
440 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
441 | TOOL_VCC142AMD64_LINK_SYSMOD_DEPEND = $(foreachfile lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
|
---|
442 | TOOL_VCC142AMD64_LINK_SYSMOD_DEPORD =
|
---|
443 | TOOL_VCC142AMD64_LINK_SYSMOD_OUTPUT_MAYBE = $(outbase).lib $(outbase).exp $(outbase).ilk $(out).manifest
|
---|
444 | TOOL_VCC142AMD64_LINK_SYSMOD_OUTPUT_MAYBE_PRECIOUS = $(outbase).map $(outbase).rsp
|
---|
445 | TOOL_VCC142AMD64_LINK_SYSMOD_OUTPUT_DEBUG = $(outbase).pdb
|
---|
446 | TOOL_VCC142AMD64_LINK_SYSMOD_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
|
---|
447 | define TOOL_VCC142AMD64_LINK_SYSMOD_CMDS
|
---|
448 | $(QUIET)$(APPEND) -tn $(outbase).rsp \
|
---|
449 | $(qforeachfile u,arg, $(objs) $(libs),$(quote-sh "$(subst /,\,$(arg))"))
|
---|
450 | $(QUIET)$(TOOL_VCC142AMD64_KSUBMIT_DD) $(TOOL_VCC142AMD64_LD) $(flags) \
|
---|
451 | /OUT:$(out) \
|
---|
452 | /MAPINFO:EXPORTS /INCREMENTAL:NO \
|
---|
453 | /MAP:$(outbase).map \
|
---|
454 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
|
---|
455 | $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
|
---|
456 | $(qaddprefix sh,/LIBPATH:,$(libpath)) \
|
---|
457 | @$(outbase).rsp
|
---|
458 | ifndef TOOL_VCC142AMD64_NO_AUTO_MANIFEST
|
---|
459 | $(QUIET)$(TEST) -f $(out).manifest -- \
|
---|
460 | $(TOOL_VCC142AMD64_MT) -manifest $(subst /,\\,$(out)).manifest '-outputresource:$(subst /,\\,$(out));#2'
|
---|
461 | endif
|
---|
462 | endef
|
---|
463 |
|
---|