source: trunk/kBuild/tools/VCC70.kmk@ 82

Last change on this file since 82 was 82, checked in by bird, 21 years ago

..

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 6.1 KB
Line 
1# $Id: VCC70.kmk 82 2004-06-01 13:46:22Z bird $
2## @file
3#
4# kBuild Tool Config - Visual C++ 7.0 (aka Visual .NET)
5#
6# Copyright (c) 2004 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
27
28TOOL_VCC70 := Visual C++ 7.0
29PATH_TOOL_VCC70 ?= $(PATH_DEV)/x86.win32/vcc70
30
31TOOL_VCC70_CC := $(EXEC_X86_WIN32) $(PATH_TOOL_VCC70)/bin/cl.exe
32TOOL_VCC70_COBJSUFF := .obj
33TOOL_VCC70_CFLAGS := -TC -c -nologo
34TOOL_VCC70_CFLAGS.debug := -Od -Zi
35TOOL_VCC70_CFLAGS.release := -O2
36TOOL_VCC70_CFLAGS.profile :=
37TOOL_VCC70_CINCS := $(PATH_TOOL_VCC70)/include
38TOOL_VCC70_CDEFS :=
39
40TOOL_VCC70_CXX := $(EXEC_X86_WIN32) $(PATH_TOOL_VCC70)/bin/cl.exe
41TOOL_VCC70_CXXOBJSUFF := .obj
42TOOL_VCC70_CXXFLAGS := -TP -c -nologo
43TOOL_VCC70_CXXFLAGS.debug := -Od -Zi
44TOOL_VCC70_CXXFLAGS.release := -O2
45TOOL_VCC70_CXXFLAGS.profile :=
46TOOL_VCC70_CXXINCS := $(PATH_TOOL_VCC70)/include
47TOOL_VCC70_CXXDEFS :=
48
49TOOL_VCC70_AS := $(EXEC_X86_WIN32) $(PATH_TOOL_VCC70)/bin/ml.exe
50TOOL_VCC70_ASOBJSUFF := .obj
51
52TOOL_VCC70_AR := $(EXEC_X86_WIN32) $(PATH_TOOL_VCC70)/bin/ar$(HOSTSUFF_EXE)
53TOOL_VCC70_ARFLAGS := -nologo
54TOOL_VCC70_ARLIBSUFF := .lib
55
56TOOL_VCC70_LD := $(EXEC_X86_WIN32) $(PATH_TOOL_VCC70)/bin/link.exe
57TOOL_VCC70_LDFLAGS := -nologo
58TOOL_VCC70_LDFLAGS.debug :=
59TOOL_VCC70_LDFLAGS.release :=
60
61
62## Compile C source.
63# @param $(target) Normalized main target name.
64# @param $(source) Source filename (relative).
65# @param $(obj) Object file name. This shall be (re)created by the compilation.
66# @param $(dep) Dependcy file. This shall be (re)created by the compilation.
67# @param $(flags) Flags.
68# @param $(defs) Definitions. No -D or something.
69# @param $(incs) Includes. No -I or something.
70# @param $(dirdep) Directory creation dependency.
71#
72# @param $(outbase) Output basename (full). Use this for list files and such.
73# @param $(objsuff) Object suffix.
74define TOOL_VCC70_COMPILE_C
75#$ (warning dbg: TOOL_VCC70_COMPILE_C: target=$(target) source=$(source) obj=$(obj) dep=$(dep) flags=$(flags) defs=$(defs) incs=$(incs) dirdep=$(dirdep) outbase=$(outbase) objsuff=$(objsuff))
76$(obj): $(dirdep) $(PATH_CURRENT)/$(source)
77 $(call MSG_L2,Compiling $$@ using GCC)
78 $(TOOL_VCC70_CC) -c\
79 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
80 -Fo:$$@\
81 $(PATH_CURRENT)/$(source)
82
83endef
84
85
86## Compile C++ source.
87# @param $(target) Normalized main target name.
88# @param $(source) Source filename (relative).
89# @param $(obj) Object file name. This shall be (re)created by the compilation.
90# @param $(dep) Dependcy file. This shall be (re)created by the compilation.
91# @param $(flags) Flags.
92# @param $(defs) Definitions. No -D or something.
93# @param $(incs) Includes. No -I or something.
94# @param $(dirdep) Directory creation dependency.
95#
96# @param $(outbase) Output basename (full). Use this for list files and such.
97# @param $(objsuff) Object suffix.
98define TOOL_VCC70_COMPILE_CXX
99#$ (warning dbg: TOOL_VCC70_COMPILE_CXX: target=$(target) source=$(source) obj=$(obj) dep=$(dep) flags=$(flags) defs=$(defs) incs=$(incs) dirdep=$(dirdep) outbase=$(outbase) objsuff=$(objsuff))
100$(obj): $(dirdep) $(PATH_CURRENT)/$(source)
101 $(call MSG_L2,Compiling $$@ using GCC)
102 $(TOOL_VCC70_CXX) -c\
103 $(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
104 -Fo:$$@\
105 $(PATH_CURRENT)/$(source)
106
107endef
108
109
110## Link library
111# @param $(target) Normalized main target name.
112# @param $(lib) Library name.
113# @param $(objs) Object files to put in the library.
114# @param $(flags) Flags.
115# @param $(dirdep) Directory creation dependency.
116# @param $(deps) Other dependencies.
117#
118# @param $(outbase) Output basename (full). Use this for list files and such.
119define TOOL_VCC70_LINK_LIBRARY
120#$ (warning dbg: TOOL_VCC70_LINK_LIBRARY: target=$(target) lib=$(lib) objs=$(objs) deps=$(deps) flags=$(flags) dirdep=$(dirdep) outbase=$(outbase))
121$(lib): $(dirdep) $(objs) $(deps)
122 $(call MSG_L1,Creating Library $$@)
123 $(RM) -f $$@
124 $(TOOL_VCC70_AR) $(flags) /OUT:$$@ $(objs)
125
126endef
127
128
129## Link program
130# @param $(target) Normalized main target name.
131# @param $(exe) Program name.
132# @param $(objs) Object files to link together.
133# @param $(libs) Libraries to search.
134# @param $(libpath) Library search paths.
135# @param $(flags) Flags.
136# @param $(dirdep) Directory creation dependency.
137# @param $(deps) Other dependencies.
138# @param $(deffile) Definition file. (optional, PC only)
139# @param $(custom_pre) Custom step invoked before linking.
140# @param $(custom_post) Custom step invoked after linking.
141#
142# @param $(outbase) Output basename (full). Use this for list files and such.
143define TOOL_VCC70_LINK_PROGRAM
144#$ (warning dbg: TOOL_VCC70_LINK_PROGRAM: target=$(target) exe=$(exe) objs=$(objs) libs=$(libs) deps=$(deps) flags=$(flags) dirdep=$(dirdep) deffile=$(deffile) outbase=$(outbase))
145$(exe): $(dirdep) $(objs) $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(deps)
146 $(call MSG_L1,Creating Program $$@)
147ifneq ($(custom_pre),)
148 $(eval $(custom_pre))
149endif
150 $(TOOL_VCC70_LD) $(flags) /OUT:$$@ $(objs) \
151 $(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(basename $(lib))), $(lib)))
152ifneq ($(custom_post),)
153 $(eval $(custom_post))
154endif
155
156endef
157
Note: See TracBrowser for help on using the repository browser.