Index: trunk/kBuild/tools/VCC70.kmk
===================================================================
--- trunk/kBuild/tools/VCC70.kmk	(revision 80)
+++ trunk/kBuild/tools/VCC70.kmk	(revision 80)
@@ -0,0 +1,157 @@
+# $Id$
+## @file
+#
+# kBuild Tool Config - Visual C++ 7.0 (aka Visual .NET)
+#
+# Copyright (c) 2004 knut st. osmundsen <bird-srcspam@anduin.net>
+#
+#
+# This file is part of kBuild.
+#
+# kBuild is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# kBuild is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with kBuild; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+#
+#
+
+
+TOOL_VCC70                    := Visual C++ 7.0
+PATH_TOOL_VCC70               ?= $(PATH_DEV)/x86.win32/vcc70
+
+TOOL_VCC70_CC                 := $(PATH_TOOL_VCC70)/bin/cl.exe
+TOOL_VCC70_COBJSUFF           := .obj
+TOOL_VCC70_CFLAGS             := -g
+TOOL_VCC70_CFLAGS.debug       := -O0
+TOOL_VCC70_CFLAGS.release     := -O2
+TOOL_VCC70_CFLAGS.profile     := -pg
+TOOL_VCC70_CINCS              :=
+TOOL_VCC70_CDEFS              :=
+
+TOOL_VCC70_CXX                := $(PATH_TOOL_VCC70)/bin/cl.exe
+TOOL_VCC70_CXXOBJSUFF         := .obj
+TOOL_VCC70_CXXFLAGS           := -g
+TOOL_VCC70_CXXFLAGS.debug     := -O0
+TOOL_VCC70_CXXFLAGS.release   := -O2
+TOOL_VCC70_CXXFLAGS.profile   := -pg
+TOOL_VCC70_CXXINCS            :=
+TOOL_VCC70_CXXDEFS            :=
+
+TOOL_VCC70_AS                 := $(PATH_TOOL_VCC70)/bin/ml.exe
+TOOL_VCC70_ASOBJSUFF          := .obj
+
+TOOL_VCC70_AR                 := $(PATH_TOOL_VCC70)/bin/ar$(HOSTSUFF_EXE)
+TOOL_VCC70_ARFLAGS            := cr
+TOOL_VCC70_ARLIBSUFF          := .lib
+
+TOOL_VCC70_LD                 := $(PATH_TOOL_VCC70)/bin/link.exe
+TOOL_VCC70_LDFLAGS            :=
+TOOL_VCC70_LDFLAGS.debug      := -g
+TOOL_VCC70_LDFLAGS.release    := -s
+
+
+## Compile C source.
+# @param    $(target)   Normalized main target name.
+# @param    $(source)   Source filename (relative).
+# @param	$(obj)      Object file name. This shall be (re)created by the compilation.
+# @param    $(dep)	    Dependcy file. This shall be (re)created by the compilation.
+# @param    $(flags)    Flags.
+# @param    $(defs)     Definitions. No -D or something.
+# @param    $(incs)     Includes. No -I or something.
+# @param	$(dirdep)   Directory creation dependency.
+#
+# @param    $(outbase)  Output basename (full). Use this for list files and such.
+# @param	$(objsuff)  Object suffix.
+define TOOL_VCC70_COMPILE_C
+#$ (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))
+$(obj): $(dirdep) $(PATH_CURRENT)/$(source)
+	$(call MSG_L2,Compiling $$@ using GCC)
+	$(TOOL_VCC70_CC) -c\
+		$(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
+		-Fo:$$@\
+		$(PATH_CURRENT)/$(source)		
+		
+endef
+
+
+## Compile C++ source.
+# @param    $(target)   Normalized main target name.
+# @param    $(source)   Source filename (relative).
+# @param	$(obj)      Object file name. This shall be (re)created by the compilation.
+# @param    $(dep)	    Dependcy file. This shall be (re)created by the compilation.
+# @param    $(flags)    Flags.
+# @param    $(defs)     Definitions. No -D or something.
+# @param    $(incs)     Includes. No -I or something.
+# @param	$(dirdep)   Directory creation dependency.
+#
+# @param    $(outbase)  Output basename (full). Use this for list files and such.
+# @param	$(objsuff)  Object suffix.
+define TOOL_VCC70_COMPILE_CXX
+#$ (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))
+$(obj): $(dirdep) $(PATH_CURRENT)/$(source)
+	$(call MSG_L2,Compiling $$@ using GCC)
+	$(TOOL_VCC70_CXX) -c\
+		$(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
+		-Fo:$$@\
+		$(PATH_CURRENT)/$(source)		
+		
+endef
+
+
+## Link library
+# @param    $(target)   Normalized main target name.
+# @param    $(lib)		Library name.
+# @param    $(objs)     Object files to put in the library.
+# @param    $(flags)    Flags.
+# @param	$(dirdep)   Directory creation dependency.
+# @param	$(deps)		Other dependencies.
+#
+# @param    $(outbase)  Output basename (full). Use this for list files and such.
+define TOOL_VCC70_LINK_LIBRARY
+#$ (warning dbg: TOOL_VCC70_LINK_LIBRARY: target=$(target) lib=$(lib) objs=$(objs) deps=$(deps) flags=$(flags) dirdep=$(dirdep) outbase=$(outbase))
+$(lib): $(dirdep) $(objs) $(deps)
+	$(call MSG_L1,Creating Library $$@)
+	$(RM) -f $$@
+	$(TOOL_VCC70_AR) $(flags) /OUT:$$@ $(objs)
+	
+endef
+
+
+## Link program
+# @param    $(target)   Normalized main target name.
+# @param    $(exe)		Program name.
+# @param    $(objs)     Object files to link together.
+# @param    $(libs)     Libraries to search.
+# @param    $(libpath)  Library search paths.
+# @param    $(flags)    Flags.
+# @param	$(dirdep)   Directory creation dependency.
+# @param	$(deps)		Other dependencies.
+# @param	$(deffile)  Definition file. (optional, PC only)
+# @param	$(custom_pre)   Custom step invoked before linking.
+# @param	$(custom_post)  Custom step invoked after linking.
+#
+# @param    $(outbase)  Output basename (full). Use this for list files and such.
+define TOOL_VCC70_LINK_PROGRAM
+#$ (warning dbg: TOOL_VCC70_LINK_PROGRAM: target=$(target) exe=$(exe) objs=$(objs) libs=$(libs) deps=$(deps) flags=$(flags) dirdep=$(dirdep) deffile=$(deffile) outbase=$(outbase))
+$(exe): $(dirdep) $(objs) $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(deps)
+	$(call MSG_L1,Creating Program $$@)
+ifneq ($(custom_pre),)
+	$(eval $(custom_pre))
+endif	
+	$(TOOL_VCC70_LD) $(flags) /OUT:$$@ $(objs) \
+	$(foreach lib,$(libs), $(if $(findstring $(lib),$(subst /,x,$(lib))), -l$(patsubst lib%,%,$(basename $(lib))), $(lib)))
+ifneq ($(custom_post),)
+	$(eval $(custom_post))
+endif	
+	
+endef
+
