1 | # $Id: VCC141.kmk 3325 2020-04-17 02:02:23Z 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 | TOOL_VCC141 := Visual C++ 14.1 (aka Visual 2017 and MSC v19.1), targeting $(KBUILD_TARGET).
|
---|
35 |
|
---|
36 | ifndef INCLUDED_WIN_COMMON_KMK
|
---|
37 | include $(KBUILD_PATH)/win-common.kmk
|
---|
38 | endif
|
---|
39 |
|
---|
40 | #
|
---|
41 | # Tool Specific Properties
|
---|
42 | #
|
---|
43 | ifndef PATH_TOOL_VCC141
|
---|
44 | PATH_TOOL_VCC141 := $(firstfile $(rsortfiles $(qwildcard ,$(KBUILD_DEVTOOLS)/win.amd64/vcc/v141*)))
|
---|
45 | ifeq ($(PATH_TOOL_VCC141),)
|
---|
46 | PATH_TOOL_VCC141 := $(firstfile $(rsortfiles $(qwildcard ,$(KBUILD_DEVTOOLS)/win.x86/vcc/v141*)))
|
---|
47 | endif
|
---|
48 | ifeq ($(PATH_TOOL_VCC141),)
|
---|
49 | PATH_TOOL_VCC141 := $(PATH_TOOL_VCC141X86)
|
---|
50 | endif
|
---|
51 | ifeq ($(PATH_TOOL_VCC141),)
|
---|
52 | PATH_TOOL_VCC141 := $(PATH_TOOL_VCC141)
|
---|
53 | endif
|
---|
54 | ifeq ($(PATH_TOOL_VCC141),)
|
---|
55 | PATH_TOOL_VCC141 := $(firstfile $(rsortfiles $(qwildcard ,$(KBUILD_DEVTOOLS)/win.x86/vcc/v141*)))
|
---|
56 | ifeq ($(PATH_TOOL_VCC141),)
|
---|
57 | PATH_TOOL_VCC141 := $(firstfile $(foreach ver,2017 2019,$(foreachfile progfilesdir,$(WINCMN_PROGRAM_FILES_LIST)\
|
---|
58 | , $(rsortfiles $(qwildcard ,$(progfilesdir)/Microsoft\ Visual\ Studio/$(ver)/BuildTools/VC/Tools/MSVC/14.1?.*)))))
|
---|
59 | ifeq ($(PATH_TOOL_VCC141),)
|
---|
60 | $(warning kBuild: PATH_TOOL_VCC141 cannot be determined!)
|
---|
61 | PATH_TOOL_VCC141 := $(KBUILD_DEVTOOLS)/win.x86/vcc/v141
|
---|
62 | endif
|
---|
63 | endif
|
---|
64 | endif
|
---|
65 | else
|
---|
66 | # Resolve any fancy stuff once and for all.
|
---|
67 | PATH_TOOL_VCC141 := $(PATH_TOOL_VCC141)
|
---|
68 | endif
|
---|
69 |
|
---|
70 | ifndef PATH_TOOL_VCC141_BASE_BIN
|
---|
71 | PATH_TOOL_VCC141_BASE_BIN := $(PATH_TOOL_VCC141)/bin
|
---|
72 | endif
|
---|
73 | ifndef PATH_TOOL_VCC141_HOST_BIN
|
---|
74 | PATH_TOOL_VCC141_HOST_BIN := $(PATH_TOOL_VCC141_BASE_BIN)/Host$(WINCMN_MAP_ARCH.$(KBUILD_HOST_ARCH))
|
---|
75 | endif
|
---|
76 | ifndef PATH_TOOL_VCC141_BIN
|
---|
77 | PATH_TOOL_VCC141_BIN := $(PATH_TOOL_VCC141_HOST_BIN)/$(WINCMN_MAP_ARCH.$(KBUILD_TARGET_ARCH))
|
---|
78 | endif
|
---|
79 | PATH_TOOL_VCC141_BIN_QSH := $(requote sh,$(PATH_TOOL_VCC141_BIN))
|
---|
80 |
|
---|
81 | PATH_TOOL_VCC141_LIB.amd64 ?= $(PATH_TOOL_VCC141)/lib/x64
|
---|
82 | PATH_TOOL_VCC141_LIB.arm32 ?= $(PATH_TOOL_VCC141)/lib/arm
|
---|
83 | PATH_TOOL_VCC141_LIB.arm64 ?= $(PATH_TOOL_VCC141)/lib/arm64
|
---|
84 | PATH_TOOL_VCC141_LIB.x86 ?= $(PATH_TOOL_VCC141)/lib/x86
|
---|
85 |
|
---|
86 | PATH_TOOL_VCC141_ONECORE_LIB.amd64 ?= $(PATH_TOOL_VCC141)/lib/onecore/x64
|
---|
87 | PATH_TOOL_VCC141_ONECORE_LIB.arm32 ?= $(PATH_TOOL_VCC141)/lib/onecore/arm
|
---|
88 | PATH_TOOL_VCC141_ONECORE_LIB.arm64 ?= $(PATH_TOOL_VCC141)/lib/onecore/arm64
|
---|
89 | PATH_TOOL_VCC141_ONECORE_LIB.x86 ?= $(PATH_TOOL_VCC141)/lib/onecore/x86
|
---|
90 |
|
---|
91 | PATH_TOOL_VCC141_INC ?= $(PATH_TOOL_VCC141)/include
|
---|
92 |
|
---|
93 | PATH_TOOL_VCC141_ATLMFC ?= $(PATH_TOOL_VCC141)/atlmfc
|
---|
94 | PATH_TOOL_VCC141_ATLMFC_INC ?= $(PATH_TOOL_VCC141_ATLMFC)/include
|
---|
95 | PATH_TOOL_VCC141_ATLMFC_LIB.x86 ?= $(PATH_TOOL_VCC141_ATLMFC)/lib/x86
|
---|
96 | PATH_TOOL_VCC141_ATLMFC_LIB.amd64 ?= $(PATH_TOOL_VCC141_ATLMFC)/lib/x64
|
---|
97 |
|
---|
98 | TOOL_VCC141_CC ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC141_BIN_QSH)/cl.exe
|
---|
99 | TOOL_VCC141_CXX ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC141_BIN_QSH)/cl.exe
|
---|
100 | TOOL_VCC141_AS ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC141_BIN_QSH)/ml64.exe
|
---|
101 | #TOOL_VCC141_AR ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC141_BIN_QSH)/lib.exe - just an exec wrapper for the below
|
---|
102 | TOOL_VCC141_AR ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC141_BIN_QSH)/link.exe /LIB
|
---|
103 | TOOL_VCC141_LD ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC141_BIN_QSH)/link.exe
|
---|
104 | TOOL_VCC141_DUMPBIN ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC141_BIN_QSH)/dumpbin.exe
|
---|
105 | TOOL_VCC141_EDITBIN ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC141_BIN_QSH)/editbin.exe
|
---|
106 |
|
---|
107 | TOOL_VCC141_RC ?= $(EXEC_X86_WIN32) $(call TOOL_VCC141_FN_FIND_SDK_TOOL,rc.exe,[Rr][Cc].[Ee][Xx][Ee],TOOL_VCC141_RC_CACHED)
|
---|
108 | TOOL_VCC141_MT ?= $(EXEC_X86_WIN32) $(call TOOL_VCC141_FN_FIND_SDK_TOOL,mt.exe,[Mm][Tt].[Ee][Xx][Ee],TOOL_VCC141_MT_CACHED)
|
---|
109 |
|
---|
110 | undefine TOOL_VCC141_USE_KSUBMIT # for now
|
---|
111 | ifdef TOOL_VCC141_USE_KSUBMIT
|
---|
112 | ifeq ($(KBUILD_HOST),win)
|
---|
113 | ifneq ($(substr $(qdir un,$(PATH_TOOL_VCC141_BIN)),-3),64/)
|
---|
114 | TOOL_VCC141_KSUBMIT ?= kmk_builtin_kSubmit --64-bit
|
---|
115 | TOOL_VCC141_KSUBMIT_DD = $(TOOL_VCC141_KSUBMIT) --
|
---|
116 | else
|
---|
117 | TOOL_VCC141_KSUBMIT ?= kmk_builtin_kSubmit --32-bit
|
---|
118 | TOOL_VCC141_KSUBMIT_DD = $(TOOL_VCC141_KSUBMIT) --
|
---|
119 | endif
|
---|
120 | endif
|
---|
121 | endif
|
---|
122 |
|
---|
123 | ## Helper for finding rc.exe and mt.exe in the SDK.
|
---|
124 | TOOL_VCC141_FN_FIND_SDK_TOOL_SUB = $(eval $3 := $(firstfile \
|
---|
125 | $(if-expr defined(PATH_SDK_WINSDK10_BIN) , $(qwildcard ,$(PATH_SDK_WINSDK10_BIN)/$2)) \
|
---|
126 | $(if-expr defined(PATH_SDK_WINPSDK71_BIN), $(qwildcard ,$(PATH_SDK_WINPSDK71_BIN)/$2)) \
|
---|
127 | $(if-expr defined(PATH_SDK_WINPSDK_BIN) , $(qwildcard ,$(PATH_SDK_WINPSDK_BIN)/$2)) \
|
---|
128 | $(rsortfiles $(qwildcard ,$(KBUILD_DEVTOOLS_HST)/sdk/*/[Bb][Ii][Nn]/$2)) \
|
---|
129 | $(rsortfiles $(qwildcard ,$(KBUILD_DEVTOOLS_HST_ALT)/sdk/*/[Bb][Ii][Nn]/$2)) \
|
---|
130 | $1))
|
---|
131 | TOOL_VCC141_FN_FIND_SDK_TOOL = $(if-expr !defined($3),$(TOOL_VCC141_FN_FIND_SDK_TOOL_SUB),)$($3)
|
---|
132 |
|
---|
133 | ## Constructs the correct .pdb name (the name is lowercased).
|
---|
134 | # @param $(1) Base name, no extention.
|
---|
135 | # @param $(2) The extension.
|
---|
136 | TOOL_VCC141_PDB = $(dir $(1))$(tolower $(notdir $(1))).$(2)
|
---|
137 |
|
---|
138 |
|
---|
139 | #
|
---|
140 | # Properties used by kBuild
|
---|
141 | #
|
---|
142 | TOOL_VCC141_COBJSUFF ?= .obj
|
---|
143 | TOOL_VCC141_CFLAGS ?= -TC -nologo -Zi -ZH:SHA_256
|
---|
144 | TOOL_VCC141_CFLAGS.debug ?=
|
---|
145 | TOOL_VCC141_CFLAGS.dbgopt ?= -O2
|
---|
146 | TOOL_VCC141_CFLAGS.release ?= -O2
|
---|
147 | TOOL_VCC141_CFLAGS.profile ?= -O2
|
---|
148 | TOOL_VCC141_CINCS ?= $(PATH_TOOL_VCC141_INC)
|
---|
149 | TOOL_VCC141_CDEFS ?=
|
---|
150 |
|
---|
151 | TOOL_VCC141_CXXOBJSUFF ?= .obj
|
---|
152 | TOOL_VCC141_CXXFLAGS ?= -TP -nologo -Zi -ZH:SHA_256
|
---|
153 | TOOL_VCC141_CXXFLAGS.debug ?=
|
---|
154 | TOOL_VCC141_CXXFLAGS.dbgopt ?= -O2
|
---|
155 | TOOL_VCC141_CXXFLAGS.release ?= -O2
|
---|
156 | TOOL_VCC141_CXXFLAGS.profile ?= -O2
|
---|
157 | TOOL_VCC141_CXXINCS ?= $(PATH_TOOL_VCC141_INC) $(PATH_TOOL_VCC141_ATLMFC_INC)
|
---|
158 | TOOL_VCC141_CXXDEFS ?=
|
---|
159 |
|
---|
160 | TOOL_VCC141_ASOBJSUFF ?= .obj
|
---|
161 |
|
---|
162 | TOOL_VCC141_RCOBJSUFF ?= .res
|
---|
163 | TOOL_VCC141_RCINCS ?= $(PATH_TOOL_VCC141_INC) $(PATH_TOOL_VCC141_ATLMFC_INC)
|
---|
164 |
|
---|
165 | TOOL_VCC141_ARFLAGS ?= -nologo
|
---|
166 | TOOL_VCC141_ARFLAGS.x86 ?= -machine:x86
|
---|
167 | TOOL_VCC141_ARFLAGS.amd64 ?= -machine:amd64
|
---|
168 | TOOL_VCC141_ARFLAGS.arm32 ?= -machine:arm
|
---|
169 | TOOL_VCC141_ARLIBSUFF ?= .lib
|
---|
170 |
|
---|
171 | TOOL_VCC141_LDFLAGS ?= -nologo
|
---|
172 | TOOL_VCC141_LDFLAGS.x86 ?= -machine:x86
|
---|
173 | TOOL_VCC141_LDFLAGS.amd64 ?= -machine:amd64
|
---|
174 | TOOL_VCC141_LDFLAGS.arm32 ?= -machine:arm
|
---|
175 | TOOL_VCC141_LDFLAGS.debug ?= -debug
|
---|
176 | TOOL_VCC141_LDFLAGS.dbgopt ?= -debug
|
---|
177 | TOOL_VCC141_LDFLAGS.profile ?= -debug
|
---|
178 | TOOL_VCC141_LDFLAGS.release ?=
|
---|
179 |
|
---|
180 |
|
---|
181 |
|
---|
182 | ## Compile C source.
|
---|
183 | # @param $(target) Normalized main target name.
|
---|
184 | # @param $(source) Source filename (relative).
|
---|
185 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
---|
186 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
---|
187 | # @param $(flags) Flags.
|
---|
188 | # @param $(defs) Definitions. No -D or something.
|
---|
189 | # @param $(incs) Includes. No -I or something.
|
---|
190 | # @param $(dirdep) Directory creation dependency.
|
---|
191 | # @param $(deps) Other dependencies.
|
---|
192 | #
|
---|
193 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
194 | # @param $(objsuff) Object suffix.
|
---|
195 | TOOL_VCC141_COMPILE_C_DEPEND =
|
---|
196 | TOOL_VCC141_COMPILE_C_DEPORD =
|
---|
197 | TOOL_VCC141_COMPILE_C_OUTPUT =
|
---|
198 | TOOL_VCC141_COMPILE_C_OUTPUT_MAYBE = $(call TOOL_VCC141_PDB, $(outbase)-obj,pdb) $(call TOOL_VCC141_PDB, $(outbase)-obj,idb)
|
---|
199 | ifdef TOOL_VCC141_KSUBMIT
|
---|
200 | TOOL_VCC141_COMPILE_C_DONT_PURGE_OUTPUT := 1 # speed
|
---|
201 | define TOOL_VCC141_COMPILE_C_CMDS
|
---|
202 | $(QUIET)$(TOOL_VCC141_KSUBMIT) -P $(DEP_OBJ_INT) -f -s -q -o $(dep) -t $(obj) $(obj)\
|
---|
203 | -- $(TOOL_VCC141_CC) -c\
|
---|
204 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
205 | -Fd$(outbase)-obj.pdb \
|
---|
206 | -Fo$(obj)\
|
---|
207 | $(subst /,\\,$(abspath $(source)))
|
---|
208 | endef
|
---|
209 | else
|
---|
210 | define TOOL_VCC141_COMPILE_C_CMDS
|
---|
211 | $(QUIET)$(TOOL_VCC141_CC) -c\
|
---|
212 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
213 | -Fd$(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_VCC141_KSUBMIT
|
---|
219 |
|
---|
220 |
|
---|
221 | ## Compile C++ source.
|
---|
222 | # @param $(target) Normalized main target name.
|
---|
223 | # @param $(source) Source filename (relative).
|
---|
224 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
---|
225 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
---|
226 | # @param $(flags) Flags.
|
---|
227 | # @param $(defs) Definitions. No -D or something.
|
---|
228 | # @param $(incs) Includes. No -I or something.
|
---|
229 | # @param $(dirdep) Directory creation dependency.
|
---|
230 | # @param $(deps) Other dependencies.
|
---|
231 | #
|
---|
232 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
233 | # @param $(objsuff) Object suffix.
|
---|
234 | TOOL_VCC141_COMPILE_CXX_DEPEND = $($(target)_1_VCC_PCH_FILE)
|
---|
235 | TOOL_VCC141_COMPILE_CXX_DEPORD =
|
---|
236 | TOOL_VCC141_COMPILE_CXX_OUTPUT =
|
---|
237 | TOOL_VCC141_COMPILE_CXX_OUTPUT_MAYBE = $(if-expr defined($(target)_1_VCC_COMMON_OBJ_PDB)\
|
---|
238 | ,,$(call TOOL_VCC141_PDB, $(outbase)-obj,pdb) $(call TOOL_VCC141_PDB, $(outbase)-obj,idb))
|
---|
239 | ifdef TOOL_VCC141_KSUBMIT
|
---|
240 | TOOL_VCC141_COMPILE_CXX_DONT_PURGE_OUTPUT := 1 # speed
|
---|
241 | define TOOL_VCC141_COMPILE_CXX_CMDS
|
---|
242 | $(QUIET)$(TOOL_VCC141_KSUBMIT) -P $(DEP_OBJ_INT) -f -s -q -o $(dep) -t $(obj) $(obj)\
|
---|
243 | -- $(TOOL_VCC141_CXX) -c\
|
---|
244 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
245 | $(if-expr defined($(target)_PCH_HDR)\
|
---|
246 | ,-FI$($(target)_PCH_HDR) -Yu$($(target)_PCH_HDR) -Fp$($(target)_1_VCC_PCH_FILE) -FS,)\
|
---|
247 | -Fd$(if-expr defined($(target)_1_VCC_COMMON_OBJ_PDB),$($(target)_1_VCC_COMMON_OBJ_PDB),$(outbase)-obj.pdb) \
|
---|
248 | -Fo$(obj)\
|
---|
249 | $(subst /,\\,$(abspath $(source)))
|
---|
250 | endef
|
---|
251 | else
|
---|
252 | define TOOL_VCC141_COMPILE_CXX_CMDS
|
---|
253 | $(QUIET)$(TOOL_VCC141_CXX) -c\
|
---|
254 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
255 | $(if-expr defined($(target)_PCH_HDR)\
|
---|
256 | ,-FI$($(target)_PCH_HDR) -Yu$($(target)_PCH_HDR) -Fp$($(target)_1_VCC_PCH_FILE) -FS,)\
|
---|
257 | -Fd$(if-expr defined($(target)_1_VCC_COMMON_OBJ_PDB),$($(target)_1_VCC_COMMON_OBJ_PDB),$(outbase)-obj.pdb) \
|
---|
258 | -Fo$(obj)\
|
---|
259 | $(subst /,\\,$(abspath $(source)))
|
---|
260 | $(QUIET)$(DEP_OBJ) -f -s -q -o $(dep) -t $(obj) $(obj)
|
---|
261 | endef
|
---|
262 | endif # !TOOL_VCC141_KSUBMIT
|
---|
263 |
|
---|
264 |
|
---|
265 | #
|
---|
266 | # Helper tool for creating the precompiled C++ header.
|
---|
267 | #
|
---|
268 | # It only have the C++ compile bits and it's purpose is to skip bits
|
---|
269 | # related _1_VCC_PCH_FILE and add -Yc.
|
---|
270 | #
|
---|
271 | TOOL_VCC141-PCH := Helper for creating precompiled header using CXX handling.
|
---|
272 | TOOL_VCC141-PCH_EXTENDS := VCC141
|
---|
273 | TOOL_VCC141-PCH_CXXOBJSUFF := .obj
|
---|
274 | TOOL_VCC141-PCH_CXXINCS = $(TOOL_VCC141_CXXINCS)
|
---|
275 | TOOL_VCC141-PCH_CXXFLAGS = $(TOOL_VCC141_CXXFLAGS) -FS
|
---|
276 | TOOL_VCC141-PCH_CXXFLAGS.debug = $(TOOL_VCC141_CXXFLAGS.debug)
|
---|
277 | TOOL_VCC141-PCH_CXXFLAGS.dbgopt = $(TOOL_VCC141_CXXFLAGS.dbgopt)
|
---|
278 | TOOL_VCC141-PCH_CXXFLAGS.release = $(TOOL_VCC141_CXXFLAGS.release)
|
---|
279 | TOOL_VCC141-PCH_CXXFLAGS.profile = $(TOOL_VCC141_CXXFLAGS.profile)
|
---|
280 | TOOL_VCC141-PCH_COMPILE_CXX_DEPEND = $(NO_SUCH_VARIABLE)
|
---|
281 | TOOL_VCC141-PCH_COMPILE_CXX_DEPORD = $(NO_SUCH_VARIABLE)
|
---|
282 | TOOL_VCC141-PCH_COMPILE_CXX_OUTPUT = $($(target)_1_VCC_PCH_FILE) $($(target)_1_VCC_COMMON_OBJ_PDB)
|
---|
283 | TOOL_VCC141-PCH_COMPILE_CXX_OUTPUT_MAYBE = $(NO_SUCH_VARIABLE)
|
---|
284 | ifdef TOOL_VCC141_KSUBMIT
|
---|
285 | define TOOL_VCC141-PCH_COMPILE_CXX_CMDS
|
---|
286 | $(QUIET)$(RM) -f -- $($(target)_1_VCC_PCH_FILE) $($(target)_1_VCC_COMMON_OBJ_PDB)
|
---|
287 | $(QUIET)$(TOOL_VCC141_KSUBMIT) --no-pch-caching -P $(DEP_OBJ_INT) -f -s -q -e .pch -o $(dep) -t $(obj) $(obj)\
|
---|
288 | -- $(TOOL_VCC141_CXX) -c -Yc\
|
---|
289 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
290 | -Fp$($(target)_1_VCC_PCH_FILE) \
|
---|
291 | -Fd$($(target)_1_VCC_COMMON_OBJ_PDB) \
|
---|
292 | -Fo$(obj)\
|
---|
293 | -TP \
|
---|
294 | $(subst /,\\,$(abspath $(source)))
|
---|
295 | endef
|
---|
296 | else
|
---|
297 | define TOOL_VCC141-PCH_COMPILE_CXX_CMDS
|
---|
298 | $(QUIET)$(RM) -f -- $($(target)_1_VCC_PCH_FILE) $($(target)_1_VCC_COMMON_OBJ_PDB)
|
---|
299 | $(QUIET)$(TOOL_VCC141_CXX) -c -Yc\
|
---|
300 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
301 | -Fp$($(target)_1_VCC_PCH_FILE) \
|
---|
302 | -Fd$($(target)_1_VCC_COMMON_OBJ_PDB) \
|
---|
303 | -Fo$(obj)\
|
---|
304 | -TP \
|
---|
305 | $(subst /,\\,$(abspath $(source)))
|
---|
306 | $(QUIET)$(DEP_OBJ) -f -s -q -e .pch -o $(dep) -t $(obj) $(obj)
|
---|
307 |
|
---|
308 | endef
|
---|
309 | endif # !TOOL_VCC141_KSUBMIT
|
---|
310 |
|
---|
311 |
|
---|
312 | ## @todo configure the assembler template.
|
---|
313 |
|
---|
314 | ## Compile resource source.
|
---|
315 | # @param $(target) Normalized main target name.
|
---|
316 | # @param $(source) Source filename (relative).
|
---|
317 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
---|
318 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
---|
319 | # @param $(flags) Flags.
|
---|
320 | # @param $(defs) Definitions. No -D or something.
|
---|
321 | # @param $(incs) Includes. No -I or something.
|
---|
322 | # @param $(dirdep) Directory creation dependency.
|
---|
323 | # @param $(deps) Other dependencies.
|
---|
324 | #
|
---|
325 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
326 | # @param $(objsuff) Object suffix.
|
---|
327 | TOOL_VCC141_COMPILE_RC_DEPEND =
|
---|
328 | TOOL_VCC141_COMPILE_RC_DEPORD =
|
---|
329 | TOOL_VCC141_COMPILE_RC_OUTPUT =
|
---|
330 | define TOOL_VCC141_COMPILE_RC_CMDS
|
---|
331 | $(QUIET)$(TOOL_VCC141_RC) \
|
---|
332 | $(flags) $(qaddprefix sh,/i, $(subst /,\\,$(incs))) $(qaddprefix sh,/d, $(defs))\
|
---|
333 | /fo$(obj)\
|
---|
334 | $(subst /,\\,$(abspath $(source)))
|
---|
335 | endef
|
---|
336 |
|
---|
337 |
|
---|
338 | ## Link library
|
---|
339 | # @param $(target) Normalized main target name.
|
---|
340 | # @param $(out) Library name.
|
---|
341 | # @param $(objs) Object files to put in the library.
|
---|
342 | # @param $(flags) Flags.
|
---|
343 | # @param $(dirdep) Directory creation dependency.
|
---|
344 | # @param $(deps) Other dependencies.
|
---|
345 | # @param $(othersrc) Unhandled sources.
|
---|
346 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
347 | #
|
---|
348 | TOOL_VCC141_LINK_LIBRARY_DEPEND = $(othersrc)
|
---|
349 | TOOL_VCC141_LINK_LIBRARY_DEPORD =
|
---|
350 | TOOL_VCC141_LINK_LIBRARY_OUTPUT = $(outbase).rsp
|
---|
351 | TOOL_VCC141_LINK_LIBRARY_OUTPUT_MAYBE = $(outbase).lst $(outbase).exp $(outbase).pdb
|
---|
352 | define TOOL_VCC141_LINK_LIBRARY_CMDS
|
---|
353 | $(QUIET)$(APPEND) -tn $(outbase).rsp \
|
---|
354 | $(qforeachfile u,arg, $(objs) $(filter-out %.def,$(othersrc)),$(quote-sh "$(subst /,\,$(arg))")) \
|
---|
355 | $(qforeachfile u,arg, $(filter %.def,$(othersrc)),$(quote-sh "/DEF:$(subst /,\,$(arg))"))
|
---|
356 | $(QUIET)$(TOOL_VCC141_KSUBMIT_DD) $(TOOL_VCC141_AR) $(flags) /OUT:$(out) @$(outbase).rsp
|
---|
357 | endef
|
---|
358 |
|
---|
359 |
|
---|
360 | ## Link program
|
---|
361 | # @param $(target) Normalized main target name.
|
---|
362 | # @param $(out) Program 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 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
373 | #
|
---|
374 | TOOL_VCC141_LINK_PROGRAM_DEPEND = $(foreachfile lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
|
---|
375 | TOOL_VCC141_LINK_PROGRAM_DEPORD =
|
---|
376 | TOOL_VCC141_LINK_PROGRAM_OUTPUT_MAYBE_PRECIOUS = $(outbase).map $(outbase).rsp
|
---|
377 | TOOL_VCC141_LINK_PROGRAM_OUTPUT_MAYBE = $(outbase).lib $(outbase).exp $(outbase).ilk $(out).manifest
|
---|
378 | TOOL_VCC141_LINK_PROGRAM_OUTPUT_DEBUG = $(outbase).pdb
|
---|
379 | TOOL_VCC141_LINK_PROGRAM_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
|
---|
380 | define TOOL_VCC141_LINK_PROGRAM_CMDS
|
---|
381 | $(QUIET)$(APPEND) -tn $(outbase).rsp \
|
---|
382 | $(qforeachfile u,arg, $(objs) $(libs),$(quote-sh "$(subst /,\,$(arg))"))
|
---|
383 | $(QUIET)$(TOOL_VCC141_KSUBMIT_DD) $(TOOL_VCC141_LD) $(flags) \
|
---|
384 | /OUT:$(out) \
|
---|
385 | /MAPINFO:EXPORTS /INCREMENTAL:NO \
|
---|
386 | /MAP:$(outbase).map \
|
---|
387 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
|
---|
388 | $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
|
---|
389 | $(qaddprefix sh,/LIBPATH:,$(libpath)) \
|
---|
390 | @$(outbase).rsp
|
---|
391 | ifndef TOOL_VCC141_NO_AUTO_MANIFEST
|
---|
392 | $(QUIET)$(TEST) -f $(out).manifest -- \
|
---|
393 | $(TOOL_VCC141_MT) -manifest $(subst /,\\,$(out)).manifest -outputresource:$(subst /,\\,$(out))
|
---|
394 | endif
|
---|
395 | endef
|
---|
396 |
|
---|
397 |
|
---|
398 | ## Link DLL.
|
---|
399 | # @param $(target) Normalized main target name.
|
---|
400 | # @param $(out) DLL 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_VCC141_LINK_DLL_DEPEND = $(foreachfile lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
|
---|
413 | TOOL_VCC141_LINK_DLL_DEPORD = $(call DIRDEP,$(PATH_STAGE_LIB))
|
---|
414 | TOOL_VCC141_LINK_DLL_OUTPUT = $(outbase).lib $(outbase).exp
|
---|
415 | TOOL_VCC141_LINK_DLL_OUTPUT_MAYBE = $(outbase).ilk $(out).manifest $(PATH_STAGE_LIB)/$(notdir $(outbase)).exp
|
---|
416 | TOOL_VCC141_LINK_DLL_OUTPUT_MAYBE_PRECIOUS = $(PATH_STAGE_LIB)/$(notdir $(outbase)).lib $(outbase).map $(outbase).rsp
|
---|
417 | TOOL_VCC141_LINK_DLL_OUTPUT_DEBUG = $(outbase).pdb
|
---|
418 | TOOL_VCC141_LINK_DLL_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
|
---|
419 | define TOOL_VCC141_LINK_DLL_CMDS
|
---|
420 | $(QUIET)$(APPEND) -tn $(outbase).rsp \
|
---|
421 | $(qforeachfile u,arg, $(objs) $(libs),$(quote-sh "$(subst /,\,$(arg))"))
|
---|
422 | $(QUIET)$(TOOL_VCC141_KSUBMIT_DD) $(TOOL_VCC141_LD) $(flags) \
|
---|
423 | /OUT:$(out) \
|
---|
424 | /IMPLIB:$(outbase).lib \
|
---|
425 | /MAPINFO:EXPORTS /INCREMENTAL:NO \
|
---|
426 | /MAP:$(outbase).map \
|
---|
427 | /DLL \
|
---|
428 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
|
---|
429 | $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
|
---|
430 | $(qaddprefix sh,/LIBPATH:,$(libpath)) \
|
---|
431 | @$(outbase).rsp
|
---|
432 | ifndef TOOL_VCC141_NO_AUTO_MANIFEST
|
---|
433 | $(QUIET)$(TEST) -f $(out).manifest -- \
|
---|
434 | $(TOOL_VCC141_MT) -manifest $(subst /,\\,$(out)).manifest '-outputresource:$(subst /,\\,$(out));#2'
|
---|
435 | endif
|
---|
436 | $(QUIET)$(TEST) -f $(outbase).lib -- $(KLIBTWEAKER_EXT) --clear-timestamps $(outbase).lib
|
---|
437 | $(QUIET)$(CP) --changed -v --ignore-non-existing $(outbase).exp $(outbase).lib $(PATH_STAGE_LIB)/
|
---|
438 | $(eval _DIRS += $(PATH_STAGE_LIB))
|
---|
439 | endef
|
---|
440 |
|
---|
441 |
|
---|
442 | ## Link system module (windows aka driver, linux aka kernel module)
|
---|
443 | # @param $(target) Normalized main target name.
|
---|
444 | # @param $(out) System module name.
|
---|
445 | # @param $(objs) Object files to link together.
|
---|
446 | # @param $(libs) Libraries to search.
|
---|
447 | # @param $(libpath) Library search paths.
|
---|
448 | # @param $(flags) Flags.
|
---|
449 | # @param $(dirdep) Directory creation dependency.
|
---|
450 | # @param $(deps) Other dependencies.
|
---|
451 | # @param $(othersrc) Unhandled sources.
|
---|
452 | # @param $(custom_pre) Custom step invoked before linking.
|
---|
453 | # @param $(custom_post) Custom step invoked after linking.
|
---|
454 | #
|
---|
455 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
456 | TOOL_VCC141_LINK_SYSMOD_DEPEND = $(foreachfile lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
|
---|
457 | TOOL_VCC141_LINK_SYSMOD_DEPORD =
|
---|
458 | TOOL_VCC141_LINK_SYSMOD_OUTPUT_MAYBE = $(outbase).lib $(outbase).exp $(outbase).ilk $(out).manifest
|
---|
459 | TOOL_VCC141_LINK_SYSMOD_OUTPUT_MAYBE_PRECIOUS = $(outbase).map $(outbase).rsp
|
---|
460 | TOOL_VCC141_LINK_SYSMOD_OUTPUT_DEBUG = $(outbase).pdb
|
---|
461 | TOOL_VCC141_LINK_SYSMOD_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
|
---|
462 | define TOOL_VCC141_LINK_SYSMOD_CMDS
|
---|
463 | $(QUIET)$(APPEND) -tn $(outbase).rsp \
|
---|
464 | $(qforeachfile u,arg, $(objs) $(libs),$(quote-sh "$(subst /,\,$(arg))"))
|
---|
465 | $(QUIET)$(TOOL_VCC141_KSUBMIT_DD) $(TOOL_VCC141_LD) $(flags) \
|
---|
466 | /OUT:$(out) \
|
---|
467 | /MAPINFO:EXPORTS /INCREMENTAL:NO \
|
---|
468 | /MAP:$(outbase).map \
|
---|
469 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
|
---|
470 | $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
|
---|
471 | $(qaddprefix sh,/LIBPATH:,$(libpath)) \
|
---|
472 | @$(outbase).rsp
|
---|
473 | ifndef TOOL_VCC141_NO_AUTO_MANIFEST
|
---|
474 | $(QUIET)$(TEST) -f $(out).manifest -- \
|
---|
475 | $(TOOL_VCC141_MT) -manifest $(subst /,\\,$(out)).manifest '-outputresource:$(subst /,\\,$(out));#2'
|
---|
476 | endif
|
---|
477 | endef
|
---|
478 |
|
---|