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

Last change on this file since 2912 was 2795, checked in by bird, 10 years ago

footer-pass2-compiling-targets.kmk,VCC100*: Introducing linker output variable OUTPUT_MAYBE_PRECIOUS for files that shouldn't be unconditionally deleted prior to linking. This way it's possible to keep the PATH_STAGE_LIB copy of an import library and only update it when there are real changes to the exports of the DLL we're linking, thus avoiding a relinking cascade.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 17.6 KB
Line 
1# $Id: VCC100.kmk 2795 2015-09-15 23:35:37Z 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
110TOOL_VCC100_COBJSUFF ?= .obj
111TOOL_VCC100_CFLAGS ?= -TC -nologo
112TOOL_VCC100_CFLAGS.debug ?= -Zi
113TOOL_VCC100_CFLAGS.dbgopt ?= -O2 -Zi
114TOOL_VCC100_CFLAGS.release ?= -O2
115TOOL_VCC100_CFLAGS.profile ?= -O2
116TOOL_VCC100_CINCS ?= $(PATH_TOOL_VCC100_INC)
117TOOL_VCC100_CDEFS ?=
118
119TOOL_VCC100_CXXOBJSUFF ?= .obj
120TOOL_VCC100_CXXFLAGS ?= -TP -nologo
121TOOL_VCC100_CXXFLAGS.debug ?= -Zi
122TOOL_VCC100_CXXFLAGS.dbgopt ?= -O2 -Zi
123TOOL_VCC100_CXXFLAGS.release ?= -O2
124TOOL_VCC100_CXXFLAGS.profile ?= -O2
125TOOL_VCC100_CXXINCS ?= $(PATH_TOOL_VCC100_INC) $(PATH_TOOL_VCC100_ATLMFC_INC)
126TOOL_VCC100_CXXDEFS ?=
127
128TOOL_VCC100_ASOBJSUFF ?= .obj
129
130TOOL_VCC100_RCOBJSUFF ?= .res
131TOOL_VCC100_RCINCS ?= $(PATH_TOOL_VCC100_INC) $(PATH_TOOL_VCC100_ATLMFC_INC)
132
133TOOL_VCC100_ARFLAGS.amd64 ?= -machine:amd64
134TOOL_VCC100_ARFLAGS.x86 ?= -machine:x86
135TOOL_VCC100_ARFLAGS ?= -nologo
136TOOL_VCC100_ARLIBSUFF ?= .lib
137
138TOOL_VCC100_LDFLAGS.amd64 ?= -machine:amd64
139TOOL_VCC100_LDFLAGS.x86 ?= -machine:x86
140TOOL_VCC100_LDFLAGS ?= -nologo
141TOOL_VCC100_LDFLAGS.debug ?= -debug
142TOOL_VCC100_LDFLAGS.dbgopt ?= -debug
143TOOL_VCC100_LDFLAGS.profile ?= -debug
144TOOL_VCC100_LDFLAGS.release ?=
145TOOL_VCC100_LIBPATH.amd64 ?= $(PATH_TOOL_VCC100_LIB.amd64) $(PATH_TOOL_VCC100_ATLMFC_LIB.amd64)
146TOOL_VCC100_LIBPATH.x86 ?= $(PATH_TOOL_VCC100_LIB.x86) $(PATH_TOOL_VCC100_ATLMFC_LIB.x86)
147
148
149
150## Compile C source.
151# @param $(target) Normalized main target name.
152# @param $(source) Source filename (relative).
153# @param $(obj) Object file name. This shall be (re)created by the compilation.
154# @param $(dep) Dependcy file. This shall be (re)created by the compilation.
155# @param $(flags) Flags.
156# @param $(defs) Definitions. No -D or something.
157# @param $(incs) Includes. No -I or something.
158# @param $(dirdep) Directory creation dependency.
159# @param $(deps) Other dependencies.
160#
161# @param $(outbase) Output basename (full). Use this for list files and such.
162# @param $(objsuff) Object suffix.
163TOOL_VCC100_COMPILE_C_DEPEND =
164TOOL_VCC100_COMPILE_C_DEPORD =
165ifdef KBUILD_USE_KOBJCACHE
166TOOL_VCC100_COMPILE_C_USES_KOBJCACHE = 1
167TOOL_VCC100_COMPILE_C_OUTPUT = $(outbase).i
168TOOL_VCC100_COMPILE_C_OUTPUT_MAYBE =
169define TOOL_VCC100_COMPILE_C_CMDS
170 $(QUIET)$(KOBJCACHE) -f $(outbase).koc -d $(PATH_OBJCACHE) -t $(bld_trg).$(bld_trg_arch) -O2 -r\
171 --make-dep-fix-case --make-dep-gen-stubs --make-dep-quiet --make-dep-file $(dep)\
172 --kObjCache-cpp $(outbase).i\
173 $(TOOL_VCC100_CC) -E\
174 $(subst -Zi,-Z7,$(flags))\
175 $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
176 $(subst /,\\,$(abspath $(source))) \
177 --kObjCache-cc $(obj)\
178 $(TOOL_VCC100_CC) -c\
179 $(subst -Zi,-Z7,$(flags))\
180 -Fo$(obj)\
181 $(outbase).i
182endef
183else # !KBUILD_USE_KOBJCACHE
184TOOL_VCC100_COMPILE_C_OUTPUT = $(call TOOL_VCC100_PDB, $(outbase)-obj,idb)
185TOOL_VCC100_COMPILE_C_OUTPUT_MAYBE = $(call TOOL_VCC100_PDB, $(outbase)-obj,pdb)
186define TOOL_VCC100_COMPILE_C_CMDS
187 $(QUIET)$(TOOL_VCC100_CC) -c\
188 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
189 -Fd$(outbase)-obj.pdb \
190 -FD\
191 -Fo$(obj)\
192 $(subst /,\\,$(abspath $(source)))
193 $(QUIET)$(DEP_IDB) -f -s -q -o $(dep) -t $(obj) $(call TOOL_VCC100_PDB,$(outbase)-obj,idb)
194endef
195endif # !KBUILD_USE_KOBJCACHE
196
197
198## Compile C++ source.
199# @param $(target) Normalized main target name.
200# @param $(source) Source filename (relative).
201# @param $(obj) Object file name. This shall be (re)created by the compilation.
202# @param $(dep) Dependcy file. This shall be (re)created by the compilation.
203# @param $(flags) Flags.
204# @param $(defs) Definitions. No -D or something.
205# @param $(incs) Includes. No -I or something.
206# @param $(dirdep) Directory creation dependency.
207# @param $(deps) Other dependencies.
208#
209# @param $(outbase) Output basename (full). Use this for list files and such.
210# @param $(objsuff) Object suffix.
211TOOL_VCC100_COMPILE_CXX_DEPEND =
212TOOL_VCC100_COMPILE_CXX_DEPORD =
213ifdef KBUILD_USE_KOBJCACHE
214TOOL_VCC100_COMPILE_CXX_USES_KOBJCACHE = 1
215TOOL_VCC100_COMPILE_CXX_OUTPUT = $(outbase).ii
216TOOL_VCC100_COMPILE_CXX_OUTPUT_MAYBE =
217define TOOL_VCC100_COMPILE_CXX_CMDS
218 $(QUIET)$(KOBJCACHE) -f $(outbase).koc -d $(PATH_OBJCACHE) -t $(bld_trg).$(bld_trg_arch) -O2 -r\
219 --make-dep-fix-case --make-dep-gen-stubs --make-dep-quiet --make-dep-file $(dep)\
220 --kObjCache-cpp $(outbase).ii\
221 $(TOOL_VCC100_CXX) -E\
222 $(subst -Zi,-Z7,$(flags))\
223 $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
224 $(subst /,\\,$(abspath $(source))) \
225 --kObjCache-cc $(obj)\
226 $(TOOL_VCC100_CXX) -c\
227 $(subst -Zi,-Z7,$(flags))\
228 -Fo$(obj)\
229 $(outbase).ii
230endef
231else # !KBUILD_USE_KOBJCACHE
232TOOL_VCC100_COMPILE_CXX_OUTPUT = $(call TOOL_VCC100_PDB, $(outbase)-obj,idb)
233TOOL_VCC100_COMPILE_CXX_OUTPUT_MAYBE = $(call TOOL_VCC100_PDB, $(outbase)-obj,pdb)
234define TOOL_VCC100_COMPILE_CXX_CMDS
235 $(QUIET)$(TOOL_VCC100_CXX) -c\
236 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
237 -Fd$(outbase)-obj.pdb \
238 -FD\
239 -Fo$(obj)\
240 $(subst /,\\,$(abspath $(source)))
241 $(QUIET)$(DEP_IDB) -f -s -q -o $(dep) -t $(obj) $(call TOOL_VCC100_PDB,$(outbase)-obj,idb)
242endef
243endif # !KBUILD_USE_KOBJCACHE
244
245## @todo configure the assembler template.
246
247## Compile resource source.
248# @param $(target) Normalized main target name.
249# @param $(source) Source filename (relative).
250# @param $(obj) Object file name. This shall be (re)created by the compilation.
251# @param $(dep) Dependcy file. This shall be (re)created by the compilation.
252# @param $(flags) Flags.
253# @param $(defs) Definitions. No -D or something.
254# @param $(incs) Includes. No -I or something.
255# @param $(dirdep) Directory creation dependency.
256# @param $(deps) Other dependencies.
257#
258# @param $(outbase) Output basename (full). Use this for list files and such.
259# @param $(objsuff) Object suffix.
260TOOL_VCC100_COMPILE_RC_OUTPUT =
261TOOL_VCC100_COMPILE_RC_DEPEND =
262TOOL_VCC100_COMPILE_RC_DEPORD =
263define TOOL_VCC100_COMPILE_RC_CMDS
264 $(QUIET)$(TOOL_VCC100_RC) \
265 $(flags) $(addprefix /i, $(subst /,\\,$(incs))) $(addprefix /d, $(defs))\
266 /fo$(obj)\
267 $(subst /,\\,$(abspath $(source)))
268endef
269
270
271## Link library
272# @param $(target) Normalized main target name.
273# @param $(out) Library name.
274# @param $(objs) Object files to put in the library.
275# @param $(flags) Flags.
276# @param $(dirdep) Directory creation dependency.
277# @param $(deps) Other dependencies.
278# @param $(othersrc) Unhandled sources.
279# @param $(outbase) Output basename (full). Use this for list files and such.
280#
281TOOL_VCC100_LINK_LIBRARY_DEPEND = $(othersrc)
282TOOL_VCC100_LINK_LIBRARY_DEPORD =
283TOOL_VCC100_LINK_LIBRARY_OUTPUT = $(outbase).rsp
284TOOL_VCC100_LINK_LIBRARY_OUTPUT_MAYBE = $(outbase).lst $(outbase).exp $(outbase).pdb
285define TOOL_VCC100_LINK_LIBRARY_CMDS
286 $(QUIET)$(APPEND) -tn $(outbase).rsp \
287 $(foreach arg,\
288 $(subst /,\\,$(objs) \
289 $(filter-out %.def,$(othersrc))) \
290 $(addprefix /DEF:,$(filter %.def,$(othersrc))) \
291 ,\"$(arg)\")
292 $(QUIET)$(TOOL_VCC100_AR) $(flags) /OUT:$(out) @$(outbase).rsp
293endef
294
295
296
297
298## Link program
299# @param $(target) Normalized main target name.
300# @param $(out) Program name.
301# @param $(objs) Object files to link together.
302# @param $(libs) Libraries to search.
303# @param $(libpath) Library search paths.
304# @param $(flags) Flags.
305# @param $(dirdep) Directory creation dependency.
306# @param $(deps) Other dependencies.
307# @param $(othersrc) Unhandled sources.
308# @param $(custom_pre) Custom step invoked before linking.
309# @param $(custom_post) Custom step invoked after linking.
310# @param $(outbase) Output basename (full). Use this for list files and such.
311#
312TOOL_VCC100_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
313TOOL_VCC100_LINK_PROGRAM_DEPORD =
314TOOL_VCC100_LINK_PROGRAM_OUTPUT = $(outbase).map $(outbase).rsp
315TOOL_VCC100_LINK_PROGRAM_OUTPUT_MAYBE = $(outbase).lib $(outbase).exp $(outbase).ilk $(out).manifest
316TOOL_VCC100_LINK_PROGRAM_OUTPUT_DEBUG = $(outbase).pdb
317TOOL_VCC100_LINK_PROGRAM_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
318define TOOL_VCC100_LINK_PROGRAM_CMDS
319 $(QUIET)$(APPEND) -tn $(outbase).rsp \
320 $(foreach arg,\
321 $(subst /,\\,$(objs)) \
322 $(subst /,\\,$(libs)) \
323 ,\"$(arg)\")
324 $(QUIET)$(TOOL_VCC100_LD) $(flags) \
325 /OUT:$(out) \
326 /MAPINFO:EXPORTS /INCREMENTAL:NO \
327 /MAP:$(outbase).map \
328 $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
329 $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
330 $(foreach p,$(libpath), /LIBPATH:$(p)) \
331 @$(outbase).rsp
332ifndef TOOL_VCC100_NO_AUTO_MANIFEST
333 $(QUIET)$(TEST) -f $(out).manifest -- \
334 $(TOOL_VCC100_MT) -manifest $(subst /,\\,$(out)).manifest -outputresource:$(subst /,\\,$(out))
335endif
336endef
337
338
339## Link DLL.
340# @param $(target) Normalized main target name.
341# @param $(out) DLL name.
342# @param $(objs) Object files to link together.
343# @param $(libs) Libraries to search.
344# @param $(libpath) Library search paths.
345# @param $(flags) Flags.
346# @param $(dirdep) Directory creation dependency.
347# @param $(deps) Other dependencies.
348# @param $(othersrc) Unhandled sources.
349# @param $(custom_pre) Custom step invoked before linking.
350# @param $(custom_post) Custom step invoked after linking.
351#
352# @param $(outbase) Output basename (full). Use this for list files and such.
353TOOL_VCC100_LINK_DLL_DEPEND = $(objs) $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
354TOOL_VCC100_LINK_DLL_DEPORD = $(call DIRDEP,$(PATH_STAGE_LIB))
355TOOL_VCC100_LINK_DLL_OUTPUT = $(outbase).map $(outbase).lib $(outbase).exp $(outbase).rsp
356TOOL_VCC100_LINK_DLL_OUTPUT_MAYBE = $(outbase).ilk $(out).manifest $(PATH_STAGE_LIB)/$(notdir $(outbase)).exp
357TOOL_VCC100_LINK_DLL_OUTPUT_MAYBE_PRECIOUS = $(PATH_STAGE_LIB)/$(notdir $(outbase)).lib
358TOOL_VCC100_LINK_DLL_OUTPUT_DEBUG = $(outbase).pdb
359TOOL_VCC100_LINK_DLL_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
360define TOOL_VCC100_LINK_DLL_CMDS
361 $(QUIET)$(APPEND) -tn $(outbase).rsp \
362 $(foreach arg,\
363 $(subst /,\\,$(objs)) \
364 $(subst /,\\,$(libs)) \
365 ,\"$(arg)\")
366 $(QUIET)$(TOOL_VCC100_LD) $(flags) \
367 /OUT:$(out) \
368 /IMPLIB:$(outbase).lib \
369 /MAPINFO:EXPORTS /INCREMENTAL:NO \
370 /MAP:$(outbase).map \
371 /DLL \
372 $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
373 $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
374 $(foreach p,$(libpath), /LIBPATH:$(p)) \
375 @$(outbase).rsp
376ifndef TOOL_VCC100_NO_AUTO_MANIFEST
377 $(QUIET)$(TEST) -f $(out).manifest -- \
378 $(TOOL_VCC100_MT) -manifest $(subst /,\\,$(out)).manifest '-outputresource:$(subst /,\\,$(out));#2'
379endif
380 $(QUIET)$(TEST) -f $(outbase).lib -- $(KLIBTWEAKER_EXT) --clear-timestamps $(outbase).lib
381 $(QUIET)$(CP) --changed --ignore-non-existing $(outbase).exp $(outbase).lib $(PATH_STAGE_LIB)/
382$(eval _DIRS += $(PATH_STAGE_LIB))
383endef
384
385
386## Link system module (windows aka driver, linux aka kernel module)
387# @param $(target) Normalized main target name.
388# @param $(out) System module name.
389# @param $(objs) Object files to link together.
390# @param $(libs) Libraries to search.
391# @param $(libpath) Library search paths.
392# @param $(flags) Flags.
393# @param $(dirdep) Directory creation dependency.
394# @param $(deps) Other dependencies.
395# @param $(othersrc) Unhandled sources.
396# @param $(custom_pre) Custom step invoked before linking.
397# @param $(custom_post) Custom step invoked after linking.
398#
399# @param $(outbase) Output basename (full). Use this for list files and such.
400TOOL_VCC100_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
401TOOL_VCC100_LINK_SYSMOD_DEPORD =
402TOOL_VCC100_LINK_SYSMOD_OUTPUT = $(outbase).map $(outbase).rsp
403TOOL_VCC100_LINK_SYSMOD_OUTPUT_MAYBE = $(outbase).lib $(outbase).exp $(outbase).ilk $(out).manifest
404TOOL_VCC100_LINK_SYSMOD_OUTPUT_DEBUG = $(outbase).pdb
405TOOL_VCC100_LINK_SYSMOD_DEBUG_INSTALL_FN = $(2).pdb=>$(basename $(3)).pdb
406define TOOL_VCC100_LINK_SYSMOD_CMDS
407 $(QUIET)$(APPEND) -tn $(outbase).rsp \
408 $(foreach arg,\
409 $(subst /,\\,$(objs)) \
410 $(subst /,\\,$(libs)) \
411 ,\"$(arg)\")
412 $(QUIET)$(TOOL_VCC100_LD) $(flags) \
413 /OUT:$(out) \
414 /MAPINFO:EXPORTS /INCREMENTAL:NO \
415 /MAP:$(outbase).map \
416 $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
417 $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
418 $(foreach p,$(libpath), /LIBPATH:$(p)) \
419 @$(outbase).rsp
420ifndef TOOL_VCC100_NO_AUTO_MANIFEST
421 $(QUIET)$(TEST) -f $(out).manifest -- \
422 $(TOOL_VCC100_MT) -manifest $(subst /,\\,$(out)).manifest '-outputresource:$(subst /,\\,$(out));#2'
423endif
424endef
425
Note: See TracBrowser for help on using the repository browser.