source: trunk/kBuild/tools/VCC100X86.kmk@ 3497

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

kmk,kWorker: Assign processor groups to kWorker processes. Added --special-env hack for having a mspdbsrv.exe instance per processor group (using _MSPDBSRV_ENDPOINT_). This was complicated by PCH requiring to share .pdb file and therefore mspdbsrv.exe instance, requiring a mspdb100.dll re-init hack to disconnect kWorker from the previous mspdbsrv when switching. fun.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 19.4 KB
Line 
1# $Id: VCC100X86.kmk 3313 2020-03-16 02:31:38Z bird $
2## @file
3# kBuild Tool Config - Visual C++ 10.0 (aka Visual 2010 and MSC v16), targeting x86.
4#
5
6#
7# Copyright (c) 2004-2017 knut st. osmundsen <bird-kBuild-spam-xviiv@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
34TOOL_VCC100X86 := Visual C++ 10.0 (aka Visual 2010 and MSC v16), targeting x86.
35
36# Tool Specific Properties
37ifndef PATH_TOOL_VCC100X86
38 PATH_TOOL_VCC100X86 := $(wildcard $(KBUILD_DEVTOOLS)/win.x86/vcc/v10*)
39 ifeq ($(PATH_TOOL_VCC100X86),)
40 PATH_TOOL_VCC100X86 := $(PATH_TOOL_VCC100)
41 endif
42 ifeq ($(PATH_TOOL_VCC100X86),)
43 PATH_TOOL_VCC100X86 := $(PATH_TOOL_VCC100AMD64)
44 endif
45 ifeq ($(PATH_TOOL_VCC100X86),)
46 PATH_TOOL_VCC100X86 := $(wildcard $(KBUILD_DEVTOOLS)/x86.win32/vcc/v10*)
47 endif
48 ifeq ($(PATH_TOOL_VCC100X86),)
49 PATH_TOOL_VCC100X86 := $(wildcard $(KBUILD_DEVTOOLS)/win.amd64/vcc/v10*)
50 endif
51 ifneq ($(PATH_TOOL_VCC100X86),)
52 PATH_TOOL_VCC100X86 := $(lastword $(sort $(PATH_TOOL_VCC100X86)))
53 else
54 $(warning kBuild: PATH_TOOL_VCC100X86 cannot be determined!)
55 PATH_TOOL_VCC100X86 := $(KBUILD_DEVTOOLS)/x86.win/vcc/v10
56 endif
57else
58 # Resolve any fancy stuff once and for all.
59 PATH_TOOL_VCC100X86 := $(PATH_TOOL_VCC100X86)
60endif
61PATH_TOOL_VCC100X86_BIN ?= $(PATH_TOOL_VCC100X86)/bin
62PATH_TOOL_VCC100X86_LIB ?= $(PATH_TOOL_VCC100X86)/lib
63PATH_TOOL_VCC100X86_INC ?= $(PATH_TOOL_VCC100X86)/include
64PATH_TOOL_VCC100X86_ATLMFC ?= $(PATH_TOOL_VCC100X86)/atlmfc
65PATH_TOOL_VCC100X86_ATLMFC_INC ?= $(PATH_TOOL_VCC100X86_ATLMFC)/include
66PATH_TOOL_VCC100X86_ATLMFC_LIB ?= $(PATH_TOOL_VCC100X86_ATLMFC)/lib
67TOOL_VCC100X86_CC ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC100X86_BIN)/cl.exe
68TOOL_VCC100X86_CXX ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC100X86_BIN)/cl.exe
69TOOL_VCC100X86_AS ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC100X86_BIN)/ml.exe
70#TOOL_VCC100X86_AR ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC100X86_BIN)/lib.exe - just an exec wrapper for the below
71TOOL_VCC100X86_AR ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC100X86_BIN)/link.exe /LIB
72TOOL_VCC100X86_LD ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC100X86_BIN)/link.exe
73TOOL_VCC100X86_DUMPBIN ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC100X86_BIN)/dumpbin.exe
74TOOL_VCC100X86_EDITBIN ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC100X86_BIN)/editbin.exe
75TOOL_VCC100X86_RC ?= $(EXEC_X86_WIN32) $(call TOOL_VCC100_FN_FIND_SDK_TOOL,rc.exe,[Rr][Cc].[Ee][Xx][Ee],TOOL_VCC100_RC_CACHED)
76TOOL_VCC100X86_MT ?= $(EXEC_X86_WIN32) $(call TOOL_VCC100_FN_FIND_SDK_TOOL,mt.exe,[Mm][Tt].[Ee][Xx][Ee],TOOL_VCC100_MT_CACHED)
77ifdef TOOL_VCC100X86_USE_KSUBMIT
78 ifeq ($(KBUILD_HOST),win)
79 TOOL_VCC100X86_KSUBMIT ?= kmk_builtin_kSubmit --32-bit
80 if $(KBUILD_KMK_REVISION) > 3311
81 TOOL_VCC100X86_KSUBMIT_SPECIAL_ENV = -s "_MSPDBSRV_ENDPOINT_=kBuild_vcc10_x86_@@AUTHENTICATION_ID@@_$(if-expr defined($(target)_1_VCC_COMMON_OBJ_PDB),common,@@PROCESS_GROUP@@)"
82 endif
83 TOOL_VCC100X86_KSUBMIT_DD = $(TOOL_VCC100X86_KSUBMIT) $(TOOL_VCC100X86_KSUBMIT_SPECIAL_ENV) --
84 endif
85endif
86
87# The following in duplicated in VCC100.kmk and VCC100X86.kmk.
88TOOL_VCC100_FN_FIND_SDK_TOOL_SUB = $(eval $3 := $(firstword \
89 $(if-expr defined(PATH_SDK_WINPSDK71_BIN), $(wildcard $(PATH_SDK_WINPSDK71_BIN)/$2)) \
90 $(if-expr defined(PATH_SDK_WINPSDK_BIN) , $(wildcard $(PATH_SDK_WINPSDK_BIN)/$2)) \
91 $(rsort $(wildcard $(KBUILD_DEVTOOLS_HST)/sdk/*/[Bb][Ii][Nn]/$2)) \
92 $(rsort $(wildcard $(KBUILD_DEVTOOLS_HST_ALT)/sdk/*/[Bb][Ii][Nn]/$2)) \
93 $1))
94TOOL_VCC100_FN_FIND_SDK_TOOL = $(if-expr !defined($3),$(TOOL_VCC100_FN_FIND_SDK_TOOL_SUB),)$($3)
95
96## Disabled fast DEP_IDB based dependencies.
97#VCC100X86_OLD_DEPS = 1
98
99## Constructs the correct .pdb name (the name is lowercased).
100# @param $(1) Base name, no extention.
101# @param $(2) The extension.
102TOOL_VCC100X86_PDB = $(dir $(1))$(tolower $(notdir $(1))).$(2)
103
104
105# General Properties used by kBuild
106TOOL_VCC100X86_COBJSUFF ?= .obj
107TOOL_VCC100X86_CFLAGS ?= -TC -nologo -Zi
108TOOL_VCC100X86_CFLAGS.debug ?=
109TOOL_VCC100X86_CFLAGS.dbgopt ?= -O2
110TOOL_VCC100X86_CFLAGS.release ?= -O2
111TOOL_VCC100X86_CFLAGS.profile ?= -O2
112TOOL_VCC100X86_CINCS ?= $(PATH_TOOL_VCC100X86_INC)
113TOOL_VCC100X86_CDEFS ?=
114
115TOOL_VCC100X86_CXXOBJSUFF ?= .obj
116TOOL_VCC100X86_CXXFLAGS ?= -TP -nologo -Zi
117TOOL_VCC100X86_CXXFLAGS.debug ?=
118TOOL_VCC100X86_CXXFLAGS.dbgopt ?= -O2
119TOOL_VCC100X86_CXXFLAGS.release ?= -O2
120TOOL_VCC100X86_CXXFLAGS.profile ?= -O2
121TOOL_VCC100X86_CXXINCS ?= $(PATH_TOOL_VCC100X86_INC) $(PATH_TOOL_VCC100X86_ATLMFC_INC)
122TOOL_VCC100X86_CXXDEFS ?=
123
124TOOL_VCC100X86_ASOBJSUFF ?= .obj
125
126TOOL_VCC100X86_RCOBJSUFF ?= .res
127TOOL_VCC100X86_RCINCS ?= $(PATH_TOOL_VCC100X86_INC) $(PATH_TOOL_VCC100X86_ATLMFC_INC)
128
129TOOL_VCC100X86_ARFLAGS ?= -nologo
130TOOL_VCC100X86_ARLIBSUFF ?= .lib
131
132TOOL_VCC100X86_LDFLAGS ?= -nologo -machine:x86
133TOOL_VCC100X86_LDFLAGS.debug ?= -debug
134TOOL_VCC100X86_LDFLAGS.dbgopt ?= -debug
135TOOL_VCC100X86_LDFLAGS.profile ?= -debug
136TOOL_VCC100X86_LDFLAGS.release ?=
137
138
139
140## Compile C source.
141# @param $(target) Normalized main target name.
142# @param $(source) Source filename (relative).
143# @param $(obj) Object file name. This shall be (re)created by the compilation.
144# @param $(dep) Dependcy file. This shall be (re)created by the compilation.
145# @param $(flags) Flags.
146# @param $(defs) Definitions. No -D or something.
147# @param $(incs) Includes. No -I or something.
148# @param $(dirdep) Directory creation dependency.
149# @param $(deps) Other dependencies.
150#
151# @param $(outbase) Output basename (full). Use this for list files and such.
152# @param $(objsuff) Object suffix.
153TOOL_VCC100X86_COMPILE_C_DEPEND =
154TOOL_VCC100X86_COMPILE_C_DEPORD =
155TOOL_VCC100X86_COMPILE_C_OUTPUT =
156TOOL_VCC100X86_COMPILE_C_OUTPUT_MAYBE = $(call TOOL_VCC100X86_PDB, $(outbase)-obj,pdb) $(call TOOL_VCC100X86_PDB, $(outbase)-obj,idb)
157ifdef TOOL_VCC100X86_KSUBMIT
158 TOOL_VCC100X86_COMPILE_C_DONT_PURGE_OUTPUT = 1 # speed
159 define TOOL_VCC100X86_COMPILE_C_CMDS
160 $(QUIET)$(TOOL_VCC100X86_KSUBMIT) $(TOOL_VCC100X86_KSUBMIT_SPECIAL_ENV) \
161 -P $(DEP_OBJ_INT) -f -s -q -o $(dep) -t $(obj) $(obj)\
162 -- $(TOOL_VCC100X86_CC) -c\
163 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
164 -Fd$(outbase)-obj.pdb \
165 -Fo$(obj)\
166 $(subst /,\\,$(abspath $(source)))
167 endef
168else
169 define TOOL_VCC100X86_COMPILE_C_CMDS
170 $(QUIET)$(TOOL_VCC100X86_CC) -c\
171 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
172 -Fd$(outbase)-obj.pdb \
173 -Fo$(obj)\
174 $(subst /,\\,$(abspath $(source)))
175 $(QUIET)$(DEP_OBJ) -f -s -q -o $(dep) -t $(obj) $(obj)
176 endef
177endif # !TOOL_VCC100X86_KSUBMIT
178
179
180## Compile C++ source.
181# @param $(target) Normalized main target name.
182# @param $(source) Source filename (relative).
183# @param $(obj) Object file name. This shall be (re)created by the compilation.
184# @param $(dep) Dependcy file. This shall be (re)created by the compilation.
185# @param $(flags) Flags.
186# @param $(defs) Definitions. No -D or something.
187# @param $(incs) Includes. No -I or something.
188# @param $(dirdep) Directory creation dependency.
189# @param $(deps) Other dependencies.
190#
191# @param $(outbase) Output basename (full). Use this for list files and such.
192# @param $(objsuff) Object suffix.
193TOOL_VCC100X86_COMPILE_CXX_DEPEND = $($(target)_1_VCC_PCH_FILE)
194TOOL_VCC100X86_COMPILE_CXX_DEPORD =
195TOOL_VCC100X86_COMPILE_CXX_OUTPUT =
196TOOL_VCC100X86_COMPILE_CXX_OUTPUT_MAYBE = $(if-expr defined($(target)_1_VCC_COMMON_OBJ_PDB)\
197 ,,$(call TOOL_VCC100X86_PDB, $(outbase)-obj,pdb) $(call TOOL_VCC100X86_PDB, $(outbase)-obj,idb))
198ifdef TOOL_VCC100X86_KSUBMIT
199 TOOL_VCC100X86_COMPILE_CXX_DONT_PURGE_OUTPUT = 1 # speed
200 define TOOL_VCC100X86_COMPILE_CXX_CMDS
201 $(QUIET)$(TOOL_VCC100X86_KSUBMIT) $(TOOL_VCC100X86_KSUBMIT_SPECIAL_ENV) \
202 -P $(DEP_OBJ_INT) -f -s -q -o $(dep) -t $(obj) $(obj)\
203 -- $(TOOL_VCC100X86_CXX) -c\
204 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
205 $(if-expr defined($(target)_PCH_HDR)\
206 ,-FI$($(target)_PCH_HDR) -Yu$($(target)_PCH_HDR) -Fp$($(target)_1_VCC_PCH_FILE),)\
207 -Fd$(if-expr defined($(target)_1_VCC_COMMON_OBJ_PDB),$($(target)_1_VCC_COMMON_OBJ_PDB),$(outbase)-obj.pdb) \
208 -Fo$(obj)\
209 $(subst /,\\,$(abspath $(source)))
210 endef
211else
212 define TOOL_VCC100X86_COMPILE_CXX_CMDS
213 $(QUIET)$(TOOL_VCC100X86_CXX) -c\
214 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
215 $(if-expr defined($(target)_PCH_HDR)\
216 ,-FI$($(target)_PCH_HDR) -Yu$($(target)_PCH_HDR) -Fp$($(target)_1_VCC_PCH_FILE),)\
217 -Fd$(if-expr defined($(target)_1_VCC_COMMON_OBJ_PDB),$($(target)_1_VCC_COMMON_OBJ_PDB),$(outbase)-obj.pdb) \
218 -Fo$(obj)\
219 $(subst /,\\,$(abspath $(source)))
220 $(QUIET)$(DEP_OBJ) -f -s -q -o $(dep) -t $(obj) $(obj)
221 endef
222endif # !TOOL_VCC100X86_KSUBMIT
223
224
225#
226# Helper tool for creating the precompiled C++ header.
227#
228# It only have the C++ compile bits and it's purpose is to skip bits
229# related _1_VCC_PCH_FILE and add -Yc.
230#
231TOOL_VCC100X86-PCH := Helper for creating precompiled header using CXX handling.
232TOOL_VCC100X86-PCH_EXTENDS := VCC100X86
233TOOL_VCC100X86-PCH_CXXOBJSUFF := .obj
234TOOL_VCC100X86-PCH_CXXINCS = $(TOOL_VCC100X86_CXXINCS)
235TOOL_VCC100X86-PCH_CXXFLAGS.debug = $(TOOL_VCC100X86_CXXFLAGS.debug)
236TOOL_VCC100X86-PCH_CXXFLAGS.dbgopt = $(TOOL_VCC100X86_CXXFLAGS.dbgopt)
237TOOL_VCC100X86-PCH_CXXFLAGS.release = $(TOOL_VCC100X86_CXXFLAGS.release)
238TOOL_VCC100X86-PCH_CXXFLAGS.profile = $(TOOL_VCC100X86_CXXFLAGS.profile)
239TOOL_VCC100X86-PCH_COMPILE_CXX_DEPEND = $(NO_SUCH_VARIABLE)
240TOOL_VCC100X86-PCH_COMPILE_CXX_DEPORD = $(NO_SUCH_VARIABLE)
241TOOL_VCC100X86-PCH_COMPILE_CXX_OUTPUT = $($(target)_1_VCC_PCH_FILE) $($(target)_1_VCC_COMMON_OBJ_PDB)
242TOOL_VCC100X86-PCH_COMPILE_CXX_OUTPUT_MAYBE = $(NO_SUCH_VARIABLE)
243ifdef TOOL_VCC100X86_KSUBMIT
244 define TOOL_VCC100X86-PCH_COMPILE_CXX_CMDS
245 $(RM) -f -- "$($(target)_1_VCC_COMMON_OBJ_PDB)"
246 $(QUIET)$(TOOL_VCC100X86_KSUBMIT) --no-pch-caching $(TOOL_VCC100X86_KSUBMIT_SPECIAL_ENV) \
247 -P $(DEP_OBJ_INT) -f -s -q -e .pch -o $(dep) -t $(obj) $(obj)\
248 -- $(TOOL_VCC100X86_CXX) -c -Yc\
249 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
250 -Fp$($(target)_1_VCC_PCH_FILE) \
251 -Fd$($(target)_1_VCC_COMMON_OBJ_PDB) \
252 -Fo$(obj)\
253 -TP \
254 $(subst /,\\,$(abspath $(source)))
255 endef
256else
257 define TOOL_VCC100X86-PCH_COMPILE_CXX_CMDS
258 $(QUIET)$(TOOL_VCC100X86_CXX) -c -Yc\
259 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
260 -Fp$($(target)_1_VCC_PCH_FILE) \
261 -Fd$($(target)_1_VCC_COMMON_OBJ_PDB) \
262 -Fo$(obj)\
263 -TP \
264 $(subst /,\\,$(abspath $(source)))
265 $(QUIET)$(DEP_OBJ) -f -s -q -e .pch -o $(dep) -t $(obj) $(obj)
266 endef
267endif # !TOOL_VCC100X86_KSUBMIT
268
269
270## @todo configure the assembler template.
271
272## Compile resource source.
273# @param $(target) Normalized main target name.
274# @param $(source) Source filename (relative).
275# @param $(obj) Object file name. This shall be (re)created by the compilation.
276# @param $(dep) Dependcy file. This shall be (re)created by the compilation.
277# @param $(flags) Flags.
278# @param $(defs) Definitions. No -D or something.
279# @param $(incs) Includes. No -I or something.
280# @param $(dirdep) Directory creation dependency.
281# @param $(deps) Other dependencies.
282#
283# @param $(outbase) Output basename (full). Use this for list files and such.
284# @param $(objsuff) Object suffix.
285TOOL_VCC100X86_COMPILE_RC_DEPEND =
286TOOL_VCC100X86_COMPILE_RC_DEPORD =
287TOOL_VCC100X86_COMPILE_RC_OUTPUT =
288define TOOL_VCC100X86_COMPILE_RC_CMDS
289 $(QUIET)$(TOOL_VCC100X86_RC) \
290 $(flags) $(addprefix /i, $(subst /,\\,$(incs))) $(addprefix /d, $(defs))\
291 /fo$(obj)\
292 $(subst /,\\,$(abspath $(source)))
293endef
294
295
296## Link library
297# @param $(target) Normalized main target name.
298# @param $(out) Library name.
299# @param $(objs) Object files to put in the library.
300# @param $(flags) Flags.
301# @param $(dirdep) Directory creation dependency.
302# @param $(deps) Other dependencies.
303# @param $(othersrc) Unhandled sources.
304# @param $(outbase) Output basename (full). Use this for list files and such.
305#
306TOOL_VCC100X86_LINK_LIBRARY_DEPEND = $(othersrc)
307TOOL_VCC100X86_LINK_LIBRARY_DEPORD =
308TOOL_VCC100X86_LINK_LIBRARY_OUTPUT = $(outbase).rsp
309TOOL_VCC100X86_LINK_LIBRARY_OUTPUT_MAYBE = $(outbase).lst $(outbase).exp $(outbase).pdb
310define TOOL_VCC100X86_LINK_LIBRARY_CMDS
311 $(QUIET)$(APPEND) -tn $(outbase).rsp \
312 $(foreach arg,\
313 $(subst /,\\,$(objs) \
314 $(filter-out %.def,$(othersrc))) \
315 $(addprefix /DEF:,$(filter %.def,$(othersrc))) \
316 ,\"$(arg)\")
317 $(QUIET)$(TOOL_VCC100X86_KSUBMIT_DD) $(TOOL_VCC100X86_AR) $(flags) /OUT:$(out) @$(outbase).rsp
318endef
319
320
321## Link program
322# @param $(target) Normalized main target name.
323# @param $(out) Program name.
324# @param $(objs) Object files to link together.
325# @param $(libs) Libraries to search.
326# @param $(libpath) Library search paths.
327# @param $(flags) Flags.
328# @param $(dirdep) Directory creation dependency.
329# @param $(deps) Other dependencies.
330# @param $(othersrc) Unhandled sources.
331# @param $(custom_pre) Custom step invoked before linking.
332# @param $(custom_post) Custom step invoked after linking.
333# @param $(outbase) Output basename (full). Use this for list files and such.
334#
335TOOL_VCC100X86_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
336TOOL_VCC100X86_LINK_PROGRAM_DEPORD =
337TOOL_VCC100X86_LINK_PROGRAM_OUTPUT_MAYBE_PRECIOUS = $(outbase).map $(outbase).rsp
338TOOL_VCC100X86_LINK_PROGRAM_OUTPUT_MAYBE = $(outbase).lib $(outbase).exp $(outbase).ilk $(out).manifest
339TOOL_VCC100X86_LINK_PROGRAM_OUTPUT_DEBUG = $(outbase).pdb
340TOOL_VCC100X86_LINK_PROGRAM_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
341define TOOL_VCC100X86_LINK_PROGRAM_CMDS
342 $(QUIET)$(APPEND) -tn $(outbase).rsp \
343 $(foreach arg,\
344 $(subst /,\\,$(objs)) \
345 $(subst /,\\,$(libs)) \
346 ,\"$(arg)\")
347 $(QUIET)$(TOOL_VCC100X86_KSUBMIT_DD) $(TOOL_VCC100X86_LD) $(flags) \
348 /OUT:$(out) \
349 /MAPINFO:EXPORTS /INCREMENTAL:NO \
350 /MAP:$(outbase).map \
351 $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
352 $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
353 $(foreach p,$(libpath), /LIBPATH:$(p)) \
354 @$(outbase).rsp
355ifndef TOOL_VCC100X86_NO_AUTO_MANIFEST
356 $(QUIET)$(TEST) -f $(out).manifest -- \
357 $(TOOL_VCC100X86_MT) -manifest $(subst /,\\,$(out)).manifest -outputresource:$(subst /,\\,$(out))
358endif
359endef
360
361
362## Link DLL.
363# @param $(target) Normalized main target name.
364# @param $(out) DLL name.
365# @param $(objs) Object files to link together.
366# @param $(libs) Libraries to search.
367# @param $(libpath) Library search paths.
368# @param $(flags) Flags.
369# @param $(dirdep) Directory creation dependency.
370# @param $(deps) Other dependencies.
371# @param $(othersrc) Unhandled sources.
372# @param $(custom_pre) Custom step invoked before linking.
373# @param $(custom_post) Custom step invoked after linking.
374#
375# @param $(outbase) Output basename (full). Use this for list files and such.
376TOOL_VCC100X86_LINK_DLL_DEPEND = $(objs) $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
377TOOL_VCC100X86_LINK_DLL_DEPORD = $(call DIRDEP,$(PATH_STAGE_LIB))
378TOOL_VCC100X86_LINK_DLL_OUTPUT = $(outbase).lib $(outbase).exp
379TOOL_VCC100X86_LINK_DLL_OUTPUT_MAYBE = $(outbase).ilk $(out).manifest $(PATH_STAGE_LIB)/$(notdir $(outbase)).exp
380TOOL_VCC100X86_LINK_DLL_OUTPUT_MAYBE_PRECIOUS = $(PATH_STAGE_LIB)/$(notdir $(outbase)).lib $(outbase).map $(outbase).rsp
381TOOL_VCC100X86_LINK_DLL_OUTPUT_DEBUG = $(outbase).pdb
382TOOL_VCC100X86_LINK_DLL_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
383define TOOL_VCC100X86_LINK_DLL_CMDS
384 $(QUIET)$(APPEND) -tn $(outbase).rsp \
385 $(foreach arg,\
386 $(subst /,\\,$(objs)) \
387 $(subst /,\\,$(libs)) \
388 ,\"$(arg)\")
389 $(QUIET)$(TOOL_VCC100X86_KSUBMIT_DD) $(TOOL_VCC100X86_LD) $(flags) \
390 /OUT:$(out) \
391 /IMPLIB:$(outbase).lib \
392 /MAPINFO:EXPORTS /INCREMENTAL:NO \
393 /MAP:$(outbase).map \
394 /DLL \
395 $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
396 $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
397 $(foreach p,$(libpath), /LIBPATH:$(p)) \
398 @$(outbase).rsp
399ifndef TOOL_VCC100X86_NO_AUTO_MANIFEST
400 $(QUIET)$(TEST) -f $(out).manifest -- \
401 $(TOOL_VCC100X86_MT) -manifest $(subst /,\\,$(out)).manifest '-outputresource:$(subst /,\\,$(out));#2'
402endif
403 $(QUIET)$(TEST) -f $(outbase).lib -- $(KLIBTWEAKER_EXT) --clear-timestamps $(outbase).lib
404 $(QUIET)$(CP) --changed --ignore-non-existing $(outbase).exp $(outbase).lib $(PATH_STAGE_LIB)/
405$(eval _DIRS += $(PATH_STAGE_LIB))
406endef
407
408
409## Link system module (windows aka driver, linux aka kernel module)
410# @param $(target) Normalized main target name.
411# @param $(out) System module name.
412# @param $(objs) Object files to link together.
413# @param $(libs) Libraries to search.
414# @param $(libpath) Library search paths.
415# @param $(flags) Flags.
416# @param $(dirdep) Directory creation dependency.
417# @param $(deps) Other dependencies.
418# @param $(othersrc) Unhandled sources.
419# @param $(custom_pre) Custom step invoked before linking.
420# @param $(custom_post) Custom step invoked after linking.
421#
422# @param $(outbase) Output basename (full). Use this for list files and such.
423TOOL_VCC100X86_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
424TOOL_VCC100X86_LINK_SYSMOD_DEPORD =
425TOOL_VCC100X86_LINK_SYSMOD_OUTPUT_MAYBE = $(outbase).lib $(outbase).exp $(outbase).ilk $(out).manifest
426TOOL_VCC100X86_LINK_SYSMOD_OUTPUT_MAYBE_PRECIOUS = $(outbase).map $(outbase).rsp
427TOOL_VCC100X86_LINK_SYSMOD_OUTPUT_DEBUG = $(outbase).pdb
428TOOL_VCC100X86_LINK_SYSMOD_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
429define TOOL_VCC100X86_LINK_SYSMOD_CMDS
430 $(QUIET)$(APPEND) -tn $(outbase).rsp \
431 $(foreach arg,\
432 $(subst /,\\,$(objs)) \
433 $(subst /,\\,$(libs)) \
434 ,\"$(arg)\")
435 $(QUIET)$(TOOL_VCC100X86_KSUBMIT_DD) $(TOOL_VCC100X86_LD) $(flags) \
436 /OUT:$(out) \
437 /MAPINFO:EXPORTS /INCREMENTAL:NO \
438 /MAP:$(outbase).map \
439 $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
440 $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
441 $(foreach p,$(libpath), /LIBPATH:$(p)) \
442 @$(outbase).rsp
443ifndef TOOL_VCC100X86_NO_AUTO_MANIFEST
444 $(QUIET)$(TEST) -f $(out).manifest -- \
445 $(TOOL_VCC100X86_MT) -manifest $(subst /,\\,$(out)).manifest '-outputresource:$(subst /,\\,$(out));#2'
446endif
447endef
448
Note: See TracBrowser for help on using the repository browser.