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

Last change on this file since 736 was 735, checked in by bird, 19 years ago

VCC*_OLD_DEPS

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 13.8 KB
Line 
1# $Id: VCC80AMD64.kmk 735 2006-12-17 04:56:21Z 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-2006 knut st. osmundsen <bird-srcspam@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 := $(wildcard $(PATH_DEVTOOLS)/win.x86/vcc/v8)
37 endif
38 ifeq ($(PATH_TOOL_VCC80AMD64),)
39 PATH_TOOL_VCC80AMD64 := $(wildcard $(PATH_DEVTOOLS)/x86.win32/vcc/v8)
40 endif
41 ifneq ($(PATH_TOOL_VCC80AMD64),)
42 # done for now
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_VCC80X86)/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.
74ifeq ($(filter tolower,$(KMK_FEATURES)),tolower)
75TOOL_VCC80AMD64_PDB = $(dir $(1))$(tolower $(notdir $(1))).$(2)
76else # this fallback is incorrect and won't work on a case sensitive FS.
77TOOL_VCC80AMD64_PDB = $(1).$(2)
78endif
79
80TOOL_VCC80AMD64_COBJSUFF ?= .obj
81TOOL_VCC80AMD64_CFLAGS ?= -TC -c -nologo
82TOOL_VCC80AMD64_CFLAGS.debug ?= -Od -Zi
83TOOL_VCC80AMD64_CFLAGS.release ?= -O2
84TOOL_VCC80AMD64_CFLAGS.profile ?= -O2
85TOOL_VCC80AMD64_CINCS ?= $(PATH_TOOL_VCC80AMD64_INC)
86TOOL_VCC80AMD64_CDEFS ?=
87
88TOOL_VCC80AMD64_CXXOBJSUFF ?= .obj
89TOOL_VCC80AMD64_CXXFLAGS ?= -TP -c -nologo
90TOOL_VCC80AMD64_CXXFLAGS.debug ?= -Od -Zi
91TOOL_VCC80AMD64_CXXFLAGS.release ?= -O2
92TOOL_VCC80AMD64_CXXFLAGS.profile ?= -O2
93TOOL_VCC80AMD64_CXXINCS ?= $(PATH_TOOL_VCC80AMD64_INC) $(PATH_TOOL_VCC80AMD64_ATLMFC_INC)
94TOOL_VCC80AMD64_CXXDEFS ?=
95
96TOOL_VCC80AMD64_ASOBJSUFF ?= .obj
97
98TOOL_VCC80AMD64_RCOBJSUFF ?= .res
99TOOL_VCC80AMD64_RCINCS ?= $(PATH_TOOL_VCC80AMD64_INC) $(PATH_TOOL_VCC80AMD64_ATLMFC_INC)
100
101TOOL_VCC80AMD64_ARFLAGS ?= -nologo -machine:amd64
102TOOL_VCC80AMD64_ARLIBSUFF ?= .lib
103
104TOOL_VCC80AMD64_LDFLAGS ?= -nologo -machine:amd64
105TOOL_VCC80AMD64_LDFLAGS.debug ?= -debug
106TOOL_VCC80AMD64_LDFLAGS.release ?=
107
108
109
110## Compile C source.
111# @param $(target) Normalized main target name.
112# @param $(source) Source filename (relative).
113# @param $(obj) Object file name. This shall be (re)created by the compilation.
114# @param $(dep) Dependcy file. This shall be (re)created by the compilation.
115# @param $(flags) Flags.
116# @param $(defs) Definitions. No -D or something.
117# @param $(incs) Includes. No -I or something.
118# @param $(dirdep) Directory creation dependency.
119# @param $(deps) Other dependencies.
120#
121# @param $(outbase) Output basename (full). Use this for list files and such.
122# @param $(objsuff) Object suffix.
123TOOL_VCC80AMD64_COMPILE_C_OUTPUT = $(call TOOL_VCC80AMD64_PDB, $(outbase)-obj,pdb) $(call TOOL_VCC80AMD64_PDB, $(outbase)-obj,idb)
124TOOL_VCC80AMD64_COMPILE_C_DEPEND =
125TOOL_VCC80AMD64_COMPILE_C_DEPORD =
126ifndef VCC80AMD64_OLD_DEPS
127define TOOL_VCC80AMD64_COMPILE_C_CMDS
128 $(QUIET)$(TOOL_VCC80AMD64_CC) -c\
129 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
130 -Fd$(outbase)-obj.pdb \
131 -FD\
132 -Fo$(obj)\
133 $(subst /,\\,$(abspath $(source)))
134 $(QUIET)$(DEP_IDB) -f -s -o $(dep) -t $(obj) $(call TOOL_VCC80AMD64_PDB,$(outbase)-obj,idb)
135endef
136else
137define TOOL_VCC80AMD64_COMPILE_C_CMDS
138 $(QUIET)$(TOOL_VCC80AMD64_CC) -c\
139 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
140 -Fd$(outbase)-obj.pdb \
141 -Fo$(obj)\
142 $(subst /,\\,$(abspath $(source)))
143 $(QUIET)$(TOOL_VCC80AMD64_CC) -E\
144 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
145 $(subst /,\\,$(abspath $(source)))\
146 | $(DEP_PRE) -f -s -o $(dep) -t $(obj) -
147endef
148endif
149
150
151## Compile C++ source.
152# @param $(target) Normalized main target name.
153# @param $(source) Source filename (relative).
154# @param $(obj) Object file name. This shall be (re)created by the compilation.
155# @param $(dep) Dependcy file. This shall be (re)created by the compilation.
156# @param $(flags) Flags.
157# @param $(defs) Definitions. No -D or something.
158# @param $(incs) Includes. No -I or something.
159# @param $(dirdep) Directory creation dependency.
160# @param $(deps) Other dependencies.
161#
162# @param $(outbase) Output basename (full). Use this for list files and such.
163# @param $(objsuff) Object suffix.
164TOOL_VCC80AMD64_COMPILE_CXX_OUTPUT = $(call TOOL_VCC80AMD64_PDB, $(outbase)-obj,pdb) $(call TOOL_VCC80AMD64_PDB, $(outbase)-obj,idb)
165TOOL_VCC80AMD64_COMPILE_CXX_DEPEND =
166TOOL_VCC80AMD64_COMPILE_CXX_DEPORD =
167ifndef VCC80AMD64_OLD_DEPS
168define TOOL_VCC80AMD64_COMPILE_CXX_CMDS
169 $(QUIET)$(TOOL_VCC80AMD64_CXX) -c\
170 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
171 -Fd$(outbase)-obj.pdb \
172 -FD\
173 -Fo$(obj)\
174 $(subst /,\\,$(abspath $(source)))
175 $(QUIET)$(DEP_IDB) -f -s -o $(dep) -t $(obj) $(call TOOL_VCC80AMD64_PDB,$(outbase)-obj,idb)
176endef
177else
178define TOOL_VCC80AMD64_COMPILE_CXX_CMDS
179 $(QUIET)$(TOOL_VCC80AMD64_CXX) -c\
180 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
181 -Fd$(outbase)-obj.pdb \
182 -Fo$(obj)\
183 $(subst /,\\,$(abspath $(source)))
184 $(QUIET)$(TOOL_VCC80AMD64_CXX) -E\
185 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
186 $(subst /,\\,$(abspath $(source)))\
187 | $(DEP_PRE) -f -s -o $(dep) -t $(obj) -
188endef
189endif
190
191
192## Compile resource source.
193# @param $(target) Normalized main target name.
194# @param $(source) Source filename (relative).
195# @param $(obj) Object file name. This shall be (re)created by the compilation.
196# @param $(dep) Dependcy file. This shall be (re)created by the compilation.
197# @param $(flags) Flags.
198# @param $(defs) Definitions. No -D or something.
199# @param $(incs) Includes. No -I or something.
200# @param $(dirdep) Directory creation dependency.
201# @param $(deps) Other dependencies.
202#
203# @param $(outbase) Output basename (full). Use this for list files and such.
204# @param $(objsuff) Object suffix.
205TOOL_VCC80AMD64_COMPILE_RC_OUTPUT =
206TOOL_VCC80AMD64_COMPILE_RC_DEPEND =
207TOOL_VCC80AMD64_COMPILE_RC_DEPORD =
208define TOOL_VCC80AMD64_COMPILE_RC_CMDS
209 $(QUIET)$(TOOL_VCC80AMD64_RC) \
210 $(flags) $(addprefix /i, $(subst /,\\,$(incs))) $(addprefix /d, $(defs))\
211 /fo$(obj)\
212 $(subst /,\\,$(abspath $(source)))
213endef
214
215
216## Link library
217# @param $(target) Normalized main target name.
218# @param $(out) Library name.
219# @param $(objs) Object files to put in the library.
220# @param $(flags) Flags.
221# @param $(dirdep) Directory creation dependency.
222# @param $(deps) Other dependencies.
223# @param $(othersrc) Unhandled sources.
224# @param $(outbase) Output basename (full). Use this for list files and such.
225#
226TOOL_VCC80AMD64_LINK_LIBRARY_OUTPUT = $(outbase).lst $(outbase).exp $(outbase).pdb
227TOOL_VCC80AMD64_LINK_LIBRARY_DEPEND = $(othersrc)
228TOOL_VCC80AMD64_LINK_LIBRARY_DEPORD =
229define TOOL_VCC80AMD64_LINK_LIBRARY_CMDS
230 $(QUIET)$(TOOL_VCC80AMD64_AR) $(flags) /OUT:$(out) $(subst /,\\,$(objs) $(filter %.a %.lib,$(othersrc))) \
231 $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def))
232endef
233
234
235## Link program
236# @param $(target) Normalized main target name.
237# @param $(out) Program name.
238# @param $(objs) Object files to link together.
239# @param $(libs) Libraries to search.
240# @param $(libpath) Library search paths.
241# @param $(flags) Flags.
242# @param $(dirdep) Directory creation dependency.
243# @param $(deps) Other dependencies.
244# @param $(othersrc) Unhandled sources.
245# @param $(custom_pre) Custom step invoked before linking.
246# @param $(custom_post) Custom step invoked after linking.
247# @param $(outbase) Output basename (full). Use this for list files and such.
248#
249TOOL_VCC80AMD64_LINK_PROGRAM_OUTPUT = $(outbase).map $(outbase).lib $(outbase).exp $(outbase).pdb $(outbase).ilk $(out).manifest
250TOOL_VCC80AMD64_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
251TOOL_VCC80AMD64_LINK_PROGRAM_DEPORD =
252define TOOL_VCC80AMD64_LINK_PROGRAM_CMDS
253 $(QUIET)$(TOOL_VCC80AMD64_LD) $(flags) \
254 /OUT:$(out) \
255 /MAPINFO:EXPORTS /INCREMENTAL:NO \
256 /MAP:$(outbase).map \
257 $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
258 $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
259 $(foreach p,$(libpath), /LIBPATH:$(p)) \
260 $(subst /,\\,$(objs)) \
261 $(subst /,\\,$(libs))
262 $(QUIET)if test -f $(out).manifest; then \
263 $(TOOL_VCC80AMD64_MT) -manifest $(subst /,\\,$(out)).manifest -outputresource:$(subst /,\\,$(out)); \
264 fi
265endef
266
267
268## Link DLL.
269# @param $(target) Normalized main target name.
270# @param $(out) DLL name.
271# @param $(objs) Object files to link together.
272# @param $(libs) Libraries to search.
273# @param $(libpath) Library search paths.
274# @param $(flags) Flags.
275# @param $(dirdep) Directory creation dependency.
276# @param $(deps) Other dependencies.
277# @param $(othersrc) Unhandled sources.
278# @param $(custom_pre) Custom step invoked before linking.
279# @param $(custom_post) Custom step invoked after linking.
280#
281# @param $(outbase) Output basename (full). Use this for list files and such.
282TOOL_VCC80AMD64_LINK_DLL_OUTPUT = $(outbase).map $(outbase).lib $(outbase).exp $(outbase).pdb $(outbase).ilk $(out).manifest
283TOOL_VCC80AMD64_LINK_DLL_DEPEND = $(objs) $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
284TOOL_VCC80AMD64_LINK_DLL_DEPORD = $(call DIRDEP,$(PATH_LIB))
285define TOOL_VCC80AMD64_LINK_DLL_CMDS
286 $(QUIET)$(TOOL_VCC80AMD64_LD) $(flags) \
287 /OUT:$(out) \
288 /IMPLIB:$(outbase).lib \
289 /MAPINFO:EXPORTS /INCREMENTAL:NO \
290 /MAP:$(outbase).map \
291 /DLL \
292 $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
293 $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
294 $(foreach p,$(libpath), /LIBPATH:$(p)) \
295 $(subst /,\\,$(objs)) \
296 $(subst /,\\,$(libs))
297 $(QUIET)if test -f $(out).manifest; then \
298 $(TOOL_VCC80AMD64_MT) -manifest $(subst /,\\,$(out)).manifest "-outputresource:$(subst /,\\,$(out));#2"; \
299 fi
300ifeq ($(filter %.exp .def,$(othersrc)),)
301 $(QUIET)if test -f $(outbase).exp; then $(CP_EXT) $(outbase).exp $(PATH_LIB)/; fi
302 $(QUIET)if test -f $(outbase).lib; then $(CP_EXT) $(outbase).lib $(PATH_LIB)/; fi
303endif
304$(eval _DIRS += $(PATH_LIB))
305endef
306
307
308## Link system module (windows aka driver, linux aka kernel module)
309# @param $(target) Normalized main target name.
310# @param $(out) System module name.
311# @param $(objs) Object files to link together.
312# @param $(libs) Libraries to search.
313# @param $(libpath) Library search paths.
314# @param $(flags) Flags.
315# @param $(dirdep) Directory creation dependency.
316# @param $(deps) Other dependencies.
317# @param $(othersrc) Unhandled sources.
318# @param $(custom_pre) Custom step invoked before linking.
319# @param $(custom_post) Custom step invoked after linking.
320#
321# @param $(outbase) Output basename (full). Use this for list files and such.
322TOOL_VCC80AMD64_LINK_SYSMOD_OUTPUT = $(outbase).map $(outbase).lib $(outbase).exp $(outbase).pdb $(outbase).ilk $(out).manifest
323TOOL_VCC80AMD64_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
324TOOL_VCC80AMD64_LINK_SYSMOD_DEPORD =
325define TOOL_VCC80AMD64_LINK_SYSMOD_CMDS
326 $(QUIET)$(TOOL_VCC80AMD64_LD) $(flags) \
327 /OUT:$(out) \
328 /MAPINFO:EXPORTS /INCREMENTAL:NO \
329 /MAP:$(outbase).map \
330 $(foreach def,$(filter %.def,$(othersrc)), /DEF:$(def)) \
331 $(subst /,\\,$(filter %.exp %.res,$(othersrc))) \
332 $(foreach p,$(libpath), /LIBPATH:$(p)) \
333 $(subst /,\\,$(objs)) \
334 $(subst /,\\,$(libs))
335 $(QUIET)if test -f $(out).manifest; then \
336 $(TOOL_VCC80AMD64_MT) -manifest $(subst /,\\,$(out)).manifest "-outputresource:$(subst /,\\,$(out));#2"; \
337 fi
338endef
339
Note: See TracBrowser for help on using the repository browser.