source: trunk/kBuild/tools/VCC100.kmk@ 3044

Last change on this file since 3044 was 2964, checked in by bird, 9 years ago

VCC100*: Workaround for tool inheritance problem.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 18.3 KB
Line 
1# $Id: VCC100.kmk 2964 2016-09-23 11:08:04Z bird $
2## @file
3# kBuild Tool Config - Visual C++ 10.0 (aka Visual 2010 and MSC v16), targeting $(KBUILD_TARGET).
4#
5
6#
7# Copyright (c) 2004-2014 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_VCC100 := Visual C++ 10.0 (aka Visual 2010 and MSC v16), targeting $(KBUILD_TARGET).
35
36# Tool Specific Properties
37ifndef PATH_TOOL_VCC100
38 PATH_TOOL_VCC100 := $(wildcard $(KBUILD_DEVTOOLS_TRG)/vcc/v10*)
39 ifeq ($(PATH_TOOL_VCC100),)
40 PATH_TOOL_VCC100 := $(wildcard $(KBUILD_DEVTOOLS)/win.x86/vcc/v10*)
41 endif
42 ifeq ($(PATH_TOOL_VCC100),)
43 PATH_TOOL_VCC100 := $(wildcard $(KBUILD_DEVTOOLS)/x86.win32/vcc/v10*)
44 endif
45 ifeq ($(PATH_TOOL_VCC100),)
46 PATH_TOOL_VCC100 := $(wildcard $(KBUILD_DEVTOOLS)/win.amd64/vcc/v10*)
47 endif
48 ifeq ($(PATH_TOOL_VCC100),)
49 PATH_TOOL_VCC100 := $(lastword $(sort $(PATH_TOOL_VCC100)))
50 endif
51 # if not found, we'll enter 'pathless' mode.
52else
53 # Resolve any fancy stuff once and for all.
54 PATH_TOOL_VCC100 := $(PATH_TOOL_VCC100)
55endif
56ifneq ($(PATH_TOOL_VCC100),)
57 ifeq ($(KBUILD_HOST).$(KBUILD_HOST_ARCH),win.amd64)
58 PATH_TOOL_VCC100_BIN.amd64 ?= $(PATH_TOOL_VCC100)/bin/amd64
59 else
60 PATH_TOOL_VCC100_BIN.amd64 ?= $(PATH_TOOL_VCC100)/bin/x86_amd64
61 endif
62 PATH_TOOL_VCC100_BIN.x86 ?= $(PATH_TOOL_VCC100)/bin
63 PATH_TOOL_VCC100_BIN ?= $(PATH_TOOL_VCC100_BIN.$(KBUILD_TARGET_ARCH))
64 PATH_TOOL_VCC100_LIB.amd64 ?= $(PATH_TOOL_VCC100)/lib/amd64
65 PATH_TOOL_VCC100_LIB.x86 ?= $(PATH_TOOL_VCC100)/lib
66 PATH_TOOL_VCC100_LIB ?= $(PATH_TOOL_VCC100_LIB.$(KBUILD_TARGET_ARCH))
67 PATH_TOOL_VCC100_INC ?= $(PATH_TOOL_VCC100)/include
68 PATH_TOOL_VCC100_ATLMFC ?= $(PATH_TOOL_VCC100X86)/atlmfc
69 PATH_TOOL_VCC100_ATLMFC_INC ?= $(PATH_TOOL_VCC100_ATLMFC)/include
70 PATH_TOOL_VCC100_ATLMFC_LIB.amd64 ?= $(PATH_TOOL_VCC100_ATLMFC)/lib
71 PATH_TOOL_VCC100_ATLMFC_LIB.x86 ?= $(PATH_TOOL_VCC100_ATLMFC)/lib/amd64
72 PATH_TOOL_VCC100_ATLMFC_LIB ?= $(PATH_TOOL_VCC100_ATLMFC_LIB.$(KBUILD_TARGET_ARCH))
73 TOOL_VCC100_CC ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC100_BIN)/cl.exe
74 TOOL_VCC100_CXX ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC100_BIN)/cl.exe
75 TOOL_VCC100_AS ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC100_BIN)/ml64.exe
76 TOOL_VCC100_AR ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC100_BIN)/lib.exe
77 TOOL_VCC100_LD ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC100_BIN)/link.exe
78 TOOL_VCC100_DUMPBIN ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC100_BIN)/dumpbin.exe
79 TOOL_VCC100_EDITBIN ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC100_BIN)/editbin.exe
80else
81 # Pathless, relies on the environment.
82 TOOL_VCC100_CC ?= $(EXEC_X86_WIN32) cl.exe
83 TOOL_VCC100_CXX ?= $(EXEC_X86_WIN32) cl.exe
84 TOOL_VCC100_AS ?= $(EXEC_X86_WIN32) ml64.exe
85 TOOL_VCC100_AR ?= $(EXEC_X86_WIN32) lib.exe
86 TOOL_VCC100_LD ?= $(EXEC_X86_WIN32) link.exe
87 TOOL_VCC100_DUMPBIN ?= $(EXEC_X86_WIN32) dumpbin.exe
88 TOOL_VCC100_EDITBIN ?= $(EXEC_X86_WIN32) editbin.exe
89endif
90TOOL_VCC100_RC ?= $(EXEC_X86_WIN32) $(call TOOL_VCC100_FN_FIND_SDK_TOOL,rc.exe,[Rr][Cc].[Ee][Xx][Ee],TOOL_VCC100_RC_CACHED)
91TOOL_VCC100_MT ?= $(EXEC_X86_WIN32) $(call TOOL_VCC100_FN_FIND_SDK_TOOL,mt.exe,[Mm][Tt].[Ee][Xx][Ee],TOOL_VCC100_MT_CACHED)
92
93# The following in duplicated in VCC100.kmk and VCC100X86.kmk.
94TOOL_VCC100_FN_FIND_SDK_TOOL_SUB = $(eval $3 := $(firstword \
95 $(if-expr defined(PATH_SDK_WINPSDK71_BIN), $(wildcard $(PATH_SDK_WINPSDK71_BIN)/$2)) \
96 $(if-expr defined(PATH_SDK_WINPSDK_BIN) , $(wildcard $(PATH_SDK_WINPSDK_BIN)/$2)) \
97 $(rsort $(wildcard $(KBUILD_DEVTOOLS_HST)/sdk/*/[Bb][Ii][Nn]/$2)) \
98 $(rsort $(wildcard $(KBUILD_DEVTOOLS_HST_ALT)/sdk/*/[Bb][Ii][Nn]/$2)) \
99 $1))
100TOOL_VCC100_FN_FIND_SDK_TOOL = $(if-expr !defined($3),$(TOOL_VCC100_FN_FIND_SDK_TOOL_SUB),)$($3)
101
102## Disabled fast DEP_IDB based dependencies.
103#VCC100_OLD_DEPS = 1
104
105## Constructs the correct .pdb name (the name is lowercased).
106# @param $(1) Base name, no extention.
107# @param $(2) The extension.
108TOOL_VCC100_PDB = $(dir $(1))$(tolower $(notdir $(1))).$(2)
109
110
111# General Properties used by kBuild
112TOOL_VCC100_COBJSUFF ?= .obj
113TOOL_VCC100_CFLAGS ?= -TC -nologo -Zi
114TOOL_VCC100_CFLAGS.debug ?=
115TOOL_VCC100_CFLAGS.dbgopt ?= -O2
116TOOL_VCC100_CFLAGS.release ?= -O2
117TOOL_VCC100_CFLAGS.profile ?= -O2
118TOOL_VCC100_CINCS ?= $(PATH_TOOL_VCC100_INC)
119TOOL_VCC100_CDEFS ?=
120
121TOOL_VCC100_CXXOBJSUFF ?= .obj
122TOOL_VCC100_CXXFLAGS ?= -TP -nologo -Zi
123TOOL_VCC100_CXXFLAGS.debug ?=
124TOOL_VCC100_CXXFLAGS.dbgopt ?= -O2
125TOOL_VCC100_CXXFLAGS.release ?= -O2
126TOOL_VCC100_CXXFLAGS.profile ?= -O2
127TOOL_VCC100_CXXINCS ?= $(PATH_TOOL_VCC100_INC) $(PATH_TOOL_VCC100_ATLMFC_INC)
128TOOL_VCC100_CXXDEFS ?=
129
130TOOL_VCC100_ASOBJSUFF ?= .obj
131
132TOOL_VCC100_RCOBJSUFF ?= .res
133TOOL_VCC100_RCINCS ?= $(PATH_TOOL_VCC100_INC) $(PATH_TOOL_VCC100_ATLMFC_INC)
134
135TOOL_VCC100_ARFLAGS.amd64 ?= -machine:amd64
136TOOL_VCC100_ARFLAGS.x86 ?= -machine:x86
137TOOL_VCC100_ARFLAGS ?= -nologo
138TOOL_VCC100_ARLIBSUFF ?= .lib
139
140TOOL_VCC100_LDFLAGS.amd64 ?= -machine:amd64
141TOOL_VCC100_LDFLAGS.x86 ?= -machine:x86
142TOOL_VCC100_LDFLAGS ?= -nologo
143TOOL_VCC100_LDFLAGS.debug ?= -debug
144TOOL_VCC100_LDFLAGS.dbgopt ?= -debug
145TOOL_VCC100_LDFLAGS.profile ?= -debug
146TOOL_VCC100_LDFLAGS.release ?=
147TOOL_VCC100_LIBPATH.amd64 ?= $(PATH_TOOL_VCC100_LIB.amd64) $(PATH_TOOL_VCC100_ATLMFC_LIB.amd64)
148TOOL_VCC100_LIBPATH.x86 ?= $(PATH_TOOL_VCC100_LIB.x86) $(PATH_TOOL_VCC100_ATLMFC_LIB.x86)
149
150
151
152## Compile C source.
153# @param $(target) Normalized main target name.
154# @param $(source) Source filename (relative).
155# @param $(obj) Object file name. This shall be (re)created by the compilation.
156# @param $(dep) Dependcy file. This shall be (re)created by the compilation.
157# @param $(flags) Flags.
158# @param $(defs) Definitions. No -D or something.
159# @param $(incs) Includes. No -I or something.
160# @param $(dirdep) Directory creation dependency.
161# @param $(deps) Other dependencies.
162#
163# @param $(outbase) Output basename (full). Use this for list files and such.
164# @param $(objsuff) Object suffix.
165TOOL_VCC100_COMPILE_C_DEPEND =
166TOOL_VCC100_COMPILE_C_DEPORD =
167TOOL_VCC100_COMPILE_C_OUTPUT =
168TOOL_VCC100_COMPILE_C_OUTPUT_MAYBE = $(call TOOL_VCC100_PDB, $(outbase)-obj,pdb) $(call TOOL_VCC100_PDB, $(outbase)-obj,idb)
169define TOOL_VCC100_COMPILE_C_CMDS
170 $(QUIET)$(TOOL_VCC100_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)
176endef
177
178
179## Compile C++ source.
180# @param $(target) Normalized main target name.
181# @param $(source) Source filename (relative).
182# @param $(obj) Object file name. This shall be (re)created by the compilation.
183# @param $(dep) Dependcy file. This shall be (re)created by the compilation.
184# @param $(flags) Flags.
185# @param $(defs) Definitions. No -D or something.
186# @param $(incs) Includes. No -I or something.
187# @param $(dirdep) Directory creation dependency.
188# @param $(deps) Other dependencies.
189#
190# @param $(outbase) Output basename (full). Use this for list files and such.
191# @param $(objsuff) Object suffix.
192TOOL_VCC100_COMPILE_CXX_DEPEND = $($(target)_1_VCC_PCH_FILE)
193TOOL_VCC100_COMPILE_CXX_DEPORD =
194TOOL_VCC100_COMPILE_CXX_OUTPUT =
195TOOL_VCC100_COMPILE_CXX_OUTPUT_MAYBE = $(if-expr defined($(target)_1_VCC_COMMON_OBJ_PDB)\
196 ,,$(call TOOL_VCC100_PDB, $(outbase)-obj,pdb) $(call TOOL_VCC100_PDB, $(outbase)-obj,idb))
197define TOOL_VCC100_COMPILE_CXX_CMDS
198 $(QUIET)$(TOOL_VCC100_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),)\
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 $(QUIET)$(DEP_OBJ) -f -s -q -o $(dep) -t $(obj) $(obj)
206endef
207
208
209#
210# Helper tool for creating the precompiled C++ header.
211#
212# It only have the C++ compile bits and it's purpose is to skip bits
213# related _1_VCC_PCH_FILE and add -Yc.
214#
215TOOL_VCC100-PCH := Helper for creating precompiled header using CXX handling.
216TOOL_VCC100-PCH_EXTENDS := VCC100
217TOOL_VCC100-PCH_CXXOBJSUFF := .obj
218TOOL_VCC100-PCH_CXXINCS = $(TOOL_VCC100_CXXINCS)
219TOOL_VCC100-PCH_CXXFLAGS.debug = $(TOOL_VCC100_CXXFLAGS.debug)
220TOOL_VCC100-PCH_CXXFLAGS.dbgopt = $(TOOL_VCC100_CXXFLAGS.dbgopt)
221TOOL_VCC100-PCH_CXXFLAGS.release = $(TOOL_VCC100_CXXFLAGS.release)
222TOOL_VCC100-PCH_CXXFLAGS.profile = $(TOOL_VCC100_CXXFLAGS.profile)
223TOOL_VCC100-PCH_COMPILE_CXX_DEPEND = $(NO_SUCH_VARIABLE)
224TOOL_VCC100-PCH_COMPILE_CXX_DEPORD = $(NO_SUCH_VARIABLE)
225TOOL_VCC100-PCH_COMPILE_CXX_OUTPUT = $($(target)_1_VCC_PCH_FILE) $($(target)_1_VCC_COMMON_OBJ_PDB)
226TOOL_VCC100-PCH_COMPILE_CXX_OUTPUT_MAYBE = $(NO_SUCH_VARIABLE)
227ifdef TOOL_VCC100_KSUBMIT
228 define TOOL_VCC100-PCH_COMPILE_CXX_CMDS
229 $(QUIET)$(TOOL_VCC100_KSUBMIT) --no-pch-caching -P $(DEP_OBJ_INT) -f -s -q -e .pch -o $(dep) -t $(obj) $(obj)\
230 -- $(TOOL_VCC100_CXX) -c -Yc\
231 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
232 -Fp$($(target)_1_VCC_PCH_FILE) \
233 -Fd$($(target)_1_VCC_COMMON_OBJ_PDB) \
234 -Fo$(obj)\
235 -TP \
236 $(subst /,\\,$(abspath $(source)))
237 endef
238else
239 define TOOL_VCC100-PCH_COMPILE_CXX_CMDS
240 $(QUIET)$(TOOL_VCC100_CXX) -c -Yc\
241 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
242 -Fp$($(target)_1_VCC_PCH_FILE) \
243 -Fd$($(target)_1_VCC_COMMON_OBJ_PDB) \
244 -Fo$(obj)\
245 -TP \
246 $(subst /,\\,$(abspath $(source)))
247 $(QUIET)$(DEP_OBJ) -f -s -q -e .pch -o $(dep) -t $(obj) $(obj)
248
249 endef
250endif # !TOOL_VCC100_KSUBMIT
251
252
253## @todo configure the assembler template.
254
255## Compile resource source.
256# @param $(target) Normalized main target name.
257# @param $(source) Source filename (relative).
258# @param $(obj) Object file name. This shall be (re)created by the compilation.
259# @param $(dep) Dependcy file. This shall be (re)created by the compilation.
260# @param $(flags) Flags.
261# @param $(defs) Definitions. No -D or something.
262# @param $(incs) Includes. No -I or something.
263# @param $(dirdep) Directory creation dependency.
264# @param $(deps) Other dependencies.
265#
266# @param $(outbase) Output basename (full). Use this for list files and such.
267# @param $(objsuff) Object suffix.
268TOOL_VCC100_COMPILE_RC_OUTPUT =
269TOOL_VCC100_COMPILE_RC_DEPEND =
270TOOL_VCC100_COMPILE_RC_DEPORD =
271define TOOL_VCC100_COMPILE_RC_CMDS
272 $(QUIET)$(TOOL_VCC100_RC) \
273 $(flags) $(addprefix /i, $(subst /,\\,$(incs))) $(addprefix /d, $(defs))\
274 /fo$(obj)\
275 $(subst /,\\,$(abspath $(source)))
276endef
277
278
279## Link library
280# @param $(target) Normalized main target name.
281# @param $(out) Library name.
282# @param $(objs) Object files to put in the library.
283# @param $(flags) Flags.
284# @param $(dirdep) Directory creation dependency.
285# @param $(deps) Other dependencies.
286# @param $(othersrc) Unhandled sources.
287# @param $(outbase) Output basename (full). Use this for list files and such.
288#
289TOOL_VCC100_LINK_LIBRARY_DEPEND = $(othersrc)
290TOOL_VCC100_LINK_LIBRARY_DEPORD =
291TOOL_VCC100_LINK_LIBRARY_OUTPUT = $(outbase).rsp
292TOOL_VCC100_LINK_LIBRARY_OUTPUT_MAYBE = $(outbase).lst $(outbase).exp $(outbase).pdb
293define TOOL_VCC100_LINK_LIBRARY_CMDS
294 $(QUIET)$(APPEND) -tn $(outbase).rsp \
295 $(foreach arg,\
296 $(subst /,\\,$(objs) \
297 $(filter-out %.def,$(othersrc))) \
298 $(addprefix /DEF:,$(filter %.def,$(othersrc))) \
299 ,\"$(arg)\")
300 $(QUIET)$(TOOL_VCC100_AR) $(flags) /OUT:$(out) @$(outbase).rsp
301endef
302
303
304## Link program
305# @param $(target) Normalized main target name.
306# @param $(out) Program name.
307# @param $(objs) Object files to link together.
308# @param $(libs) Libraries to search.
309# @param $(libpath) Library search paths.
310# @param $(flags) Flags.
311# @param $(dirdep) Directory creation dependency.
312# @param $(deps) Other dependencies.
313# @param $(othersrc) Unhandled sources.
314# @param $(custom_pre) Custom step invoked before linking.
315# @param $(custom_post) Custom step invoked after linking.
316# @param $(outbase) Output basename (full). Use this for list files and such.
317#
318TOOL_VCC100_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
319TOOL_VCC100_LINK_PROGRAM_DEPORD =
320TOOL_VCC100_LINK_PROGRAM_OUTPUT = $(outbase).map $(outbase).rsp
321TOOL_VCC100_LINK_PROGRAM_OUTPUT_MAYBE = $(outbase).lib $(outbase).exp $(outbase).ilk $(out).manifest
322TOOL_VCC100_LINK_PROGRAM_OUTPUT_DEBUG = $(outbase).pdb
323TOOL_VCC100_LINK_PROGRAM_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
324define TOOL_VCC100_LINK_PROGRAM_CMDS
325 $(QUIET)$(APPEND) -tn $(outbase).rsp \
326 $(foreach arg,\
327 $(subst /,\\,$(objs)) \
328 $(subst /,\\,$(libs)) \
329 ,\"$(arg)\")
330 $(QUIET)$(TOOL_VCC100_LD) $(flags) \
331 /OUT:$(out) \
332 /MAPINFO:EXPORTS /INCREMENTAL:NO \
333 /MAP:$(outbase).map \
334 $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
335 $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
336 $(foreach p,$(libpath), /LIBPATH:$(p)) \
337 @$(outbase).rsp
338ifndef TOOL_VCC100_NO_AUTO_MANIFEST
339 $(QUIET)$(TEST) -f $(out).manifest -- \
340 $(TOOL_VCC100_MT) -manifest $(subst /,\\,$(out)).manifest -outputresource:$(subst /,\\,$(out))
341endif
342endef
343
344
345## Link DLL.
346# @param $(target) Normalized main target name.
347# @param $(out) DLL name.
348# @param $(objs) Object files to link together.
349# @param $(libs) Libraries to search.
350# @param $(libpath) Library search paths.
351# @param $(flags) Flags.
352# @param $(dirdep) Directory creation dependency.
353# @param $(deps) Other dependencies.
354# @param $(othersrc) Unhandled sources.
355# @param $(custom_pre) Custom step invoked before linking.
356# @param $(custom_post) Custom step invoked after linking.
357#
358# @param $(outbase) Output basename (full). Use this for list files and such.
359TOOL_VCC100_LINK_DLL_DEPEND = $(objs) $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
360TOOL_VCC100_LINK_DLL_DEPORD = $(call DIRDEP,$(PATH_STAGE_LIB))
361TOOL_VCC100_LINK_DLL_OUTPUT = $(outbase).map $(outbase).lib $(outbase).exp $(outbase).rsp
362TOOL_VCC100_LINK_DLL_OUTPUT_MAYBE = $(outbase).ilk $(out).manifest $(PATH_STAGE_LIB)/$(notdir $(outbase)).exp
363TOOL_VCC100_LINK_DLL_OUTPUT_MAYBE_PRECIOUS = $(PATH_STAGE_LIB)/$(notdir $(outbase)).lib
364TOOL_VCC100_LINK_DLL_OUTPUT_DEBUG = $(outbase).pdb
365TOOL_VCC100_LINK_DLL_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
366define TOOL_VCC100_LINK_DLL_CMDS
367 $(QUIET)$(APPEND) -tn $(outbase).rsp \
368 $(foreach arg,\
369 $(subst /,\\,$(objs)) \
370 $(subst /,\\,$(libs)) \
371 ,\"$(arg)\")
372 $(QUIET)$(TOOL_VCC100_LD) $(flags) \
373 /OUT:$(out) \
374 /IMPLIB:$(outbase).lib \
375 /MAPINFO:EXPORTS /INCREMENTAL:NO \
376 /MAP:$(outbase).map \
377 /DLL \
378 $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
379 $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
380 $(foreach p,$(libpath), /LIBPATH:$(p)) \
381 @$(outbase).rsp
382ifndef TOOL_VCC100_NO_AUTO_MANIFEST
383 $(QUIET)$(TEST) -f $(out).manifest -- \
384 $(TOOL_VCC100_MT) -manifest $(subst /,\\,$(out)).manifest '-outputresource:$(subst /,\\,$(out));#2'
385endif
386 $(QUIET)$(TEST) -f $(outbase).lib -- $(KLIBTWEAKER_EXT) --clear-timestamps $(outbase).lib
387 $(QUIET)$(CP) --changed --ignore-non-existing $(outbase).exp $(outbase).lib $(PATH_STAGE_LIB)/
388$(eval _DIRS += $(PATH_STAGE_LIB))
389endef
390
391
392## Link system module (windows aka driver, linux aka kernel module)
393# @param $(target) Normalized main target name.
394# @param $(out) System module name.
395# @param $(objs) Object files to link together.
396# @param $(libs) Libraries to search.
397# @param $(libpath) Library search paths.
398# @param $(flags) Flags.
399# @param $(dirdep) Directory creation dependency.
400# @param $(deps) Other dependencies.
401# @param $(othersrc) Unhandled sources.
402# @param $(custom_pre) Custom step invoked before linking.
403# @param $(custom_post) Custom step invoked after linking.
404#
405# @param $(outbase) Output basename (full). Use this for list files and such.
406TOOL_VCC100_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
407TOOL_VCC100_LINK_SYSMOD_DEPORD =
408TOOL_VCC100_LINK_SYSMOD_OUTPUT = $(outbase).map $(outbase).rsp
409TOOL_VCC100_LINK_SYSMOD_OUTPUT_MAYBE = $(outbase).lib $(outbase).exp $(outbase).ilk $(out).manifest
410TOOL_VCC100_LINK_SYSMOD_OUTPUT_DEBUG = $(outbase).pdb
411TOOL_VCC100_LINK_SYSMOD_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
412define TOOL_VCC100_LINK_SYSMOD_CMDS
413 $(QUIET)$(APPEND) -tn $(outbase).rsp \
414 $(foreach arg,\
415 $(subst /,\\,$(objs)) \
416 $(subst /,\\,$(libs)) \
417 ,\"$(arg)\")
418 $(QUIET)$(TOOL_VCC100_LD) $(flags) \
419 /OUT:$(out) \
420 /MAPINFO:EXPORTS /INCREMENTAL:NO \
421 /MAP:$(outbase).map \
422 $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
423 $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
424 $(foreach p,$(libpath), /LIBPATH:$(p)) \
425 @$(outbase).rsp
426ifndef TOOL_VCC100_NO_AUTO_MANIFEST
427 $(QUIET)$(TEST) -f $(out).manifest -- \
428 $(TOOL_VCC100_MT) -manifest $(subst /,\\,$(out)).manifest '-outputresource:$(subst /,\\,$(out));#2'
429endif
430endef
431
Note: See TracBrowser for help on using the repository browser.