source: trunk/kBuild/tools/VCC100X86.kmk

Last change on this file 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
RevLine 
[434]1# $Id: VCC100X86.kmk 3313 2020-03-16 02:31:38Z bird $
2## @file
[2408]3# kBuild Tool Config - Visual C++ 10.0 (aka Visual 2010 and MSC v16), targeting x86.
[434]4#
[1547]5
6#
[3121]7# Copyright (c) 2004-2017 knut st. osmundsen <bird-kBuild-spam-xviiv@anduin.net>
[434]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#
[1547]26# As a special exception you are granted permission to include this file, via
[2182]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.
[1547]29# This exception does not however invalidate any other reasons why the makefile,
30# program, whatever should not be covered the GPL.
31#
32#
[434]33
[2408]34TOOL_VCC100X86 := Visual C++ 10.0 (aka Visual 2010 and MSC v16), targeting x86.
[434]35
[667]36# Tool Specific Properties
[2408]37ifndef PATH_TOOL_VCC100X86
[2726]38 PATH_TOOL_VCC100X86 := $(wildcard $(KBUILD_DEVTOOLS)/win.x86/vcc/v10*)
[2408]39 ifeq ($(PATH_TOOL_VCC100X86),)
40 PATH_TOOL_VCC100X86 := $(PATH_TOOL_VCC100)
[706]41 endif
[2408]42 ifeq ($(PATH_TOOL_VCC100X86),)
43 PATH_TOOL_VCC100X86 := $(PATH_TOOL_VCC100AMD64)
[667]44 endif
[2408]45 ifeq ($(PATH_TOOL_VCC100X86),)
[2726]46 PATH_TOOL_VCC100X86 := $(wildcard $(KBUILD_DEVTOOLS)/x86.win32/vcc/v10*)
[706]47 endif
[2408]48 ifeq ($(PATH_TOOL_VCC100X86),)
[2726]49 PATH_TOOL_VCC100X86 := $(wildcard $(KBUILD_DEVTOOLS)/win.amd64/vcc/v10*)
[857]50 endif
[2408]51 ifneq ($(PATH_TOOL_VCC100X86),)
52 PATH_TOOL_VCC100X86 := $(lastword $(sort $(PATH_TOOL_VCC100X86)))
[667]53 else
[2408]54 $(warning kBuild: PATH_TOOL_VCC100X86 cannot be determined!)
[2726]55 PATH_TOOL_VCC100X86 := $(KBUILD_DEVTOOLS)/x86.win/vcc/v10
[667]56 endif
57else
58 # Resolve any fancy stuff once and for all.
[2408]59 PATH_TOOL_VCC100X86 := $(PATH_TOOL_VCC100X86)
[667]60endif
[2408]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
[2902]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
[2408]72TOOL_VCC100X86_LD ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC100X86_BIN)/link.exe
[2622]73TOOL_VCC100X86_DUMPBIN ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC100X86_BIN)/dumpbin.exe
74TOOL_VCC100X86_EDITBIN ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC100X86_BIN)/editbin.exe
[2606]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)
[2870]77ifdef TOOL_VCC100X86_USE_KSUBMIT
78 ifeq ($(KBUILD_HOST),win)
[2895]79 TOOL_VCC100X86_KSUBMIT ?= kmk_builtin_kSubmit --32-bit
[3313]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) --
[2870]84 endif
85endif
[2604]86
87# The following in duplicated in VCC100.kmk and VCC100X86.kmk.
[2606]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)) \
[2604]93 $1))
[2606]94TOOL_VCC100_FN_FIND_SDK_TOOL = $(if-expr !defined($3),$(TOOL_VCC100_FN_FIND_SDK_TOOL_SUB),)$($3)
[2604]95
[735]96## Disabled fast DEP_IDB based dependencies.
[2408]97#VCC100X86_OLD_DEPS = 1
[434]98
99## Constructs the correct .pdb name (the name is lowercased).
100# @param $(1) Base name, no extention.
101# @param $(2) The extension.
[2408]102TOOL_VCC100X86_PDB = $(dir $(1))$(tolower $(notdir $(1))).$(2)
[434]103
[437]104
[667]105# General Properties used by kBuild
[2408]106TOOL_VCC100X86_COBJSUFF ?= .obj
[2953]107TOOL_VCC100X86_CFLAGS ?= -TC -nologo -Zi
108TOOL_VCC100X86_CFLAGS.debug ?=
109TOOL_VCC100X86_CFLAGS.dbgopt ?= -O2
[2408]110TOOL_VCC100X86_CFLAGS.release ?= -O2
111TOOL_VCC100X86_CFLAGS.profile ?= -O2
112TOOL_VCC100X86_CINCS ?= $(PATH_TOOL_VCC100X86_INC)
113TOOL_VCC100X86_CDEFS ?=
[434]114
[2408]115TOOL_VCC100X86_CXXOBJSUFF ?= .obj
[2953]116TOOL_VCC100X86_CXXFLAGS ?= -TP -nologo -Zi
117TOOL_VCC100X86_CXXFLAGS.debug ?=
118TOOL_VCC100X86_CXXFLAGS.dbgopt ?= -O2
[2408]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 ?=
[434]123
[2408]124TOOL_VCC100X86_ASOBJSUFF ?= .obj
[434]125
[2408]126TOOL_VCC100X86_RCOBJSUFF ?= .res
127TOOL_VCC100X86_RCINCS ?= $(PATH_TOOL_VCC100X86_INC) $(PATH_TOOL_VCC100X86_ATLMFC_INC)
[667]128
[2408]129TOOL_VCC100X86_ARFLAGS ?= -nologo
130TOOL_VCC100X86_ARLIBSUFF ?= .lib
[667]131
[2408]132TOOL_VCC100X86_LDFLAGS ?= -nologo -machine:x86
133TOOL_VCC100X86_LDFLAGS.debug ?= -debug
[2625]134TOOL_VCC100X86_LDFLAGS.dbgopt ?= -debug
135TOOL_VCC100X86_LDFLAGS.profile ?= -debug
[2408]136TOOL_VCC100X86_LDFLAGS.release ?=
[667]137
138
139
[434]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.
[2408]153TOOL_VCC100X86_COMPILE_C_DEPEND =
154TOOL_VCC100X86_COMPILE_C_DEPORD =
[2951]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
[3313]160 $(QUIET)$(TOOL_VCC100X86_KSUBMIT) $(TOOL_VCC100X86_KSUBMIT_SPECIAL_ENV) \
161 -P $(DEP_OBJ_INT) -f -s -q -o $(dep) -t $(obj) $(obj)\
[2895]162 -- $(TOOL_VCC100X86_CC) -c\
[434]163 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
164 -Fd$(outbase)-obj.pdb \
165 -Fo$(obj)\
[697]166 $(subst /,\\,$(abspath $(source)))
[2951]167 endef
168else
169 define TOOL_VCC100X86_COMPILE_C_CMDS
[2895]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)))
[2951]175 $(QUIET)$(DEP_OBJ) -f -s -q -o $(dep) -t $(obj) $(obj)
176 endef
177endif # !TOOL_VCC100X86_KSUBMIT
[434]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.
[2954]193TOOL_VCC100X86_COMPILE_CXX_DEPEND = $($(target)_1_VCC_PCH_FILE)
[2408]194TOOL_VCC100X86_COMPILE_CXX_DEPORD =
[2951]195TOOL_VCC100X86_COMPILE_CXX_OUTPUT =
[2954]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))
[2951]198ifdef TOOL_VCC100X86_KSUBMIT
199 TOOL_VCC100X86_COMPILE_CXX_DONT_PURGE_OUTPUT = 1 # speed
200 define TOOL_VCC100X86_COMPILE_CXX_CMDS
[3313]201 $(QUIET)$(TOOL_VCC100X86_KSUBMIT) $(TOOL_VCC100X86_KSUBMIT_SPECIAL_ENV) \
202 -P $(DEP_OBJ_INT) -f -s -q -o $(dep) -t $(obj) $(obj)\
[2895]203 -- $(TOOL_VCC100X86_CXX) -c\
[434]204 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
[2956]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) \
[434]208 -Fo$(obj)\
[697]209 $(subst /,\\,$(abspath $(source)))
[2951]210 endef
211else
212 define TOOL_VCC100X86_COMPILE_CXX_CMDS
[2895]213 $(QUIET)$(TOOL_VCC100X86_CXX) -c\
214 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
[2956]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) \
[2895]218 -Fo$(obj)\
219 $(subst /,\\,$(abspath $(source)))
[2951]220 $(QUIET)$(DEP_OBJ) -f -s -q -o $(dep) -t $(obj) $(obj)
221 endef
222endif # !TOOL_VCC100X86_KSUBMIT
[434]223
[2954]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)
[2964]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)
[2954]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
[3313]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)\
[2954]248 -- $(TOOL_VCC100X86_CXX) -c -Yc\
[2960]249 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
[2954]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
[667]270## @todo configure the assembler template.
[434]271
[641]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.
[2408]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) \
[641]290 $(flags) $(addprefix /i, $(subst /,\\,$(incs))) $(addprefix /d, $(defs))\
291 /fo$(obj)\
[697]292 $(subst /,\\,$(abspath $(source)))
[641]293endef
294
295
[434]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#
[2408]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
[2557]311 $(QUIET)$(APPEND) -tn $(outbase).rsp \
[768]312 $(foreach arg,\
313 $(subst /,\\,$(objs) \
314 $(filter-out %.def,$(othersrc))) \
315 $(addprefix /DEF:,$(filter %.def,$(othersrc))) \
316 ,\"$(arg)\")
[2902]317 $(QUIET)$(TOOL_VCC100X86_KSUBMIT_DD) $(TOOL_VCC100X86_AR) $(flags) /OUT:$(out) @$(outbase).rsp
[768]318endef
[434]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#
[2408]335TOOL_VCC100X86_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
336TOOL_VCC100X86_LINK_PROGRAM_DEPORD =
[3303]337TOOL_VCC100X86_LINK_PROGRAM_OUTPUT_MAYBE_PRECIOUS = $(outbase).map $(outbase).rsp
[2524]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
[2408]341define TOOL_VCC100X86_LINK_PROGRAM_CMDS
[2557]342 $(QUIET)$(APPEND) -tn $(outbase).rsp \
343 $(foreach arg,\
344 $(subst /,\\,$(objs)) \
345 $(subst /,\\,$(libs)) \
346 ,\"$(arg)\")
[2902]347 $(QUIET)$(TOOL_VCC100X86_KSUBMIT_DD) $(TOOL_VCC100X86_LD) $(flags) \
[434]348 /OUT:$(out) \
[437]349 /MAPINFO:EXPORTS /INCREMENTAL:NO \
[434]350 /MAP:$(outbase).map \
351 $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
352 $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
353 $(foreach p,$(libpath), /LIBPATH:$(p)) \
[2557]354 @$(outbase).rsp
[2735]355ifndef TOOL_VCC100X86_NO_AUTO_MANIFEST
[1295]356 $(QUIET)$(TEST) -f $(out).manifest -- \
[2408]357 $(TOOL_VCC100X86_MT) -manifest $(subst /,\\,$(out)).manifest -outputresource:$(subst /,\\,$(out))
[2735]358endif
[434]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.
[2408]376TOOL_VCC100X86_LINK_DLL_DEPEND = $(objs) $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
[2487]377TOOL_VCC100X86_LINK_DLL_DEPORD = $(call DIRDEP,$(PATH_STAGE_LIB))
[3303]378TOOL_VCC100X86_LINK_DLL_OUTPUT = $(outbase).lib $(outbase).exp
[2795]379TOOL_VCC100X86_LINK_DLL_OUTPUT_MAYBE = $(outbase).ilk $(out).manifest $(PATH_STAGE_LIB)/$(notdir $(outbase)).exp
[3303]380TOOL_VCC100X86_LINK_DLL_OUTPUT_MAYBE_PRECIOUS = $(PATH_STAGE_LIB)/$(notdir $(outbase)).lib $(outbase).map $(outbase).rsp
[2524]381TOOL_VCC100X86_LINK_DLL_OUTPUT_DEBUG = $(outbase).pdb
382TOOL_VCC100X86_LINK_DLL_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
[2408]383define TOOL_VCC100X86_LINK_DLL_CMDS
[2557]384 $(QUIET)$(APPEND) -tn $(outbase).rsp \
385 $(foreach arg,\
386 $(subst /,\\,$(objs)) \
387 $(subst /,\\,$(libs)) \
388 ,\"$(arg)\")
[2902]389 $(QUIET)$(TOOL_VCC100X86_KSUBMIT_DD) $(TOOL_VCC100X86_LD) $(flags) \
[434]390 /OUT:$(out) \
391 /IMPLIB:$(outbase).lib \
[437]392 /MAPINFO:EXPORTS /INCREMENTAL:NO \
[434]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)) \
[2557]398 @$(outbase).rsp
[2735]399ifndef TOOL_VCC100X86_NO_AUTO_MANIFEST
[1295]400 $(QUIET)$(TEST) -f $(out).manifest -- \
[2408]401 $(TOOL_VCC100X86_MT) -manifest $(subst /,\\,$(out)).manifest '-outputresource:$(subst /,\\,$(out));#2'
[2735]402endif
[2795]403 $(QUIET)$(TEST) -f $(outbase).lib -- $(KLIBTWEAKER_EXT) --clear-timestamps $(outbase).lib
[2487]404 $(QUIET)$(CP) --changed --ignore-non-existing $(outbase).exp $(outbase).lib $(PATH_STAGE_LIB)/
405$(eval _DIRS += $(PATH_STAGE_LIB))
[434]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.
[2408]423TOOL_VCC100X86_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
424TOOL_VCC100X86_LINK_SYSMOD_DEPORD =
[2524]425TOOL_VCC100X86_LINK_SYSMOD_OUTPUT_MAYBE = $(outbase).lib $(outbase).exp $(outbase).ilk $(out).manifest
[3303]426TOOL_VCC100X86_LINK_SYSMOD_OUTPUT_MAYBE_PRECIOUS = $(outbase).map $(outbase).rsp
[2524]427TOOL_VCC100X86_LINK_SYSMOD_OUTPUT_DEBUG = $(outbase).pdb
428TOOL_VCC100X86_LINK_SYSMOD_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
[2408]429define TOOL_VCC100X86_LINK_SYSMOD_CMDS
[2557]430 $(QUIET)$(APPEND) -tn $(outbase).rsp \
431 $(foreach arg,\
432 $(subst /,\\,$(objs)) \
433 $(subst /,\\,$(libs)) \
434 ,\"$(arg)\")
[2902]435 $(QUIET)$(TOOL_VCC100X86_KSUBMIT_DD) $(TOOL_VCC100X86_LD) $(flags) \
[434]436 /OUT:$(out) \
[437]437 /MAPINFO:EXPORTS /INCREMENTAL:NO \
[434]438 /MAP:$(outbase).map \
439 $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
440 $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
441 $(foreach p,$(libpath), /LIBPATH:$(p)) \
[2557]442 @$(outbase).rsp
[2735]443ifndef TOOL_VCC100X86_NO_AUTO_MANIFEST
[1295]444 $(QUIET)$(TEST) -f $(out).manifest -- \
[2408]445 $(TOOL_VCC100X86_MT) -manifest $(subst /,\\,$(out)).manifest '-outputresource:$(subst /,\\,$(out));#2'
[2735]446endif
[434]447endef
448
Note: See TracBrowser for help on using the repository browser.