source: trunk/kBuild/tools/VCC80AMD64.kmk@ 1355

Last change on this file since 1355 was 1354, checked in by bird, 18 years ago

Don't check for tolower, it's there.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 13.1 KB
Line 
1# $Id: VCC80AMD64.kmk 1354 2007-12-03 01:07:33Z bird $
2## @file
3#
4# kBuild Tool Config - Visual C++ 8.0 (aka Visual .NET 2005, or MSC v14), targeting AMD64.
5#
6# Copyright (c) 2004-2007 knut st. osmundsen <bird-kBuild-spam@anduin.net>
7#
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
27TOOL_VCC80AMD64 := Visual C++ 8.0 (aka Visual .NET 2005, or MSC v14), targeting AMD64.
28
29# Tool Specific Properties
30ifndef PATH_TOOL_VCC80AMD64
31 PATH_TOOL_VCC80AMD64 := $(wildcard $(PATH_DEVTOOLS)/win.x86/vcc/v8*)
32 ifeq ($(PATH_TOOL_VCC80AMD64),)
33 PATH_TOOL_VCC80AMD64 := $(PATH_TOOL_VCC80)
34 endif
35 ifeq ($(PATH_TOOL_VCC80AMD64),)
36 PATH_TOOL_VCC80AMD64 := $(PATH_TOOL_VCC80X86)
37 endif
38 ifeq ($(PATH_TOOL_VCC80AMD64),)
39 PATH_TOOL_VCC80AMD64 := $(wildcard $(PATH_DEVTOOLS)/win.x86/vcc/v8*)
40 endif
41 ifneq ($(PATH_TOOL_VCC80AMD64),)
42 PATH_TOOL_VCC80AMD64 := $(lastword $(sort $(PATH_TOOL_VCC80AMD64)))
43 else
44 $(warning kBuild: PATH_TOOL_VCC80AMD64 cannot be determined!)
45 PATH_TOOL_VCC80AMD64 := $(PATH_DEVTOOLS)/win.x86/vcc/v8
46 endif
47else
48 # Resolve any fancy stuff once and for all.
49 PATH_TOOL_VCC80AMD64 := $(PATH_TOOL_VCC80AMD64)
50endif
51ifeq ($(BUILD_PLATFORM).$(BUILD_PLATFORM_ARCH),win.amd64)
52PATH_TOOL_VCC80AMD64_BIN ?= $(PATH_TOOL_VCC80AMD64)/bin/amd64
53else
54PATH_TOOL_VCC80AMD64_BIN ?= $(PATH_TOOL_VCC80AMD64)/bin/x86_amd64
55endif
56PATH_TOOL_VCC80AMD64_LIB ?= $(PATH_TOOL_VCC80AMD64)/lib/amd64
57PATH_TOOL_VCC80AMD64_INC ?= $(PATH_TOOL_VCC80AMD64)/include
58PATH_TOOL_VCC80AMD64_ATLMFC ?= $(PATH_TOOL_VCC80AMD64)/atlmfc
59PATH_TOOL_VCC80AMD64_ATLMFC_INC ?= $(PATH_TOOL_VCC80AMD64_ATLMFC)/include
60PATH_TOOL_VCC80AMD64_ATLMFC_LIB ?= $(PATH_TOOL_VCC80AMD64_ATLMFC)/lib/amd64
61TOOL_VCC80AMD64_CC ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC80AMD64_BIN)/cl.exe
62TOOL_VCC80AMD64_CXX ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC80AMD64_BIN)/cl.exe
63TOOL_VCC80AMD64_AS ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC80AMD64_BIN)/ml64.exe
64TOOL_VCC80AMD64_RC ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC80AMD64_BIN)/../rc.exe
65TOOL_VCC80AMD64_AR ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC80AMD64_BIN)/lib.exe
66TOOL_VCC80AMD64_LD ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC80AMD64_BIN)/link.exe
67TOOL_VCC80AMD64_MT ?= $(EXEC_X86_WIN32) $(PATH_TOOL_VCC80AMD64_BIN)/../mt.exe
68## Disabled fast DEP_IDB based dependencies.
69#VCC80AMD64_OLD_DEPS = 1
70
71## Constructs the correct .pdb name (the name is lowercased).
72# @param $(1) Base name, no extention.
73# @param $(2) The extension.
74TOOL_VCC80AMD64_PDB = $(dir $(1))$(tolower $(notdir $(1))).$(2)
75
76TOOL_VCC80AMD64_COBJSUFF ?= .obj
77TOOL_VCC80AMD64_CFLAGS ?= -TC -c -nologo
78TOOL_VCC80AMD64_CFLAGS.debug ?= -Od -Zi
79TOOL_VCC80AMD64_CFLAGS.release ?= -O2
80TOOL_VCC80AMD64_CFLAGS.profile ?= -O2
81TOOL_VCC80AMD64_CINCS ?= $(PATH_TOOL_VCC80AMD64_INC)
82TOOL_VCC80AMD64_CDEFS ?=
83
84TOOL_VCC80AMD64_CXXOBJSUFF ?= .obj
85TOOL_VCC80AMD64_CXXFLAGS ?= -TP -c -nologo
86TOOL_VCC80AMD64_CXXFLAGS.debug ?= -Od -Zi
87TOOL_VCC80AMD64_CXXFLAGS.release ?= -O2
88TOOL_VCC80AMD64_CXXFLAGS.profile ?= -O2
89TOOL_VCC80AMD64_CXXINCS ?= $(PATH_TOOL_VCC80AMD64_INC) $(PATH_TOOL_VCC80AMD64_ATLMFC_INC)
90TOOL_VCC80AMD64_CXXDEFS ?=
91
92TOOL_VCC80AMD64_ASOBJSUFF ?= .obj
93
94TOOL_VCC80AMD64_RCOBJSUFF ?= .res
95TOOL_VCC80AMD64_RCINCS ?= $(PATH_TOOL_VCC80AMD64_INC) $(PATH_TOOL_VCC80AMD64_ATLMFC_INC)
96
97TOOL_VCC80AMD64_ARFLAGS ?= -nologo -machine:amd64
98TOOL_VCC80AMD64_ARLIBSUFF ?= .lib
99
100TOOL_VCC80AMD64_LDFLAGS ?= -nologo -machine:amd64
101TOOL_VCC80AMD64_LDFLAGS.debug ?= -debug
102TOOL_VCC80AMD64_LDFLAGS.release ?=
103
104
105
106## Compile C source.
107# @param $(target) Normalized main target name.
108# @param $(source) Source filename (relative).
109# @param $(obj) Object file name. This shall be (re)created by the compilation.
110# @param $(dep) Dependcy file. This shall be (re)created by the compilation.
111# @param $(flags) Flags.
112# @param $(defs) Definitions. No -D or something.
113# @param $(incs) Includes. No -I or something.
114# @param $(dirdep) Directory creation dependency.
115# @param $(deps) Other dependencies.
116#
117# @param $(outbase) Output basename (full). Use this for list files and such.
118# @param $(objsuff) Object suffix.
119TOOL_VCC80AMD64_COMPILE_C_DEPEND =
120TOOL_VCC80AMD64_COMPILE_C_DEPORD =
121TOOL_VCC80AMD64_COMPILE_C_OUTPUT = $(call TOOL_VCC80AMD64_PDB, $(outbase)-obj,idb)
122TOOL_VCC80AMD64_COMPILE_C_OUTPUT_MAYBE = $(call TOOL_VCC80AMD64_PDB, $(outbase)-obj,pdb)
123define TOOL_VCC80AMD64_COMPILE_C_CMDS
124 $(QUIET)$(TOOL_VCC80AMD64_CC) -c\
125 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
126 -Fd$(outbase)-obj.pdb \
127 -FD\
128 -Fo$(obj)\
129 $(subst /,\\,$(abspath $(source)))
130 $(QUIET)$(DEP_IDB) -f -s -o $(dep) -t $(obj) $(call TOOL_VCC80AMD64_PDB,$(outbase)-obj,idb)
131endef
132
133
134## Compile C++ source.
135# @param $(target) Normalized main target name.
136# @param $(source) Source filename (relative).
137# @param $(obj) Object file name. This shall be (re)created by the compilation.
138# @param $(dep) Dependcy file. This shall be (re)created by the compilation.
139# @param $(flags) Flags.
140# @param $(defs) Definitions. No -D or something.
141# @param $(incs) Includes. No -I or something.
142# @param $(dirdep) Directory creation dependency.
143# @param $(deps) Other dependencies.
144#
145# @param $(outbase) Output basename (full). Use this for list files and such.
146# @param $(objsuff) Object suffix.
147TOOL_VCC80AMD64_COMPILE_CXX_DEPEND =
148TOOL_VCC80AMD64_COMPILE_CXX_DEPORD =
149TOOL_VCC80AMD64_COMPILE_CXX_OUTPUT = $(call TOOL_VCC80AMD64_PDB, $(outbase)-obj,idb)
150TOOL_VCC80AMD64_COMPILE_CXX_OUTPUT_MAYBE = $(call TOOL_VCC80AMD64_PDB, $(outbase)-obj,pdb)
151define TOOL_VCC80AMD64_COMPILE_CXX_CMDS
152 $(QUIET)$(TOOL_VCC80AMD64_CXX) -c\
153 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
154 -Fd$(outbase)-obj.pdb \
155 -FD\
156 -Fo$(obj)\
157 $(subst /,\\,$(abspath $(source)))
158 $(QUIET)$(DEP_IDB) -f -s -o $(dep) -t $(obj) $(call TOOL_VCC80AMD64_PDB,$(outbase)-obj,idb)
159endef
160
161
162## Compile resource source.
163# @param $(target) Normalized main target name.
164# @param $(source) Source filename (relative).
165# @param $(obj) Object file name. This shall be (re)created by the compilation.
166# @param $(dep) Dependcy file. This shall be (re)created by the compilation.
167# @param $(flags) Flags.
168# @param $(defs) Definitions. No -D or something.
169# @param $(incs) Includes. No -I or something.
170# @param $(dirdep) Directory creation dependency.
171# @param $(deps) Other dependencies.
172#
173# @param $(outbase) Output basename (full). Use this for list files and such.
174# @param $(objsuff) Object suffix.
175TOOL_VCC80AMD64_COMPILE_RC_DEPEND =
176TOOL_VCC80AMD64_COMPILE_RC_DEPORD =
177TOOL_VCC80AMD64_COMPILE_RC_OUTPUT =
178define TOOL_VCC80AMD64_COMPILE_RC_CMDS
179 $(QUIET)$(TOOL_VCC80AMD64_RC) \
180 $(flags) $(addprefix /i, $(subst /,\\,$(incs))) $(addprefix /d, $(defs))\
181 /fo$(obj)\
182 $(subst /,\\,$(abspath $(source)))
183endef
184
185
186## Link library
187# @param $(target) Normalized main target name.
188# @param $(out) Library name.
189# @param $(objs) Object files to put in the library.
190# @param $(flags) Flags.
191# @param $(dirdep) Directory creation dependency.
192# @param $(deps) Other dependencies.
193# @param $(othersrc) Unhandled sources.
194# @param $(outbase) Output basename (full). Use this for list files and such.
195#
196TOOL_VCC80AMD64_LINK_LIBRARY_DEPEND = $(othersrc)
197TOOL_VCC80AMD64_LINK_LIBRARY_DEPORD =
198TOOL_VCC80AMD64_LINK_LIBRARY_OUTPUT = $(outbase).rsp
199TOOL_VCC80AMD64_LINK_LIBRARY_OUTPUT_MAYBE = $(outbase).lst $(outbase).exp $(outbase).pdb
200define TOOL_VCC80AMD64_LINK_LIBRARY_CMDS
201 $(QUIET)$(APPEND) -n $(outbase).rsp \
202 $(foreach arg,\
203 $(subst /,\\,$(objs) \
204 $(filter-out %.def,$(othersrc))) \
205 $(addprefix /DEF:,$(filter %.def,$(othersrc))) \
206 ,\"$(arg)\")
207 $(QUIET)$(TOOL_VCC80AMD64_AR) $(flags) /OUT:$(out) @$(outbase).rsp
208endef
209
210
211## Link program
212# @param $(target) Normalized main target name.
213# @param $(out) Program name.
214# @param $(objs) Object files to link together.
215# @param $(libs) Libraries to search.
216# @param $(libpath) Library search paths.
217# @param $(flags) Flags.
218# @param $(dirdep) Directory creation dependency.
219# @param $(deps) Other dependencies.
220# @param $(othersrc) Unhandled sources.
221# @param $(custom_pre) Custom step invoked before linking.
222# @param $(custom_post) Custom step invoked after linking.
223# @param $(outbase) Output basename (full). Use this for list files and such.
224#
225TOOL_VCC80AMD64_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
226TOOL_VCC80AMD64_LINK_PROGRAM_DEPORD =
227TOOL_VCC80AMD64_LINK_PROGRAM_OUTPUT = $(outbase).map
228TOOL_VCC80AMD64_LINK_PROGRAM_OUTPUT_MAYBE = $(outbase).lib $(outbase).exp $(outbase).pdb $(outbase).ilk $(out).manifest
229define TOOL_VCC80AMD64_LINK_PROGRAM_CMDS
230 $(QUIET)$(TOOL_VCC80AMD64_LD) $(flags) \
231 /OUT:$(out) \
232 /MAPINFO:EXPORTS /INCREMENTAL:NO \
233 /MAP:$(outbase).map \
234 $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
235 $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
236 $(foreach p,$(libpath), /LIBPATH:$(p)) \
237 $(subst /,\\,$(objs)) \
238 $(subst /,\\,$(libs))
239 $(QUIET)$(TEST) -f $(out).manifest -- \
240 $(TOOL_VCC80AMD64_MT) -manifest $(subst /,\\,$(out)).manifest -outputresource:$(subst /,\\,$(out))
241endef
242
243
244## Link DLL.
245# @param $(target) Normalized main target name.
246# @param $(out) DLL name.
247# @param $(objs) Object files to link together.
248# @param $(libs) Libraries to search.
249# @param $(libpath) Library search paths.
250# @param $(flags) Flags.
251# @param $(dirdep) Directory creation dependency.
252# @param $(deps) Other dependencies.
253# @param $(othersrc) Unhandled sources.
254# @param $(custom_pre) Custom step invoked before linking.
255# @param $(custom_post) Custom step invoked after linking.
256#
257# @param $(outbase) Output basename (full). Use this for list files and such.
258TOOL_VCC80AMD64_LINK_DLL_DEPEND = $(objs) $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
259TOOL_VCC80AMD64_LINK_DLL_DEPORD = $(call DIRDEP,$(PATH_LIB))
260TOOL_VCC80AMD64_LINK_DLL_OUTPUT = $(outbase).map $(outbase).lib $(outbase).exp
261TOOL_VCC80AMD64_LINK_DLL_OUTPUT_MAYBE = $(outbase).pdb $(outbase).ilk $(out).manifest
262define TOOL_VCC80AMD64_LINK_DLL_CMDS
263 $(QUIET)$(TOOL_VCC80AMD64_LD) $(flags) \
264 /OUT:$(out) \
265 /IMPLIB:$(outbase).lib \
266 /MAPINFO:EXPORTS /INCREMENTAL:NO \
267 /MAP:$(outbase).map \
268 /DLL \
269 $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
270 $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
271 $(foreach p,$(libpath), /LIBPATH:$(p)) \
272 $(subst /,\\,$(objs)) \
273 $(subst /,\\,$(libs))
274 $(QUIET)$(TEST) -f $(out).manifest -- \
275 $(TOOL_VCC80AMD64_MT) -manifest $(subst /,\\,$(out)).manifest '-outputresource:$(subst /,\\,$(out));#2'
276ifeq ($(filter %.exp .def,$(othersrc)),)
277 $(QUIET)$(CP) --changed --ignore-non-existing $(outbase).exp $(outbase).lib $(PATH_LIB)/
278endif
279$(eval _DIRS += $(PATH_LIB))
280endef
281
282
283## Link system module (windows aka driver, linux aka kernel module)
284# @param $(target) Normalized main target name.
285# @param $(out) System module name.
286# @param $(objs) Object files to link together.
287# @param $(libs) Libraries to search.
288# @param $(libpath) Library search paths.
289# @param $(flags) Flags.
290# @param $(dirdep) Directory creation dependency.
291# @param $(deps) Other dependencies.
292# @param $(othersrc) Unhandled sources.
293# @param $(custom_pre) Custom step invoked before linking.
294# @param $(custom_post) Custom step invoked after linking.
295#
296# @param $(outbase) Output basename (full). Use this for list files and such.
297TOOL_VCC80AMD64_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
298TOOL_VCC80AMD64_LINK_SYSMOD_DEPORD =
299TOOL_VCC80AMD64_LINK_SYSMOD_OUTPUT = $(outbase).map
300TOOL_VCC80AMD64_LINK_SYSMOD_OUTPUT_MAYBE = $(outbase).lib $(outbase).exp $(outbase).pdb $(outbase).ilk $(out).manifest
301define TOOL_VCC80AMD64_LINK_SYSMOD_CMDS
302 $(QUIET)$(TOOL_VCC80AMD64_LD) $(flags) \
303 /OUT:$(out) \
304 /MAPINFO:EXPORTS /INCREMENTAL:NO \
305 /MAP:$(outbase).map \
306 $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
307 $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
308 $(foreach p,$(libpath), /LIBPATH:$(p)) \
309 $(subst /,\\,$(objs)) \
310 $(subst /,\\,$(libs))
311 $(QUIET)$(TEST) -f $(out).manifest -- \
312 $(TOOL_VCC80AMD64_MT) -manifest $(subst /,\\,$(out)).manifest '-outputresource:$(subst /,\\,$(out));#2'
313endef
314
Note: See TracBrowser for help on using the repository browser.