source: trunk/kBuild/tools/VCC120X86.kmk@ 3033

Last change on this file since 3033 was 3033, checked in by bird, 8 years ago

tools: Created VCC120 from VCC100, only difference is the -FS flag for precompiled header related operations.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 19.0 KB
Line 
1# $Id: VCC120X86.kmk 3033 2017-05-08 17:03:48Z bird $
2## @file
3# kBuild Tool Config - Visual C++ 12.0 (aka Visual 2013 and MSC v18), targeting x86.
4#
5
6#
7# Copyright (c) 2004-2017 knut st. osmundsen <bird-kBuild-spam-xiv@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_VCC120X86 := Visual C++ 12.0 (aka Visual 2013 and MSC v18), targeting x86.
35
36# Tool Specific Properties
37ifndef PATH_TOOL_VCC120X86
38 PATH_TOOL_VCC120X86 := $(wildcard $(KBUILD_DEVTOOLS)/win.x86/vcc/v12*)
39 ifeq ($(PATH_TOOL_VCC120X86),)
40 PATH_TOOL_VCC120X86 := $(PATH_TOOL_VCC120)
41 endif
42 ifeq ($(PATH_TOOL_VCC120X86),)
43 PATH_TOOL_VCC120X86 := $(PATH_TOOL_VCC120AMD64)
44 endif
45 ifeq ($(PATH_TOOL_VCC120X86),)
46 PATH_TOOL_VCC120X86 := $(wildcard $(KBUILD_DEVTOOLS)/x86.win32/vcc/v12*)
47 endif
48 ifeq ($(PATH_TOOL_VCC120X86),)
49 PATH_TOOL_VCC120X86 := $(wildcard $(KBUILD_DEVTOOLS)/win.amd64/vcc/v12*)
50 endif
51 ifneq ($(PATH_TOOL_VCC120X86),)
52 PATH_TOOL_VCC120X86 := $(lastword $(sort $(PATH_TOOL_VCC120X86)))
53 else
54 $(warning kBuild: PATH_TOOL_VCC120X86 cannot be determined!)
55 PATH_TOOL_VCC120X86 := $(KBUILD_DEVTOOLS)/x86.win/vcc/v12
56 endif
57else
58 # Resolve any fancy stuff once and for all.
59 PATH_TOOL_VCC120X86 := $(PATH_TOOL_VCC120X86)
60endif
61PATH_TOOL_VCC120X86_BIN ?= $(PATH_TOOL_VCC120X86)/bin
62PATH_TOOL_VCC120X86_LIB ?= $(PATH_TOOL_VCC120X86)/lib
63PATH_TOOL_VCC120X86_INC ?= $(PATH_TOOL_VCC120X86)/include
64PATH_TOOL_VCC120X86_ATLMFC ?= $(PATH_TOOL_VCC120X86)/atlmfc
65PATH_TOOL_VCC120X86_ATLMFC_INC ?= $(PATH_TOOL_VCC120X86_ATLMFC)/include
66PATH_TOOL_VCC120X86_ATLMFC_LIB ?= $(PATH_TOOL_VCC120X86_ATLMFC)/lib
67TOOL_VCC120X86_CC ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC120X86_BIN)/cl.exe
68TOOL_VCC120X86_CXX ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC120X86_BIN)/cl.exe
69TOOL_VCC120X86_AS ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC120X86_BIN)/ml.exe
70#TOOL_VCC120X86_AR ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC120X86_BIN)/lib.exe - just an exec wrapper for the below
71TOOL_VCC120X86_AR ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC120X86_BIN)/link.exe /LIB
72TOOL_VCC120X86_LD ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC120X86_BIN)/link.exe
73TOOL_VCC120X86_DUMPBIN ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC120X86_BIN)/dumpbin.exe
74TOOL_VCC120X86_EDITBIN ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC120X86_BIN)/editbin.exe
75TOOL_VCC120X86_RC ?= $(EXEC_X86_WIN32) $(call TOOL_VCC120_FN_FIND_SDK_TOOL,rc.exe,[Rr][Cc].[Ee][Xx][Ee],TOOL_VCC120_RC_CACHED)
76TOOL_VCC120X86_MT ?= $(EXEC_X86_WIN32) $(call TOOL_VCC120_FN_FIND_SDK_TOOL,mt.exe,[Mm][Tt].[Ee][Xx][Ee],TOOL_VCC120_MT_CACHED)
77ifdef TOOL_VCC120X86_USE_KSUBMIT
78 ifeq ($(KBUILD_HOST),win)
79 TOOL_VCC120X86_KSUBMIT ?= kmk_builtin_kSubmit --32-bit
80 TOOL_VCC120X86_KSUBMIT_DD = $(TOOL_VCC120X86_KSUBMIT) --
81 endif
82endif
83
84# The following in duplicated in VCC120.kmk and VCC120X86.kmk.
85TOOL_VCC120_FN_FIND_SDK_TOOL_SUB = $(eval $3 := $(firstword \
86 $(if-expr defined(PATH_SDK_WINPSDK71_BIN), $(wildcard $(PATH_SDK_WINPSDK71_BIN)/$2)) \
87 $(if-expr defined(PATH_SDK_WINPSDK_BIN) , $(wildcard $(PATH_SDK_WINPSDK_BIN)/$2)) \
88 $(rsort $(wildcard $(KBUILD_DEVTOOLS_HST)/sdk/*/[Bb][Ii][Nn]/$2)) \
89 $(rsort $(wildcard $(KBUILD_DEVTOOLS_HST_ALT)/sdk/*/[Bb][Ii][Nn]/$2)) \
90 $1))
91TOOL_VCC120_FN_FIND_SDK_TOOL = $(if-expr !defined($3),$(TOOL_VCC120_FN_FIND_SDK_TOOL_SUB),)$($3)
92
93## Disabled fast DEP_IDB based dependencies.
94#VCC120X86_OLD_DEPS = 1
95
96## Constructs the correct .pdb name (the name is lowercased).
97# @param $(1) Base name, no extention.
98# @param $(2) The extension.
99TOOL_VCC120X86_PDB = $(dir $(1))$(tolower $(notdir $(1))).$(2)
100
101
102# General Properties used by kBuild
103TOOL_VCC120X86_COBJSUFF ?= .obj
104TOOL_VCC120X86_CFLAGS ?= -TC -nologo -Zi
105TOOL_VCC120X86_CFLAGS.debug ?=
106TOOL_VCC120X86_CFLAGS.dbgopt ?= -O2
107TOOL_VCC120X86_CFLAGS.release ?= -O2
108TOOL_VCC120X86_CFLAGS.profile ?= -O2
109TOOL_VCC120X86_CINCS ?= $(PATH_TOOL_VCC120X86_INC)
110TOOL_VCC120X86_CDEFS ?=
111
112TOOL_VCC120X86_CXXOBJSUFF ?= .obj
113TOOL_VCC120X86_CXXFLAGS ?= -TP -nologo -Zi
114TOOL_VCC120X86_CXXFLAGS.debug ?=
115TOOL_VCC120X86_CXXFLAGS.dbgopt ?= -O2
116TOOL_VCC120X86_CXXFLAGS.release ?= -O2
117TOOL_VCC120X86_CXXFLAGS.profile ?= -O2
118TOOL_VCC120X86_CXXINCS ?= $(PATH_TOOL_VCC120X86_INC) $(PATH_TOOL_VCC120X86_ATLMFC_INC)
119TOOL_VCC120X86_CXXDEFS ?=
120
121TOOL_VCC120X86_ASOBJSUFF ?= .obj
122
123TOOL_VCC120X86_RCOBJSUFF ?= .res
124TOOL_VCC120X86_RCINCS ?= $(PATH_TOOL_VCC120X86_INC) $(PATH_TOOL_VCC120X86_ATLMFC_INC)
125
126TOOL_VCC120X86_ARFLAGS ?= -nologo
127TOOL_VCC120X86_ARLIBSUFF ?= .lib
128
129TOOL_VCC120X86_LDFLAGS ?= -nologo -machine:x86
130TOOL_VCC120X86_LDFLAGS.debug ?= -debug
131TOOL_VCC120X86_LDFLAGS.dbgopt ?= -debug
132TOOL_VCC120X86_LDFLAGS.profile ?= -debug
133TOOL_VCC120X86_LDFLAGS.release ?=
134
135
136
137## Compile C source.
138# @param $(target) Normalized main target name.
139# @param $(source) Source filename (relative).
140# @param $(obj) Object file name. This shall be (re)created by the compilation.
141# @param $(dep) Dependcy file. This shall be (re)created by the compilation.
142# @param $(flags) Flags.
143# @param $(defs) Definitions. No -D or something.
144# @param $(incs) Includes. No -I or something.
145# @param $(dirdep) Directory creation dependency.
146# @param $(deps) Other dependencies.
147#
148# @param $(outbase) Output basename (full). Use this for list files and such.
149# @param $(objsuff) Object suffix.
150TOOL_VCC120X86_COMPILE_C_DEPEND =
151TOOL_VCC120X86_COMPILE_C_DEPORD =
152TOOL_VCC120X86_COMPILE_C_OUTPUT =
153TOOL_VCC120X86_COMPILE_C_OUTPUT_MAYBE = $(call TOOL_VCC120X86_PDB, $(outbase)-obj,pdb) $(call TOOL_VCC120X86_PDB, $(outbase)-obj,idb)
154ifdef TOOL_VCC120X86_KSUBMIT
155 TOOL_VCC120X86_COMPILE_C_DONT_PURGE_OUTPUT = 1 # speed
156 define TOOL_VCC120X86_COMPILE_C_CMDS
157 $(QUIET)$(TOOL_VCC120X86_KSUBMIT) -P $(DEP_OBJ_INT) -f -s -q -o $(dep) -t $(obj) $(obj)\
158 -- $(TOOL_VCC120X86_CC) -c\
159 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
160 -Fd$(outbase)-obj.pdb \
161 -Fo$(obj)\
162 $(subst /,\\,$(abspath $(source)))
163 endef
164else
165 define TOOL_VCC120X86_COMPILE_C_CMDS
166 $(QUIET)$(TOOL_VCC120X86_CC) -c\
167 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
168 -Fd$(outbase)-obj.pdb \
169 -Fo$(obj)\
170 $(subst /,\\,$(abspath $(source)))
171 $(QUIET)$(DEP_OBJ) -f -s -q -o $(dep) -t $(obj) $(obj)
172 endef
173endif # !TOOL_VCC120X86_KSUBMIT
174
175
176## Compile C++ source.
177# @param $(target) Normalized main target name.
178# @param $(source) Source filename (relative).
179# @param $(obj) Object file name. This shall be (re)created by the compilation.
180# @param $(dep) Dependcy file. This shall be (re)created by the compilation.
181# @param $(flags) Flags.
182# @param $(defs) Definitions. No -D or something.
183# @param $(incs) Includes. No -I or something.
184# @param $(dirdep) Directory creation dependency.
185# @param $(deps) Other dependencies.
186#
187# @param $(outbase) Output basename (full). Use this for list files and such.
188# @param $(objsuff) Object suffix.
189TOOL_VCC120X86_COMPILE_CXX_DEPEND = $($(target)_1_VCC_PCH_FILE)
190TOOL_VCC120X86_COMPILE_CXX_DEPORD =
191TOOL_VCC120X86_COMPILE_CXX_OUTPUT =
192TOOL_VCC120X86_COMPILE_CXX_OUTPUT_MAYBE = $(if-expr defined($(target)_1_VCC_COMMON_OBJ_PDB)\
193 ,,$(call TOOL_VCC120X86_PDB, $(outbase)-obj,pdb) $(call TOOL_VCC120X86_PDB, $(outbase)-obj,idb))
194ifdef TOOL_VCC120X86_KSUBMIT
195 TOOL_VCC120X86_COMPILE_CXX_DONT_PURGE_OUTPUT = 1 # speed
196 define TOOL_VCC120X86_COMPILE_CXX_CMDS
197 $(QUIET)$(TOOL_VCC120X86_KSUBMIT) -P $(DEP_OBJ_INT) -f -s -q -o $(dep) -t $(obj) $(obj)\
198 -- $(TOOL_VCC120X86_CXX) -c\
199 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
200 $(if-expr defined($(target)_PCH_HDR)\
201 ,-FI$($(target)_PCH_HDR) -Yu$($(target)_PCH_HDR) -Fp$($(target)_1_VCC_PCH_FILE) -FS,)\
202 -Fd$(if-expr defined($(target)_1_VCC_COMMON_OBJ_PDB),$($(target)_1_VCC_COMMON_OBJ_PDB),$(outbase)-obj.pdb) \
203 -Fo$(obj)\
204 $(subst /,\\,$(abspath $(source)))
205 endef
206else
207 define TOOL_VCC120X86_COMPILE_CXX_CMDS
208 $(QUIET)$(TOOL_VCC120X86_CXX) -c\
209 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
210 $(if-expr defined($(target)_PCH_HDR)\
211 ,-FI$($(target)_PCH_HDR) -Yu$($(target)_PCH_HDR) -Fp$($(target)_1_VCC_PCH_FILE) -FS,)\
212 -Fd$(if-expr defined($(target)_1_VCC_COMMON_OBJ_PDB),$($(target)_1_VCC_COMMON_OBJ_PDB),$(outbase)-obj.pdb) \
213 -Fo$(obj)\
214 $(subst /,\\,$(abspath $(source)))
215 $(QUIET)$(DEP_OBJ) -f -s -q -o $(dep) -t $(obj) $(obj)
216 endef
217endif # !TOOL_VCC120X86_KSUBMIT
218
219
220#
221# Helper tool for creating the precompiled C++ header.
222#
223# It only have the C++ compile bits and it's purpose is to skip bits
224# related _1_VCC_PCH_FILE and add -Yc.
225#
226TOOL_VCC120X86-PCH := Helper for creating precompiled header using CXX handling.
227TOOL_VCC120X86-PCH_EXTENDS := VCC120X86
228TOOL_VCC120X86-PCH_CXXOBJSUFF := .obj
229TOOL_VCC120X86-PCH_CXXINCS = $(TOOL_VCC120X86_CXXINCS)
230TOOL_VCC120X86-PCH_CXXFLAGS = $(TOOL_VCC120X86_CXXFLAGS) -FS
231TOOL_VCC120X86-PCH_CXXFLAGS.debug = $(TOOL_VCC120X86_CXXFLAGS.debug)
232TOOL_VCC120X86-PCH_CXXFLAGS.dbgopt = $(TOOL_VCC120X86_CXXFLAGS.dbgopt)
233TOOL_VCC120X86-PCH_CXXFLAGS.release = $(TOOL_VCC120X86_CXXFLAGS.release)
234TOOL_VCC120X86-PCH_CXXFLAGS.profile = $(TOOL_VCC120X86_CXXFLAGS.profile)
235TOOL_VCC120X86-PCH_COMPILE_CXX_DEPEND = $(NO_SUCH_VARIABLE)
236TOOL_VCC120X86-PCH_COMPILE_CXX_DEPORD = $(NO_SUCH_VARIABLE)
237TOOL_VCC120X86-PCH_COMPILE_CXX_OUTPUT = $($(target)_1_VCC_PCH_FILE) $($(target)_1_VCC_COMMON_OBJ_PDB)
238TOOL_VCC120X86-PCH_COMPILE_CXX_OUTPUT_MAYBE = $(NO_SUCH_VARIABLE)
239ifdef TOOL_VCC120X86_KSUBMIT
240 define TOOL_VCC120X86-PCH_COMPILE_CXX_CMDS
241 $(QUIET)$(TOOL_VCC120X86_KSUBMIT) --no-pch-caching -P $(DEP_OBJ_INT) -f -s -q -e .pch -o $(dep) -t $(obj) $(obj)\
242 -- $(TOOL_VCC120X86_CXX) -c -Yc\
243 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
244 -Fp$($(target)_1_VCC_PCH_FILE) \
245 -Fd$($(target)_1_VCC_COMMON_OBJ_PDB) \
246 -Fo$(obj)\
247 -TP \
248 $(subst /,\\,$(abspath $(source)))
249 endef
250else
251 define TOOL_VCC120X86-PCH_COMPILE_CXX_CMDS
252 $(QUIET)$(TOOL_VCC120X86_CXX) -c -Yc\
253 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
254 -Fp$($(target)_1_VCC_PCH_FILE) \
255 -Fd$($(target)_1_VCC_COMMON_OBJ_PDB) \
256 -Fo$(obj)\
257 -TP \
258 $(subst /,\\,$(abspath $(source)))
259 $(QUIET)$(DEP_OBJ) -f -s -q -e .pch -o $(dep) -t $(obj) $(obj)
260
261 endef
262endif # !TOOL_VCC120X86_KSUBMIT
263
264
265## @todo configure the assembler template.
266
267## Compile resource source.
268# @param $(target) Normalized main target name.
269# @param $(source) Source filename (relative).
270# @param $(obj) Object file name. This shall be (re)created by the compilation.
271# @param $(dep) Dependcy file. This shall be (re)created by the compilation.
272# @param $(flags) Flags.
273# @param $(defs) Definitions. No -D or something.
274# @param $(incs) Includes. No -I or something.
275# @param $(dirdep) Directory creation dependency.
276# @param $(deps) Other dependencies.
277#
278# @param $(outbase) Output basename (full). Use this for list files and such.
279# @param $(objsuff) Object suffix.
280TOOL_VCC120X86_COMPILE_RC_DEPEND =
281TOOL_VCC120X86_COMPILE_RC_DEPORD =
282TOOL_VCC120X86_COMPILE_RC_OUTPUT =
283define TOOL_VCC120X86_COMPILE_RC_CMDS
284 $(QUIET)$(TOOL_VCC120X86_RC) \
285 $(flags) $(addprefix /i, $(subst /,\\,$(incs))) $(addprefix /d, $(defs))\
286 /fo$(obj)\
287 $(subst /,\\,$(abspath $(source)))
288endef
289
290
291## Link library
292# @param $(target) Normalized main target name.
293# @param $(out) Library name.
294# @param $(objs) Object files to put in the library.
295# @param $(flags) Flags.
296# @param $(dirdep) Directory creation dependency.
297# @param $(deps) Other dependencies.
298# @param $(othersrc) Unhandled sources.
299# @param $(outbase) Output basename (full). Use this for list files and such.
300#
301TOOL_VCC120X86_LINK_LIBRARY_DEPEND = $(othersrc)
302TOOL_VCC120X86_LINK_LIBRARY_DEPORD =
303TOOL_VCC120X86_LINK_LIBRARY_OUTPUT = $(outbase).rsp
304TOOL_VCC120X86_LINK_LIBRARY_OUTPUT_MAYBE = $(outbase).lst $(outbase).exp $(outbase).pdb
305define TOOL_VCC120X86_LINK_LIBRARY_CMDS
306 $(QUIET)$(APPEND) -tn $(outbase).rsp \
307 $(foreach arg,\
308 $(subst /,\\,$(objs) \
309 $(filter-out %.def,$(othersrc))) \
310 $(addprefix /DEF:,$(filter %.def,$(othersrc))) \
311 ,\"$(arg)\")
312 $(QUIET)$(TOOL_VCC120X86_KSUBMIT_DD) $(TOOL_VCC120X86_AR) $(flags) /OUT:$(out) @$(outbase).rsp
313endef
314
315
316## Link program
317# @param $(target) Normalized main target name.
318# @param $(out) Program name.
319# @param $(objs) Object files to link together.
320# @param $(libs) Libraries to search.
321# @param $(libpath) Library search paths.
322# @param $(flags) Flags.
323# @param $(dirdep) Directory creation dependency.
324# @param $(deps) Other dependencies.
325# @param $(othersrc) Unhandled sources.
326# @param $(custom_pre) Custom step invoked before linking.
327# @param $(custom_post) Custom step invoked after linking.
328# @param $(outbase) Output basename (full). Use this for list files and such.
329#
330TOOL_VCC120X86_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
331TOOL_VCC120X86_LINK_PROGRAM_DEPORD =
332TOOL_VCC120X86_LINK_PROGRAM_OUTPUT = $(outbase).map $(outbase).rsp
333TOOL_VCC120X86_LINK_PROGRAM_OUTPUT_MAYBE = $(outbase).lib $(outbase).exp $(outbase).ilk $(out).manifest
334TOOL_VCC120X86_LINK_PROGRAM_OUTPUT_DEBUG = $(outbase).pdb
335TOOL_VCC120X86_LINK_PROGRAM_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
336define TOOL_VCC120X86_LINK_PROGRAM_CMDS
337 $(QUIET)$(APPEND) -tn $(outbase).rsp \
338 $(foreach arg,\
339 $(subst /,\\,$(objs)) \
340 $(subst /,\\,$(libs)) \
341 ,\"$(arg)\")
342 $(QUIET)$(TOOL_VCC120X86_KSUBMIT_DD) $(TOOL_VCC120X86_LD) $(flags) \
343 /OUT:$(out) \
344 /MAPINFO:EXPORTS /INCREMENTAL:NO \
345 /MAP:$(outbase).map \
346 $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
347 $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
348 $(foreach p,$(libpath), /LIBPATH:$(p)) \
349 @$(outbase).rsp
350ifndef TOOL_VCC120X86_NO_AUTO_MANIFEST
351 $(QUIET)$(TEST) -f $(out).manifest -- \
352 $(TOOL_VCC120X86_MT) -manifest $(subst /,\\,$(out)).manifest -outputresource:$(subst /,\\,$(out))
353endif
354endef
355
356
357## Link DLL.
358# @param $(target) Normalized main target name.
359# @param $(out) DLL name.
360# @param $(objs) Object files to link together.
361# @param $(libs) Libraries to search.
362# @param $(libpath) Library search paths.
363# @param $(flags) Flags.
364# @param $(dirdep) Directory creation dependency.
365# @param $(deps) Other dependencies.
366# @param $(othersrc) Unhandled sources.
367# @param $(custom_pre) Custom step invoked before linking.
368# @param $(custom_post) Custom step invoked after linking.
369#
370# @param $(outbase) Output basename (full). Use this for list files and such.
371TOOL_VCC120X86_LINK_DLL_DEPEND = $(objs) $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
372TOOL_VCC120X86_LINK_DLL_DEPORD = $(call DIRDEP,$(PATH_STAGE_LIB))
373TOOL_VCC120X86_LINK_DLL_OUTPUT = $(outbase).map $(outbase).lib $(outbase).exp $(outbase).rsp
374TOOL_VCC120X86_LINK_DLL_OUTPUT_MAYBE = $(outbase).ilk $(out).manifest $(PATH_STAGE_LIB)/$(notdir $(outbase)).exp
375TOOL_VCC120X86_LINK_DLL_OUTPUT_MAYBE_PRECIOUS = $(PATH_STAGE_LIB)/$(notdir $(outbase)).lib
376TOOL_VCC120X86_LINK_DLL_OUTPUT_DEBUG = $(outbase).pdb
377TOOL_VCC120X86_LINK_DLL_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
378define TOOL_VCC120X86_LINK_DLL_CMDS
379 $(QUIET)$(APPEND) -tn $(outbase).rsp \
380 $(foreach arg,\
381 $(subst /,\\,$(objs)) \
382 $(subst /,\\,$(libs)) \
383 ,\"$(arg)\")
384 $(QUIET)$(TOOL_VCC120X86_KSUBMIT_DD) $(TOOL_VCC120X86_LD) $(flags) \
385 /OUT:$(out) \
386 /IMPLIB:$(outbase).lib \
387 /MAPINFO:EXPORTS /INCREMENTAL:NO \
388 /MAP:$(outbase).map \
389 /DLL \
390 $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
391 $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
392 $(foreach p,$(libpath), /LIBPATH:$(p)) \
393 @$(outbase).rsp
394ifndef TOOL_VCC120X86_NO_AUTO_MANIFEST
395 $(QUIET)$(TEST) -f $(out).manifest -- \
396 $(TOOL_VCC120X86_MT) -manifest $(subst /,\\,$(out)).manifest '-outputresource:$(subst /,\\,$(out));#2'
397endif
398 $(QUIET)$(TEST) -f $(outbase).lib -- $(KLIBTWEAKER_EXT) --clear-timestamps $(outbase).lib
399 $(QUIET)$(CP) --changed --ignore-non-existing $(outbase).exp $(outbase).lib $(PATH_STAGE_LIB)/
400$(eval _DIRS += $(PATH_STAGE_LIB))
401endef
402
403
404## Link system module (windows aka driver, linux aka kernel module)
405# @param $(target) Normalized main target name.
406# @param $(out) System module name.
407# @param $(objs) Object files to link together.
408# @param $(libs) Libraries to search.
409# @param $(libpath) Library search paths.
410# @param $(flags) Flags.
411# @param $(dirdep) Directory creation dependency.
412# @param $(deps) Other dependencies.
413# @param $(othersrc) Unhandled sources.
414# @param $(custom_pre) Custom step invoked before linking.
415# @param $(custom_post) Custom step invoked after linking.
416#
417# @param $(outbase) Output basename (full). Use this for list files and such.
418TOOL_VCC120X86_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
419TOOL_VCC120X86_LINK_SYSMOD_DEPORD =
420TOOL_VCC120X86_LINK_SYSMOD_OUTPUT = $(outbase).map $(outbase).rsp
421TOOL_VCC120X86_LINK_SYSMOD_OUTPUT_MAYBE = $(outbase).lib $(outbase).exp $(outbase).ilk $(out).manifest
422TOOL_VCC120X86_LINK_SYSMOD_OUTPUT_DEBUG = $(outbase).pdb
423TOOL_VCC120X86_LINK_SYSMOD_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
424define TOOL_VCC120X86_LINK_SYSMOD_CMDS
425 $(QUIET)$(APPEND) -tn $(outbase).rsp \
426 $(foreach arg,\
427 $(subst /,\\,$(objs)) \
428 $(subst /,\\,$(libs)) \
429 ,\"$(arg)\")
430 $(QUIET)$(TOOL_VCC120X86_KSUBMIT_DD) $(TOOL_VCC120X86_LD) $(flags) \
431 /OUT:$(out) \
432 /MAPINFO:EXPORTS /INCREMENTAL:NO \
433 /MAP:$(outbase).map \
434 $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
435 $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
436 $(foreach p,$(libpath), /LIBPATH:$(p)) \
437 @$(outbase).rsp
438ifndef TOOL_VCC120X86_NO_AUTO_MANIFEST
439 $(QUIET)$(TEST) -f $(out).manifest -- \
440 $(TOOL_VCC120X86_MT) -manifest $(subst /,\\,$(out)).manifest '-outputresource:$(subst /,\\,$(out));#2'
441endif
442endef
443
Note: See TracBrowser for help on using the repository browser.