1 | # $Id: VCC140X86.kmk 3343 2020-05-20 14:34:15Z bird $
|
---|
2 | ## @file
|
---|
3 | # kBuild Tool Config - Visual C++ 14.0 (aka Visual 2015 and MSC v19.0x), targeting x86.
|
---|
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_VCC140
|
---|
35 | include $(KBUILD_PATH)/tools/VCC140.kmk
|
---|
36 | endif
|
---|
37 |
|
---|
38 | TOOL_VCC140X86 := Visual C++ 14.0 (aka Visual 2015 and MSC v19.0x), targeting x86
|
---|
39 |
|
---|
40 | #
|
---|
41 | # Tool Specific Properties
|
---|
42 | #
|
---|
43 | ifndef PATH_TOOL_VCC140X86_BIN
|
---|
44 | ifeq ($(KBUILD_HOST_ARCH),amd64)
|
---|
45 | PATH_TOOL_VCC140X86_BIN := $(PATH_TOOL_VCC140_BASE_BIN)/amd64_x86
|
---|
46 | else
|
---|
47 | PATH_TOOL_VCC140X86_BIN := $(PATH_TOOL_VCC140_BASE_BIN)
|
---|
48 | endif
|
---|
49 | else
|
---|
50 | PATH_TOOL_VCC140X86_BIN := $(PATH_TOOL_VCC140X86_BIN)
|
---|
51 | endif
|
---|
52 | PATH_TOOL_VCC140X86_BIN_QSH := $(requote sh,$(PATH_TOOL_VCC140X86_BIN))
|
---|
53 |
|
---|
54 | # 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.
|
---|
55 | ifndef PATH_TOOL_VCC140X86_DLL_BIN
|
---|
56 | ifneq ($(PATH_TOOL_VCC140_HOST_DLL_BIN),$(PATH_TOOL_VCC140X86_BIN))
|
---|
57 | PATH_TOOL_VCC140X86_DLL_BIN := $(PATH_TOOL_VCC140_HOST_DLL_BIN)
|
---|
58 | endif
|
---|
59 | endif
|
---|
60 |
|
---|
61 | ifndef PATH_TOOL_VCC140X86_LIB
|
---|
62 | PATH_TOOL_VCC140X86_LIB := $(PATH_TOOL_VCC140_LIB.x86)
|
---|
63 | endif
|
---|
64 | ifndef PATH_TOOL_VCC140_ONECORE_LIB
|
---|
65 | PATH_TOOL_VCC140_ONECORE_LIB := $(PATH_TOOL_VCC140_ONECORE_LIB.x86)
|
---|
66 | endif
|
---|
67 |
|
---|
68 | ifndef PATH_TOOL_VCC140X86_INC
|
---|
69 | PATH_TOOL_VCC140X86_INC := $(PATH_TOOL_VCC140_INC)
|
---|
70 | endif
|
---|
71 |
|
---|
72 | ifndef PATH_TOOL_VCC140X86_ATLMFC_INC
|
---|
73 | PATH_TOOL_VCC140X86_ATLMFC_INC := $(PATH_TOOL_VCC140_ATLMFC_INC.x86)
|
---|
74 | endif
|
---|
75 | ifndef PATH_TOOL_VCC140X86_ATLMFC_LIB
|
---|
76 | PATH_TOOL_VCC140X86_ATLMFC_LIB := $(PATH_TOOL_VCC140_ATLMFC_LIB.x86)
|
---|
77 | endif
|
---|
78 |
|
---|
79 | TOOL_VCC140X86_CC ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC140X86_BIN_QSH)/cl.exe
|
---|
80 | TOOL_VCC140X86_CXX ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC140X86_BIN_QSH)/cl.exe
|
---|
81 | TOOL_VCC140X86_AS ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC140X86_BIN_QSH)/ml.exe
|
---|
82 | #TOOL_VCC140X86_AR ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC140X86_BIN_QSH)/lib.exe - just an exec wrapper for the below
|
---|
83 | TOOL_VCC140X86_AR ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC140X86_BIN_QSH)/link.exe /LIB
|
---|
84 | TOOL_VCC140X86_LD ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC140X86_BIN_QSH)/link.exe
|
---|
85 | TOOL_VCC140X86_DUMPBIN ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC140X86_BIN_QSH)/dumpbin.exe
|
---|
86 | TOOL_VCC140X86_EDITBIN ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC140X86_BIN_QSH)/editbin.exe
|
---|
87 |
|
---|
88 | TOOL_VCC140X86_RC ?= $(EXEC_X86_WIN32) $(call TOOL_VCC140_FN_FIND_SDK_TOOL,rc.exe,[Rr][Cc].[Ee][Xx][Ee],TOOL_VCC140_RC_CACHED)
|
---|
89 | TOOL_VCC140X86_MT ?= $(EXEC_X86_WIN32) $(call TOOL_VCC140_FN_FIND_SDK_TOOL,mt.exe,[Mm][Tt].[Ee][Xx][Ee],TOOL_VCC140_MT_CACHED)
|
---|
90 |
|
---|
91 | undefine TOOL_VCC140X86_USE_KSUBMIT # for now
|
---|
92 | ifdef TOOL_VCC140X86_USE_KSUBMIT
|
---|
93 | ifeq ($(KBUILD_HOST),win)
|
---|
94 | ifneq ($(substr $(qdir un,$(PATH_TOOL_VCC140X86_BIN)),-3),64/)
|
---|
95 | TOOL_VCC140X86_KSUBMIT ?= kmk_builtin_kSubmit --64-bit
|
---|
96 | else
|
---|
97 | TOOL_VCC140X86_KSUBMIT ?= kmk_builtin_kSubmit --32-bit
|
---|
98 | endif
|
---|
99 | ifdef PATH_TOOL_VCC140X86_DLL_BIN
|
---|
100 | TOOL_VCC140X86_KSUBMIT := $(TOOL_VCC140X86_KSUBMIT) --prepend "PATH=$(requote shell-in-dq,$(PATH_TOOL_VCC140X86_DLL_BIN));"
|
---|
101 | endif
|
---|
102 | TOOL_VCC140X86_KSUBMIT_DD := $(TOOL_VCC140X86_KSUBMIT) --
|
---|
103 | endif
|
---|
104 | endif
|
---|
105 | ifdef PATH_TOOL_VCC140X86_DLL_BIN
|
---|
106 | TOOL_VCC140X86_SETUP_ENV := $(REDIRECT) --prepend "PATH=$(requote shell-in-dq,$(PATH_TOOL_VCC140X86_DLL_BIN));" --$(SP)
|
---|
107 | ifndef TOOL_VCC140X86_KSUBMIT_DD
|
---|
108 | TOOL_VCC140X86_KSUBMIT_DD := $(TOOL_VCC140X86_SETUP_ENV)
|
---|
109 | endif
|
---|
110 | endif
|
---|
111 |
|
---|
112 | # Redist (more stuff in VCC140.kmk).
|
---|
113 | PATH_TOOL_VCC140X86_REDIST ?= $(PATH_TOOL_VCC140_REDIST)/x86
|
---|
114 | PATH_TOOL_VCC140X86_REDIST_CRT = $(PATH_TOOL_VCC140X86_REDIST)/$(TOOL_VCC140_REDIST_CRT_SUBDIR)
|
---|
115 | PATH_TOOL_VCC140X86_REDIST_DEBUG ?= $(PATH_TOOL_VCC140_REDIST_DEBUG)/x86
|
---|
116 | PATH_TOOL_VCC140X86_REDIST_DEBUG_CRT = $(PATH_TOOL_VCC140X86_REDIST_DEBUG)/$(TOOL_VCC140_REDIST_CRT_SUBDIR)
|
---|
117 | TOOL_VCC140X64_REDIST_CRT_DLLS = $(TOOL_VCC140_REDIST_CRT_DLLS.x86)
|
---|
118 | TOOL_VCC140X64_REDIST_CONCRT_DLLS = $(TOOL_VCC140_REDIST_CONCRT_DLLS.x86)
|
---|
119 | TOOL_VCC140X64_REDIST_CPP_DLLS = $(TOOL_VCC140_REDIST_CPP_DLLS.x86)
|
---|
120 | TOOL_VCC140X64_REDIST_WINRT_DLLS = $(TOOL_VCC140_REDIST_WINRT_DLLS.x86)
|
---|
121 |
|
---|
122 |
|
---|
123 | #
|
---|
124 | # Properties used by kBuild
|
---|
125 | #
|
---|
126 | TOOL_VCC140X86_COBJSUFF ?= .obj
|
---|
127 | TOOL_VCC140X86_CFLAGS ?= -TC -nologo -Zi -ZH:SHA_256
|
---|
128 | TOOL_VCC140X86_CFLAGS.debug ?=
|
---|
129 | TOOL_VCC140X86_CFLAGS.dbgopt ?= -O2
|
---|
130 | TOOL_VCC140X86_CFLAGS.release ?= -O2
|
---|
131 | TOOL_VCC140X86_CFLAGS.profile ?= -O2
|
---|
132 | TOOL_VCC140X86_CINCS ?= $(PATH_TOOL_VCC140X86_INC)
|
---|
133 | TOOL_VCC140X86_CDEFS ?=
|
---|
134 |
|
---|
135 | TOOL_VCC140X86_CXXOBJSUFF ?= .obj
|
---|
136 | TOOL_VCC140X86_CXXFLAGS ?= -TP -nologo -Zi -ZH:SHA_256
|
---|
137 | TOOL_VCC140X86_CXXFLAGS.debug ?=
|
---|
138 | TOOL_VCC140X86_CXXFLAGS.dbgopt ?= -O2
|
---|
139 | TOOL_VCC140X86_CXXFLAGS.release ?= -O2
|
---|
140 | TOOL_VCC140X86_CXXFLAGS.profile ?= -O2
|
---|
141 | TOOL_VCC140X86_CXXINCS ?= $(PATH_TOOL_VCC140X86_INC) $(PATH_TOOL_VCC140X86_ATLMFC_INC)
|
---|
142 | TOOL_VCC140X86_CXXDEFS ?=
|
---|
143 |
|
---|
144 | TOOL_VCC140X86_ASOBJSUFF ?= .obj
|
---|
145 |
|
---|
146 | TOOL_VCC140X86_RCOBJSUFF ?= .res
|
---|
147 | TOOL_VCC140X86_RCINCS ?= $(PATH_TOOL_VCC140X86_INC) $(PATH_TOOL_VCC140X86_ATLMFC_INC)
|
---|
148 |
|
---|
149 | TOOL_VCC140X86_ARFLAGS ?= -nologo -machine:x86
|
---|
150 | TOOL_VCC140X86_ARLIBSUFF ?= .lib
|
---|
151 |
|
---|
152 | TOOL_VCC140X86_LDFLAGS ?= -nologo -machine:x86
|
---|
153 | TOOL_VCC140X86_LDFLAGS.debug ?= -debug
|
---|
154 | TOOL_VCC140X86_LDFLAGS.dbgopt ?= -debug
|
---|
155 | TOOL_VCC140X86_LDFLAGS.profile ?= -debug
|
---|
156 | TOOL_VCC140X86_LDFLAGS.release ?=
|
---|
157 |
|
---|
158 |
|
---|
159 |
|
---|
160 | ## Compile C source.
|
---|
161 | # @param $(target) Normalized main target name.
|
---|
162 | # @param $(source) Source filename (relative).
|
---|
163 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
---|
164 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
---|
165 | # @param $(flags) Flags.
|
---|
166 | # @param $(defs) Definitions. No -D or something.
|
---|
167 | # @param $(incs) Includes. No -I or something.
|
---|
168 | # @param $(dirdep) Directory creation dependency.
|
---|
169 | # @param $(deps) Other dependencies.
|
---|
170 | #
|
---|
171 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
172 | # @param $(objsuff) Object suffix.
|
---|
173 | TOOL_VCC140X86_COMPILE_C_DEPEND =
|
---|
174 | TOOL_VCC140X86_COMPILE_C_DEPORD =
|
---|
175 | TOOL_VCC140X86_COMPILE_C_OUTPUT =
|
---|
176 | TOOL_VCC140X86_COMPILE_C_OUTPUT_MAYBE = $(call TOOL_VCC140_PDB, $(outbase)-obj,pdb) $(call TOOL_VCC140_PDB, $(outbase)-obj,idb)
|
---|
177 | ifdef TOOL_VCC140X86_KSUBMIT
|
---|
178 | TOOL_VCC140X86_COMPILE_C_DONT_PURGE_OUTPUT := 1 # speed
|
---|
179 | define TOOL_VCC140X86_COMPILE_C_CMDS
|
---|
180 | $(QUIET)$(TOOL_VCC140X86_KSUBMIT) -P $(DEP_OBJ_INT) -f -s -q -o $(dep) -t $(obj) $(obj)\
|
---|
181 | -- $(TOOL_VCC140X86_CC) -c\
|
---|
182 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
183 | -Fd$(outbase)-obj.pdb \
|
---|
184 | -Fo$(obj)\
|
---|
185 | $(subst /,\\,$(abspath $(source)))
|
---|
186 | endef
|
---|
187 | else
|
---|
188 | define TOOL_VCC140X86_COMPILE_C_CMDS
|
---|
189 | $(QUIET)$(TOOL_VCC140X86_SETUP_ENV)$(TOOL_VCC140X86_CC) -c\
|
---|
190 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
191 | -Fd$(outbase)-obj.pdb \
|
---|
192 | -Fo$(obj)\
|
---|
193 | $(subst /,\\,$(abspath $(source)))
|
---|
194 | $(QUIET)$(DEP_OBJ) -f -s -q -o $(dep) -t $(obj) $(obj)
|
---|
195 | endef
|
---|
196 | endif # !TOOL_VCC140X86_KSUBMIT
|
---|
197 |
|
---|
198 |
|
---|
199 | ## Compile C++ source.
|
---|
200 | # @param $(target) Normalized main target name.
|
---|
201 | # @param $(source) Source filename (relative).
|
---|
202 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
---|
203 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
---|
204 | # @param $(flags) Flags.
|
---|
205 | # @param $(defs) Definitions. No -D or something.
|
---|
206 | # @param $(incs) Includes. No -I or something.
|
---|
207 | # @param $(dirdep) Directory creation dependency.
|
---|
208 | # @param $(deps) Other dependencies.
|
---|
209 | #
|
---|
210 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
211 | # @param $(objsuff) Object suffix.
|
---|
212 | TOOL_VCC140X86_COMPILE_CXX_DEPEND = $($(target)_1_VCC_PCH_FILE)
|
---|
213 | TOOL_VCC140X86_COMPILE_CXX_DEPORD =
|
---|
214 | TOOL_VCC140X86_COMPILE_CXX_OUTPUT =
|
---|
215 | TOOL_VCC140X86_COMPILE_CXX_OUTPUT_MAYBE = $(if-expr defined($(target)_1_VCC_COMMON_OBJ_PDB)\
|
---|
216 | ,,$(call TOOL_VCC140_PDB, $(outbase)-obj,pdb) $(call TOOL_VCC140_PDB, $(outbase)-obj,idb))
|
---|
217 | ifdef TOOL_VCC140X86_KSUBMIT
|
---|
218 | TOOL_VCC140X86_COMPILE_CXX_DONT_PURGE_OUTPUT := 1 # speed
|
---|
219 | define TOOL_VCC140X86_COMPILE_CXX_CMDS
|
---|
220 | $(QUIET)$(TOOL_VCC140X86_KSUBMIT) -P $(DEP_OBJ_INT) -f -s -q -o $(dep) -t $(obj) $(obj)\
|
---|
221 | -- $(TOOL_VCC140X86_CXX) -c\
|
---|
222 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
223 | $(if-expr defined($(target)_PCH_HDR)\
|
---|
224 | ,-FI$($(target)_PCH_HDR) -Yu$($(target)_PCH_HDR) -Fp$($(target)_1_VCC_PCH_FILE) -FS,)\
|
---|
225 | -Fd$(if-expr defined($(target)_1_VCC_COMMON_OBJ_PDB),$($(target)_1_VCC_COMMON_OBJ_PDB),$(outbase)-obj.pdb) \
|
---|
226 | -Fo$(obj)\
|
---|
227 | $(subst /,\\,$(abspath $(source)))
|
---|
228 | endef
|
---|
229 | else
|
---|
230 | define TOOL_VCC140X86_COMPILE_CXX_CMDS
|
---|
231 | $(QUIET)$(TOOL_VCC140X86_SETUP_ENV)$(TOOL_VCC140X86_CXX) -c\
|
---|
232 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
233 | $(if-expr defined($(target)_PCH_HDR)\
|
---|
234 | ,-FI$($(target)_PCH_HDR) -Yu$($(target)_PCH_HDR) -Fp$($(target)_1_VCC_PCH_FILE) -FS,)\
|
---|
235 | -Fd$(if-expr defined($(target)_1_VCC_COMMON_OBJ_PDB),$($(target)_1_VCC_COMMON_OBJ_PDB),$(outbase)-obj.pdb) \
|
---|
236 | -Fo$(obj)\
|
---|
237 | $(subst /,\\,$(abspath $(source)))
|
---|
238 | $(QUIET)$(DEP_OBJ) -f -s -q -o $(dep) -t $(obj) $(obj)
|
---|
239 | endef
|
---|
240 | endif # !TOOL_VCC140X86_KSUBMIT
|
---|
241 |
|
---|
242 |
|
---|
243 | #
|
---|
244 | # Helper tool for creating the precompiled C++ header.
|
---|
245 | #
|
---|
246 | # It only have the C++ compile bits and it's purpose is to skip bits
|
---|
247 | # related _1_VCC_PCH_FILE and add -Yc.
|
---|
248 | #
|
---|
249 | TOOL_VCC140X86-PCH := Helper for creating precompiled header using CXX handling.
|
---|
250 | TOOL_VCC140X86-PCH_EXTENDS := VCC140X86
|
---|
251 | TOOL_VCC140X86-PCH_CXXOBJSUFF := .obj
|
---|
252 | TOOL_VCC140X86-PCH_CXXINCS = $(TOOL_VCC140X86_CXXINCS)
|
---|
253 | TOOL_VCC140X86-PCH_CXXFLAGS = $(TOOL_VCC140X86_CXXFLAGS) -FS
|
---|
254 | TOOL_VCC140X86-PCH_CXXFLAGS.debug = $(TOOL_VCC140X86_CXXFLAGS.debug)
|
---|
255 | TOOL_VCC140X86-PCH_CXXFLAGS.dbgopt = $(TOOL_VCC140X86_CXXFLAGS.dbgopt)
|
---|
256 | TOOL_VCC140X86-PCH_CXXFLAGS.release = $(TOOL_VCC140X86_CXXFLAGS.release)
|
---|
257 | TOOL_VCC140X86-PCH_CXXFLAGS.profile = $(TOOL_VCC140X86_CXXFLAGS.profile)
|
---|
258 | TOOL_VCC140X86-PCH_COMPILE_CXX_DEPEND = $(NO_SUCH_VARIABLE)
|
---|
259 | TOOL_VCC140X86-PCH_COMPILE_CXX_DEPORD = $(NO_SUCH_VARIABLE)
|
---|
260 | TOOL_VCC140X86-PCH_COMPILE_CXX_OUTPUT = $($(target)_1_VCC_PCH_FILE) $($(target)_1_VCC_COMMON_OBJ_PDB)
|
---|
261 | TOOL_VCC140X86-PCH_COMPILE_CXX_OUTPUT_MAYBE = $(NO_SUCH_VARIABLE)
|
---|
262 | ifdef TOOL_VCC140X86_KSUBMIT
|
---|
263 | define TOOL_VCC140X86-PCH_COMPILE_CXX_CMDS
|
---|
264 | $(QUIET)$(RM) -f -- $($(target)_1_VCC_PCH_FILE) $($(target)_1_VCC_COMMON_OBJ_PDB)
|
---|
265 | $(QUIET)$(TOOL_VCC140X86_KSUBMIT) --no-pch-caching -P $(DEP_OBJ_INT) -f -s -q -e .pch -o $(dep) -t $(obj) $(obj)\
|
---|
266 | -- $(TOOL_VCC140X86_CXX) -c -Yc\
|
---|
267 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
268 | $(if-expr defined($(target)_PCH_HDR),-FI$($(target)_PCH_HDR),)\
|
---|
269 | -Fp$($(target)_1_VCC_PCH_FILE) \
|
---|
270 | -Fd$($(target)_1_VCC_COMMON_OBJ_PDB) \
|
---|
271 | -Fo$(obj)\
|
---|
272 | -TP \
|
---|
273 | $(subst /,\\,$(abspath $(source)))
|
---|
274 | endef
|
---|
275 | else
|
---|
276 | define TOOL_VCC140X86-PCH_COMPILE_CXX_CMDS
|
---|
277 | $(QUIET)$(RM) -f -- $($(target)_1_VCC_PCH_FILE) $($(target)_1_VCC_COMMON_OBJ_PDB)
|
---|
278 | $(QUIET)$(TOOL_VCC140X86_SETUP_ENV)$(TOOL_VCC140X86_CXX) -c -Yc\
|
---|
279 | $(flags) $(qaddprefix sh,-I, $(incs)) $(qaddprefix sh,-D, $(defs))\
|
---|
280 | $(if-expr defined($(target)_PCH_HDR),-FI$($(target)_PCH_HDR),)\
|
---|
281 | -Fp$($(target)_1_VCC_PCH_FILE) \
|
---|
282 | -Fd$($(target)_1_VCC_COMMON_OBJ_PDB) \
|
---|
283 | -Fo$(obj)\
|
---|
284 | -TP \
|
---|
285 | $(subst /,\\,$(abspath $(source)))
|
---|
286 | $(QUIET)$(DEP_OBJ) -f -s -q -e .pch -o $(dep) -t $(obj) $(obj)
|
---|
287 |
|
---|
288 | endef
|
---|
289 | endif # !TOOL_VCC140X86_KSUBMIT
|
---|
290 |
|
---|
291 |
|
---|
292 | ## @todo configure the assembler template.
|
---|
293 |
|
---|
294 | ## Compile resource source.
|
---|
295 | # @param $(target) Normalized main target name.
|
---|
296 | # @param $(source) Source filename (relative).
|
---|
297 | # @param $(obj) Object file name. This shall be (re)created by the compilation.
|
---|
298 | # @param $(dep) Dependcy file. This shall be (re)created by the compilation.
|
---|
299 | # @param $(flags) Flags.
|
---|
300 | # @param $(defs) Definitions. No -D or something.
|
---|
301 | # @param $(incs) Includes. No -I or something.
|
---|
302 | # @param $(dirdep) Directory creation dependency.
|
---|
303 | # @param $(deps) Other dependencies.
|
---|
304 | #
|
---|
305 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
306 | # @param $(objsuff) Object suffix.
|
---|
307 | TOOL_VCC140X86_COMPILE_RC_DEPEND =
|
---|
308 | TOOL_VCC140X86_COMPILE_RC_DEPORD =
|
---|
309 | TOOL_VCC140X86_COMPILE_RC_OUTPUT =
|
---|
310 | define TOOL_VCC140X86_COMPILE_RC_CMDS
|
---|
311 | $(QUIET)$(TOOL_VCC140X86_RC) \
|
---|
312 | $(flags) $(qaddprefix sh,/i, $(subst /,\\,$(incs))) $(qaddprefix sh,/d, $(defs))\
|
---|
313 | /fo$(obj)\
|
---|
314 | $(subst /,\\,$(abspath $(source)))
|
---|
315 | endef
|
---|
316 |
|
---|
317 |
|
---|
318 | ## Link library
|
---|
319 | # @param $(target) Normalized main target name.
|
---|
320 | # @param $(out) Library name.
|
---|
321 | # @param $(objs) Object files to put in the library.
|
---|
322 | # @param $(flags) Flags.
|
---|
323 | # @param $(dirdep) Directory creation dependency.
|
---|
324 | # @param $(deps) Other dependencies.
|
---|
325 | # @param $(othersrc) Unhandled sources.
|
---|
326 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
327 | #
|
---|
328 | TOOL_VCC140X86_LINK_LIBRARY_DEPEND = $(othersrc)
|
---|
329 | TOOL_VCC140X86_LINK_LIBRARY_DEPORD =
|
---|
330 | TOOL_VCC140X86_LINK_LIBRARY_OUTPUT = $(outbase).rsp
|
---|
331 | TOOL_VCC140X86_LINK_LIBRARY_OUTPUT_MAYBE = $(outbase).lst $(outbase).exp $(outbase).pdb
|
---|
332 | define TOOL_VCC140X86_LINK_LIBRARY_CMDS
|
---|
333 | $(QUIET)$(APPEND) -tn $(outbase).rsp \
|
---|
334 | $(qforeachfile u,arg, $(objs) $(filter-out %.def,$(othersrc)),$(quote-sh "$(subst /,\,$(arg))")) \
|
---|
335 | $(qforeachfile u,arg, $(filter %.def,$(othersrc)),$(quote-sh "/DEF:$(subst /,\,$(arg))"))
|
---|
336 | $(QUIET)$(TOOL_VCC140X86_KSUBMIT_DD) $(TOOL_VCC140X86_AR) $(flags) /OUT:$(out) @$(outbase).rsp
|
---|
337 | endef
|
---|
338 |
|
---|
339 |
|
---|
340 | ## Link program
|
---|
341 | # @param $(target) Normalized main target name.
|
---|
342 | # @param $(out) Program name.
|
---|
343 | # @param $(objs) Object files to link together.
|
---|
344 | # @param $(libs) Libraries to search.
|
---|
345 | # @param $(libpath) Library search paths.
|
---|
346 | # @param $(flags) Flags.
|
---|
347 | # @param $(dirdep) Directory creation dependency.
|
---|
348 | # @param $(deps) Other dependencies.
|
---|
349 | # @param $(othersrc) Unhandled sources.
|
---|
350 | # @param $(custom_pre) Custom step invoked before linking.
|
---|
351 | # @param $(custom_post) Custom step invoked after linking.
|
---|
352 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
353 | #
|
---|
354 | TOOL_VCC140X86_LINK_PROGRAM_DEPEND = $(foreachfile lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
|
---|
355 | TOOL_VCC140X86_LINK_PROGRAM_DEPORD =
|
---|
356 | TOOL_VCC140X86_LINK_PROGRAM_OUTPUT_MAYBE_PRECIOUS = $(outbase).map $(outbase).rsp
|
---|
357 | TOOL_VCC140X86_LINK_PROGRAM_OUTPUT_MAYBE = $(outbase).lib $(outbase).exp $(outbase).ilk $(out).manifest
|
---|
358 | TOOL_VCC140X86_LINK_PROGRAM_OUTPUT_DEBUG = $(outbase).pdb
|
---|
359 | TOOL_VCC140X86_LINK_PROGRAM_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
|
---|
360 | define TOOL_VCC140X86_LINK_PROGRAM_CMDS
|
---|
361 | $(QUIET)$(APPEND) -tn $(outbase).rsp \
|
---|
362 | $(qforeachfile u,arg, $(objs) $(libs),$(quote-sh "$(subst /,\,$(arg))"))
|
---|
363 | $(QUIET)$(TOOL_VCC140X86_KSUBMIT_DD) $(TOOL_VCC140X86_LD) $(flags) \
|
---|
364 | /OUT:$(out) \
|
---|
365 | /MAPINFO:EXPORTS /INCREMENTAL:NO \
|
---|
366 | /MAP:$(outbase).map \
|
---|
367 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
|
---|
368 | $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
|
---|
369 | $(qaddprefix sh,/LIBPATH:,$(libpath)) \
|
---|
370 | @$(outbase).rsp
|
---|
371 | ifndef TOOL_VCC140X86_NO_AUTO_MANIFEST
|
---|
372 | $(QUIET)$(TEST) -f $(out).manifest -- \
|
---|
373 | $(TOOL_VCC140X86_MT) -manifest $(subst /,\\,$(out)).manifest -outputresource:$(subst /,\\,$(out))
|
---|
374 | endif
|
---|
375 | endef
|
---|
376 |
|
---|
377 |
|
---|
378 | ## Link DLL.
|
---|
379 | # @param $(target) Normalized main target name.
|
---|
380 | # @param $(out) DLL name.
|
---|
381 | # @param $(objs) Object files to link together.
|
---|
382 | # @param $(libs) Libraries to search.
|
---|
383 | # @param $(libpath) Library search paths.
|
---|
384 | # @param $(flags) Flags.
|
---|
385 | # @param $(dirdep) Directory creation dependency.
|
---|
386 | # @param $(deps) Other dependencies.
|
---|
387 | # @param $(othersrc) Unhandled sources.
|
---|
388 | # @param $(custom_pre) Custom step invoked before linking.
|
---|
389 | # @param $(custom_post) Custom step invoked after linking.
|
---|
390 | #
|
---|
391 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
392 | TOOL_VCC140X86_LINK_DLL_DEPEND = $(foreachfile lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
|
---|
393 | TOOL_VCC140X86_LINK_DLL_DEPORD = $(call DIRDEP,$(PATH_STAGE_LIB))
|
---|
394 | TOOL_VCC140X86_LINK_DLL_OUTPUT = $(outbase).lib $(outbase).exp
|
---|
395 | TOOL_VCC140X86_LINK_DLL_OUTPUT_MAYBE = $(outbase).ilk $(out).manifest $(PATH_STAGE_LIB)/$(notdir $(outbase)).exp
|
---|
396 | TOOL_VCC140X86_LINK_DLL_OUTPUT_MAYBE_PRECIOUS = $(PATH_STAGE_LIB)/$(notdir $(outbase)).lib $(outbase).map $(outbase).rsp
|
---|
397 | TOOL_VCC140X86_LINK_DLL_OUTPUT_DEBUG = $(outbase).pdb
|
---|
398 | TOOL_VCC140X86_LINK_DLL_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
|
---|
399 | define TOOL_VCC140X86_LINK_DLL_CMDS
|
---|
400 | $(QUIET)$(APPEND) -tn $(outbase).rsp \
|
---|
401 | $(qforeachfile u,arg, $(objs) $(libs),$(quote-sh "$(subst /,\,$(arg))"))
|
---|
402 | $(QUIET)$(TOOL_VCC140X86_KSUBMIT_DD) $(TOOL_VCC140X86_LD) $(flags) \
|
---|
403 | /OUT:$(out) \
|
---|
404 | /IMPLIB:$(outbase).lib \
|
---|
405 | /MAPINFO:EXPORTS /INCREMENTAL:NO \
|
---|
406 | /MAP:$(outbase).map \
|
---|
407 | /DLL \
|
---|
408 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
|
---|
409 | $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
|
---|
410 | $(qaddprefix sh,/LIBPATH:,$(libpath)) \
|
---|
411 | @$(outbase).rsp
|
---|
412 | ifndef TOOL_VCC140X86_NO_AUTO_MANIFEST
|
---|
413 | $(QUIET)$(TEST) -f $(out).manifest -- \
|
---|
414 | $(TOOL_VCC140X86_MT) -manifest $(subst /,\\,$(out)).manifest '-outputresource:$(subst /,\\,$(out));#2'
|
---|
415 | endif
|
---|
416 | $(QUIET)$(TEST) -f $(outbase).lib -- $(KLIBTWEAKER_EXT) --clear-timestamps $(outbase).lib
|
---|
417 | $(QUIET)$(CP) --changed -v --ignore-non-existing $(outbase).exp $(outbase).lib $(PATH_STAGE_LIB)/
|
---|
418 | $(eval _DIRS += $(PATH_STAGE_LIB))
|
---|
419 | endef
|
---|
420 |
|
---|
421 |
|
---|
422 | ## Link system module (windows aka driver, linux aka kernel module)
|
---|
423 | # @param $(target) Normalized main target name.
|
---|
424 | # @param $(out) System module name.
|
---|
425 | # @param $(objs) Object files to link together.
|
---|
426 | # @param $(libs) Libraries to search.
|
---|
427 | # @param $(libpath) Library search paths.
|
---|
428 | # @param $(flags) Flags.
|
---|
429 | # @param $(dirdep) Directory creation dependency.
|
---|
430 | # @param $(deps) Other dependencies.
|
---|
431 | # @param $(othersrc) Unhandled sources.
|
---|
432 | # @param $(custom_pre) Custom step invoked before linking.
|
---|
433 | # @param $(custom_post) Custom step invoked after linking.
|
---|
434 | #
|
---|
435 | # @param $(outbase) Output basename (full). Use this for list files and such.
|
---|
436 | TOOL_VCC140X86_LINK_SYSMOD_DEPEND = $(foreachfile lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
|
---|
437 | TOOL_VCC140X86_LINK_SYSMOD_DEPORD =
|
---|
438 | TOOL_VCC140X86_LINK_SYSMOD_OUTPUT_MAYBE = $(outbase).lib $(outbase).exp $(outbase).ilk $(out).manifest
|
---|
439 | TOOL_VCC140X86_LINK_SYSMOD_OUTPUT_MAYBE_PRECIOUS = $(outbase).map $(outbase).rsp
|
---|
440 | TOOL_VCC140X86_LINK_SYSMOD_OUTPUT_DEBUG = $(outbase).pdb
|
---|
441 | TOOL_VCC140X86_LINK_SYSMOD_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
|
---|
442 | define TOOL_VCC140X86_LINK_SYSMOD_CMDS
|
---|
443 | $(QUIET)$(APPEND) -tn $(outbase).rsp \
|
---|
444 | $(qforeachfile u,arg, $(objs) $(libs),$(quote-sh "$(subst /,\,$(arg))"))
|
---|
445 | $(QUIET)$(TOOL_VCC140X86_KSUBMIT_DD) $(TOOL_VCC140X86_LD) $(flags) \
|
---|
446 | /OUT:$(out) \
|
---|
447 | /MAPINFO:EXPORTS /INCREMENTAL:NO \
|
---|
448 | /MAP:$(outbase).map \
|
---|
449 | $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
|
---|
450 | $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
|
---|
451 | $(qaddprefix sh,/LIBPATH:,$(libpath)) \
|
---|
452 | @$(outbase).rsp
|
---|
453 | ifndef TOOL_VCC140X86_NO_AUTO_MANIFEST
|
---|
454 | $(QUIET)$(TEST) -f $(out).manifest -- \
|
---|
455 | $(TOOL_VCC140X86_MT) -manifest $(subst /,\\,$(out)).manifest '-outputresource:$(subst /,\\,$(out));#2'
|
---|
456 | endif
|
---|
457 | endef
|
---|
458 |
|
---|