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

Last change on this file since 1668 was 1547, checked in by bird, 17 years ago

License clearification.

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