Index: trunk/kBuild/tools/MASM510.kmk
===================================================================
--- trunk/kBuild/tools/MASM510.kmk	(revision 2065)
+++ trunk/kBuild/tools/MASM510.kmk	(revision 2065)
@@ -0,0 +1,97 @@
+# $Id$
+## @file
+# kBuild Tool Config - MASM v5.10
+#
+
+#
+# Copyright (c) 2008 knut st. osmundsen <bird-kBuild-spam@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
+#
+#
+# As a special exception you are granted permission to include this file, via
+# the kmk include directive, as you wish without this in itself causing the 
+# resulting makefile, program or whatever to be covered by the GPL license. 
+# This exception does not however invalidate any other reasons why the makefile,
+# program, whatever should not be covered the GPL.
+#
+#
+
+TOOL_MASM510 := Microsoft Macro Assembler v5.10
+
+# Tool Specific Properties
+ifndef TOOL_MASM510_AS
+ TOOL_MASM510_AS := $(firstword $(rsort $(wildcard $(PATH_DEVTOOLS_BLD)/masm/v5.10*/masm$(HOSTSUFF_EXE))))
+ ifeq ($(TOOL_MASM510_AS),)
+  TOOL_MASM510_AS := $(firstword $(rsort $(wildcard $(PATH_DEVTOOLS_TRG)/masm/v5.10*/masm$(HOSTSUFF_EXE))))
+ endif
+ ifeq ($(TOOL_MASM510_AS),)
+  TOOL_MASM510_AS := $(firstword $(rsort $(wildcard $(PATH_DEVTOOLS)/os2.x86/ddk/*/base/tools/masm$(HOSTSUFF_EXE))))
+ endif
+ ifeq ($(TOOL_MASM510_AS),)
+  TOOL_MASM510_AS := $(firstword $(rsort $(wildcard \
+	$(PATH_DEVTOOLS)/os2.x86/ddk/*/video/tools/os2.386/lx.386/bin/masm$(HOSTSUFF_EXE) \
+	$(PATH_DEVTOOLS)/os2.x86/ddk/*/base32/tools/os2.386/bin/masm$(HOSTSUFF_EXE) \
+	$(PATH_DEVTOOLS)/os2.x86/ddk/*/base32/tools/os2.386/lx.386/bin/masm$(HOSTSUFF_EXE) \
+	$(PATH_DEVTOOLS)/os2.x86/ddk/*/print/tools/os2.386/lx.386/bin/masm$(HOSTSUFF_EXE) \
+	$(PATH_DEVTOOLS)/os2.x86/ddk/*/wpshell/tools/os2.386/lx.386/bin/masm$(HOSTSUFF_EXE) \
+	$(PATH_DEVTOOLS)/os2.x86/ddk/*/mme/tools/os2.386/lx.386/bin/masm$(HOSTSUFF_EXE) \
+	)))
+ endif
+ ifneq ($(TOOL_MASM510_AS),)
+  TOOL_MASM510_AS := $(TOOL_MASM510_AS)
+ endif
+endif
+ifeq ($(TOOL_MASM510_AS),)
+ TOOL_MASM510_AS := $(firstword $(which masm$(HOSTSUFF_EXE)) path/notfound/masm$(HOSTSUFF_EXE))
+endif
+
+# General Properties used by kBuild
+TOOL_MASM510_ASFLAGS ?= -t -z -Zd -Zi -t
+
+
+## Compile Assembly 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    $(deps)     Other dependencies.
+#
+# @param    $(outbase)  Output basename (full). Use this for list files and such.
+# @param    $(objsuff)  Object suffix.
+#
+# @remarks  MASM v5.10 has severe length limitations in several places and will respond with
+#           crashing when these are exceeded. Thus, we use MASM and INCLUDE to avoid exceeding
+#           the command line length (and the MASM length). 
+#           The closing of file handles and zapping of environment is to make sure it doesn't
+#           mess up due handles left behind by some device init or because the env is too big.
+TOOL_MASM510_COMPILE_AS_OUTPUT = $(outbase).lst
+TOOL_MASM510_COMPILE_AS_DEPEND =
+TOOL_MASM510_COMPILE_AS_DEPORD =
+define TOOL_MASM510_COMPILE_AS_CMDS
+	$(QUIET)$(REDIRECT) \
+		-c3 -c4 -c5 -c6 -c7 -c8 -c9 -c10 -c11 -c12 -c13 -c14 -c15 -c16 -c17 -c18 -c19 -Z \
+		-E 'MASM=$(addprefix -D, $(subst /,\,$(defs)))' \
+		-E 'INCLUDE=$(subst $(SP),,$(addsuffix ;,$(subst /,\,$(incs))))' \
+		-- \
+		$(subst /,\\,$(TOOL_MASM510_AS)) $(strip $(flags)) '$(subst /,\,$(source),$(obj),$(outbase).lst);'
+endef
+
Index: trunk/kBuild/tools/MSLINK510.kmk
===================================================================
--- trunk/kBuild/tools/MSLINK510.kmk	(revision 2065)
+++ trunk/kBuild/tools/MSLINK510.kmk	(revision 2065)
@@ -0,0 +1,104 @@
+# $Id$
+## @file
+# kBuild Tool Config - Microsoft Link v5.10
+#
+
+#
+# Copyright (c) 2008 knut st. osmundsen <bird-kBuild-spam@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
+#
+#
+# As a special exception you are granted permission to include this file, via
+# the kmk include directive, as you wish without this in itself causing the
+# resulting makefile, program or whatever to be covered by the GPL license.
+# This exception does not however invalidate any other reasons why the makefile,
+# program, whatever should not be covered the GPL.
+#
+#
+
+TOOL_MSLINK510 := Microsoft Segmented-Executable Linker  Version 5.10
+
+# Tool Specific Properties
+ifndef TOOL_MSLINK510_LD
+ TOOL_MSLINK510_LD := $(firstword $(rsort $(wildcard $(PATH_DEVTOOLS)/os2.x86/ddk/*/base/tools/link$(HOSTSUFF_EXE))))
+ ifeq ($(TOOL_MSLINK510_LD),)
+  TOOL_MSLINK510_LD := $(firstword $(rsort $(wildcard \
+	$(PATH_DEVTOOLS)/os2.x86/ddk/*/video/tools/os2.386/lx.386/bin/link$(HOSTSUFF_EXE) \
+	$(PATH_DEVTOOLS)/os2.x86/ddk/*/base32/tools/os2.386/bin/link$(HOSTSUFF_EXE) \
+	$(PATH_DEVTOOLS)/os2.x86/ddk/*/base32/tools/os2.386/lx.386/bin/link$(HOSTSUFF_EXE) \
+	$(PATH_DEVTOOLS)/os2.x86/ddk/*/print/tools/os2.386/lx.386/bin/link$(HOSTSUFF_EXE) \
+	$(PATH_DEVTOOLS)/os2.x86/ddk/*/wpshell/tools/os2.386/lx.386/bin/link$(HOSTSUFF_EXE) \
+	$(PATH_DEVTOOLS)/os2.x86/ddk/*/mme/tools/os2.386/lx.386/bin/link$(HOSTSUFF_EXE) \
+	)))
+ endif
+ ifneq ($(TOOL_MSLINK510_LD),)
+  TOOL_MSLINK510_LD := $(TOOL_MSLINK510_LD)
+ endif
+endif
+ifeq ($(TOOL_MSLINK510_LD),)
+ TOOL_MSLINK510_LD := $(firstword $(which link$(HOSTSUFF_EXE)) path/notfound/link$(HOSTSUFF_EXE))
+endif
+
+TOOL_MSLINK510_ENV_SETUP = $(REDIRECT) \
+	-Z -E 'LIB=$1' \
+	--
+
+# General Properties used by kBuild
+TOOL_MSLINK510_LDFLAGS ?= /nologo /map:full /linenumbers
+
+TOOL_MSLINK510_LINK_PROGRAM_OUTPUT = $(outbase).map $(outbase).rsp
+TOOL_MSLINK510_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
+TOOL_MSLINK510_LINK_PROGRAM_DEPORD =
+define TOOL_MSLINK510_LINK_PROGRAM_CMDS
+	$(QUIET)$(APPEND) -n $(outbase).rsp '$(subst $(SP),+' ',$(strip $(subst /,\,$(objs)))),'
+	$(QUIET)$(APPEND) $(outbase).rsp '$(subst /,\,$(out)),'
+	$(QUIET)$(APPEND) $(outbase).rsp '$(subst /,\,$(outbase)).map,'
+	$(QUIET)$(APPEND) -n $(outbase).rsp '$(subst $(SP),+' ',$(strip $(subst /,\,$(libs))))$(if $(filter %.def,$(othersrc)),$(COMMA),;)'
+	$(if $(filter %.def,$(othersrc)),$(QUIET)$(APPEND) $(outbase).rsp '$(subst /,\,$(filter %.def,$(othersrc)));',)
+	$(QUIET)$(call TOOL_MSLINK510_ENV_SETUP,$(subst $(SP),;,$(libpath))) \
+		$(TOOL_MSLINK510_LD) $(flags) '@$(subst /,\,$(outbase).rsp)'
+endef
+
+
+TOOL_MSLINK510_LINK_DLL_OUTPUT = $(outbase).map $(outbase).rsp
+TOOL_MSLINK510_LINK_DLL_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
+TOOL_MSLINK510_LINK_DLL_DEPORD =
+define TOOL_MSLINK510_LINK_DLL_CMDS
+	$(QUIET)$(APPEND) -n $(outbase).rsp '$(subst $(SP),+' ',$(strip $(subst /,\,$(objs)))),'
+	$(QUIET)$(APPEND) $(outbase).rsp '$(subst /,\,$(out)),'
+	$(QUIET)$(APPEND) $(outbase).rsp '$(subst /,\,$(outbase)).map,'
+	$(QUIET)$(APPEND) -n $(outbase).rsp '$(subst $(SP),+' ',$(strip $(subst /,\,$(libs))))$(if $(filter %.def,$(othersrc)),$(COMMA),;)'
+	$(if $(filter %.def,$(othersrc)),$(QUIET)$(APPEND) $(outbase).rsp '$(subst /,\,$(filter %.def,$(othersrc)));',)
+	$(QUIET)$(call TOOL_MSLINK510_ENV_SETUP,$(subst $(SP),;,$(libpath))) \
+		$(TOOL_MSLINK510_LD) $(flags) '@$(subst /,\,$(outbase).rsp)'
+endef
+
+
+TOOL_MSLINK510_LINK_SYSMOD_OUTPUT = $(outbase).map $(outbase).rsp
+TOOL_MSLINK510_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
+TOOL_MSLINK510_LINK_SYSMOD_DEPORD =
+define TOOL_MSLINK510_LINK_SYSMOD_CMDS
+	$(QUIET)$(APPEND) -n $(outbase).rsp '$(subst $(SP),+' ',$(strip $(subst /,\,$(objs)))),'
+	$(QUIET)$(APPEND) $(outbase).rsp '$(subst /,\,$(out)),'
+	$(QUIET)$(APPEND) $(outbase).rsp '$(subst /,\,$(outbase)).map,'
+	$(QUIET)$(APPEND) -n $(outbase).rsp '$(subst $(SP),+' ',$(strip $(subst /,\,$(libs))))$(if $(filter %.def,$(othersrc)),$(COMMA),;)'
+	$(if $(filter %.def,$(othersrc)),$(QUIET)$(APPEND) $(outbase).rsp '$(subst /,\,$(filter %.def,$(othersrc)));',)
+	$(QUIET)$(call TOOL_MSLINK510_ENV_SETUP,$(subst $(SP),;,$(libpath))) \
+		$(TOOL_MSLINK510_LD) $(flags) '@$(subst /,\,$(outbase).rsp)'
+endef
+
Index: trunk/kBuild/tools/VAC308.kmk
===================================================================
--- trunk/kBuild/tools/VAC308.kmk	(revision 2064)
+++ trunk/kBuild/tools/VAC308.kmk	(revision 2065)
@@ -33,6 +33,4 @@
 
 TOOL_VAC308 := VisualAge for C++ v3.08
-
-TOOL_VAC308_ENV_SETUP ?=
 
 # Determin VAC308 location.
@@ -57,6 +55,6 @@
 endif
 ifneq ($(PATH_TOOL_VAC308),)
- TOOL_VAC308_PATHLESS := yes
- 
+ TOOL_VAC308_PATHLESS :=
+
  PATH_TOOL_VAC308_BIN    ?= $(PATH_TOOL_VAC308)/bin
  PATH_TOOL_VAC308_LIB    ?= $(PATH_TOOL_VAC308)/lib
@@ -65,6 +63,6 @@
  PATH_TOOL_VAC308_HELP   ?= $(PATH_TOOL_VAC308)/help
  PATH_TOOL_VAC308_LOCALE ?= $(PATH_TOOL_VAC308)/locale
- 
- TOOL_VAC308_REDIRECT ?= $(REDIRECT) \
+
+ TOOL_VAC308_ENV_SETUP ?= $(REDIRECT) \
 	-E 'BEGINLIBPATH=$(PATH_TOOL_VAC308_DLL);$(BEGINLIBPATH)' \
 	-E 'DPATH=$(PATH_TOOL_VAC308_LOCALE);$(PATH_TOOL_VAC308_HELP);$(DPATH)' \
@@ -72,13 +70,17 @@
 	-E 'INCLUDE=' \
 	--
- TOOL_VAC308_CC  ?= $(TOOL_VAC308_REDIRECT) $(PATH_TOOL_VAC308_BIN)/icc$(HOSTSUFF_EXE)
- TOOL_VAC308_CXX ?= $(TOOL_VAC308_REDIRECT) $(PATH_TOOL_VAC308_BIN)/icc$(HOSTSUFF_EXE)
- TOOL_VAC308_AR  ?= $(TOOL_VAC308_REDIRECT) $(PATH_TOOL_VAC308_BIN)/ilib$(HOSTSUFF_EXE)
- TOOL_VAC308_LD  ?= $(TOOL_VAC308_REDIRECT) $(PATH_TOOL_VAC308_BIN)/icc$(HOSTSUFF_EXE)
- TOOL_VAC308_RC  ?= $(TOOL_VAC308_REDIRECT) $(PATH_TOOL_VAC308_BIN)/rc$(HOSTSUFF_EXE)
+ TOOL_VAC308_CC  ?= $(PATH_TOOL_VAC308_BIN)/icc$(HOSTSUFF_EXE)
+ TOOL_VAC308_CXX ?= $(PATH_TOOL_VAC308_BIN)/icc$(HOSTSUFF_EXE)
+ TOOL_VAC308_AR  ?= $(PATH_TOOL_VAC308_BIN)/ilib$(HOSTSUFF_EXE)
+ TOOL_VAC308_LD  ?= $(PATH_TOOL_VAC308_BIN)/icc$(HOSTSUFF_EXE)
+ TOOL_VAC308_RC  ?= $(PATH_TOOL_VAC308_BIN)/rc$(HOSTSUFF_EXE)
 
 else
  # Pathless, relies on the environment.
- TOOL_VAC308_PATHLESS :=
+ TOOL_VAC308_PATHLESS := yes
+ TOOL_VAC308_ENV_SETUP ?= $(REDIRECT) \
+	-E 'LIB=' \
+	-E 'INCLUDE=' \
+	--
  TOOL_VAC308_CC  ?= icc$(HOSTSUFF_EXE)
  TOOL_VAC308_CXX ?= icc$(HOSTSUFF_EXE)
@@ -122,26 +124,13 @@
 
 
-## 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    $(deps)		Other dependencies.
-#
-# @param    $(outbase)  Output basename (full). Use this for list files and such.
-# @param    $(objsuff)  Object suffix.
 TOOL_VAC308_COMPILE_C_DEPEND =
 TOOL_VAC308_COMPILE_C_DEPORD =
 TOOL_VAC308_COMPILE_C_OUTPUT =
 define TOOL_VAC308_COMPILE_C_CMDS
-	$(QUIET) $(TOOL_VAC308_ENV_SETUP) $(TOOL_VAC308_CC) -c\
+	$(QUIET) $(call TOOL_VAC308_ENV_SETUP) $(TOOL_VAC308_CC) -c\
 		$(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
 		-Fo$(obj)\
 		$(abspath $(source))
-	$(QUIET) $(TOOL_VAC308_ENV_SETUP) $(TOOL_VAC308_CC) -P+ -Pd+ \
+	$(QUIET) $(call TOOL_VAC308_ENV_SETUP) $(TOOL_VAC308_CC) -P+ -Pd+ \
 		$(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
 		$(abspath $(source)) \
@@ -149,27 +138,13 @@
 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    $(deps)		Other dependencies.
-#
-# @param    $(outbase)  Output basename (full). Use this for list files and such.
-# @param    $(objsuff)  Object suffix.
 TOOL_VAC308_COMPILE_CXX_DEPEND =
 TOOL_VAC308_COMPILE_CXX_DEPORD =
 TOOL_VAC308_COMPILE_CXX_OUTPUT =
 define TOOL_VAC308_COMPILE_CXX_CMDS
-	$(QUIET) $(TOOL_VAC308_ENV_SETUP) $(TOOL_VAC308_CXX) -c\
+	$(QUIET) $(call TOOL_VAC308_ENV_SETUP) $(TOOL_VAC308_CXX) -c\
 		$(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
 		-Fo$(obj)\
 		$(abspath $(source))
-	$(QUIET) $(TOOL_VAC308_ENV_SETUP) $(TOOL_VAC308_CXX) -P+ -Pd+ \
+	$(QUIET) $(call TOOL_VAC308_ENV_SETUP) $(TOOL_VAC308_CXX) -P+ -Pd+ \
 		$(flags) $(addprefix -I, $(incs)) $(addprefix -D, $(defs))\
 		$(abspath $(source)) \
@@ -177,23 +152,9 @@
 endef
 
-
-## Compile resource 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    $(deps)     Other dependencies.
-#
-# @param    $(outbase)  Output basename (full). Use this for list files and such.
-# @param    $(objsuff)  Object suffix.
 TOOL_VAC308_COMPILE_RC_OUTPUT =
 TOOL_VAC308_COMPILE_RC_DEPEND =
 TOOL_VAC308_COMPILE_RC_DEPORD =
 define TOOL_VAC308_COMPILE_RC_CMDS
-	$(QUIET) $(TOOL_VAC308_ENV_SETUP) $(TOOL_VAC308_RC) -r\
+	$(QUIET) $(call TOOL_VAC308_ENV_SETUP) $(TOOL_VAC308_RC) -r\
 		$(flags) $(addprefix -i, $(subst /,\\,$(incs))) $(addprefix -D, $(defs))\
 		$(subst /,\\,$(abspath $(source))) \
@@ -201,102 +162,42 @@
 endef
 
-
-## Link library
-# @param    $(target)   Normalized main target name.
-# @param    $(out)		Library name.
-# @param    $(objs)     Object files to put in the library.
-# @param    $(flags)    Flags.
-# @param    $(dirdep)   Directory creation dependency.
-# @param    $(deps)		Other dependencies.
-# @param    $(othersrc) Unhandled sources.
-#
-# @param    $(outbase)  Output basename (full). Use this for list files and such.
-TOOL_VAC308_LINK_LIBRARY_OUTPUT = ## @todo $(outbase).rsp 
+TOOL_VAC308_LINK_LIBRARY_OUTPUT = ## @todo $(outbase).rsp
 TOOL_VAC308_LINK_LIBRARY_DEPEND = $(othersrc)
 TOOL_VAC308_LINK_LIBRARY_DEPORD =
 define TOOL_VAC308_LINK_LIBRARY_CMDS
 	$(if $(strip $(othersrc)),\
-		$(QUIET)$(TOOL_VAC308_ENV_SETUP) \
+		$(QUIET)$(call TOOL_VAC308_ENV_SETUP) \
 		$(TOOL_VAC308_IMP) $(TOOL_VAC308_IMPFLAGS) $(subst /,\\,$(out)) $(subst /,\\,$(othersrc)) )
-	$(if $(strip $(objs)),$(QUIET)$(TOOL_VAC308_ENV_SETUP) \
-		$(QUIET)$(TOOL_VAC308_ENV_SETUP) \
+	$(if $(strip $(objs)),$(QUIET)$(call TOOL_VAC308_ENV_SETUP) \
 		$(TOOL_VAC308_AR) $(flags) $(subst /,\\,$(out)) $(foreach obj,$(subst /,\\,$(objs)),+"$(obj)") ";" )
 endef
 
-
-## Link program
-# @param    $(target)   Normalized main target name.
-# @param    $(out)		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    $(othersrc) Unhandled sources.
-# @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.
 TOOL_VAC308_LINK_PROGRAM_OUTPUT = $(outbase).map
 TOOL_VAC308_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
 TOOL_VAC308_LINK_PROGRAM_DEPORD =
 define TOOL_VAC308_LINK_PROGRAM_CMDS
-	$(QUIET)$(TOOL_VAC308_ENV_SETUP) \
-	$(if $(strip $(libpath)),LIB="$(subst ; ,;,$(foreach lp,$(libpath),$(lp);))$(LIB)") \
+	$(QUIET)$(call TOOL_VAC308_ENV_SETUP,$(subst $(SP),;,$(libpath))) \
 		$(TOOL_VAC308_LD) $(flags) -Fe$(out) -Fm$(outbase).map $(filter-out %.res,$(objs)) $(libs) $(othersrc)
-	$(if $(filter %.res,$(objs)), $(QUIET)$(TOOL_VAC308_ENV_SETUP) \
+	$(if $(filter %.res,$(objs)), $(QUIET)$(call TOOL_VAC308_ENV_SETUP) \
 		$(TOOL_VAC308_RC) $(filter %.res,$(objs)) $(out))
 endef
 
-
-## Link DLL
-# @param    $(target)   Normalized main target name.
-# @param    $(out)		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    $(othersrc) Unhandled sources.
-# @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.
 TOOL_VAC308_LINK_DLL_OUTPUT = $(outbase).map
 TOOL_VAC308_LINK_DLL_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
 TOOL_VAC308_LINK_DLL_DEPORD =
 define TOOL_VAC308_LINK_DLL_CMDS
-	$(QUIET)$(TOOL_VAC308_ENV_SETUP) \
-	$(if $(strip $(libpath)),LIB="$(subst ; ,;,$(foreach lp,$(libpath),$(lp);))$(LIB)") \
+	$(QUIET)$(call TOOL_VAC308_ENV_SETUP,$(subst $(SP),;,$(libpath))) \
 		$(TOOL_VAC308_LD) /B"/DLL" $(flags) -Fe$(out) -Fm$(outbase).map $(filter-out %.res,$(objs)) $(libs) $(othersrc)
-	$(if $(filter %.res,$(objs)), $(QUIET)$(TOOL_VAC308_ENV_SETUP) \
+	$(if $(filter %.res,$(objs)), $(QUIET)$(call TOOL_VAC308_ENV_SETUP) \
 		$(TOOL_VAC308_RC) $(filter %.res,$(objs)) $(out))
 endef
 
-
-## Link system module (windows aka driver, linux aka kernel module)
-# @param    $(target)   Normalized main target name.
-# @param    $(out)		System module 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    $(othersrc) Unhandled sources.
-# @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.
 TOOL_VAC308_LINK_SYSMOD_OUTPUT = $(outbase).map
 TOOL_VAC308_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
 TOOL_VAC308_LINK_SYSMOD_DEPORD =
 define TOOL_VAC308_LINK_SYSMOD_CMDS
-	$(QUIET)$(TOOL_VAC308_ENV_SETUP) \
-	$(if $(strip $(libpath)),LIB="$(subst ; ,;,$(foreach lp,$(libpath),$(lp);))$(LIB)") \
-		$(TOOL_VAC308_LD) $(flags) -Fe$(out)  -Fm$(outbase).map $(filter-out %.res,$(objs)) $(libs) $(othersrc)
-	$(if $(filter %.res,$(objs)), $(QUIET)$(TOOL_VAC308_ENV_SETUP) \
+	$(QUIET)$(call TOOL_VAC308_ENV_SETUP,$(subst $(SP),;,$(libpath))) \
+		$(TOOL_VAC308_LD) $(flags) -Fe$(out) -Fm$(outbase).map $(filter-out %.res,$(objs)) $(libs) $(othersrc)
+	$(if $(filter %.res,$(objs)), $(QUIET)$(call TOOL_VAC308_ENV_SETUP) \
 		$(TOOL_VAC308_RC) $(filter %.res,$(objs)) $(out))
 endef
Index: trunk/kBuild/tools/WATCOMC11C-16.kmk
===================================================================
--- trunk/kBuild/tools/WATCOMC11C-16.kmk	(revision 2065)
+++ trunk/kBuild/tools/WATCOMC11C-16.kmk	(revision 2065)
@@ -0,0 +1,149 @@
+# $Id$
+## @file
+# kBuild Tool Config - Watcom C v11.0c, 16-bit targets.
+#
+# @remarks wrc is untested, so are DLLs, and programs.
+
+#
+# Copyright (c) 2008 knut st. osmundsen <bird-kBuild-spam@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
+#
+#
+# As a special exception you are granted permission to include this file, via
+# the kmk include directive, as you wish without this in itself causing the
+# resulting makefile, program or whatever to be covered by the GPL license.
+# This exception does not however invalidate any other reasons why the makefile,
+# program, whatever should not be covered the GPL.
+#
+#
+
+TOOL_WATCOMC11C-16 = Watcom C/C++ v11.0c - 16-bit targets.
+TOOL_WATCOMC11C-16_EXTENDS = WATCOMC11C
+						
+TOOL_WATCOMC11C-16_COMPILE_C_DEPEND =
+TOOL_WATCOMC11C-16_COMPILE_C_DEPORD =
+TOOL_WATCOMC11C-16_COMPILE_C_OUTPUT = $(obj).err
+define TOOL_WATCOMC11C-16_COMPILE_C_CMDS
+	$(QUIET) $(call TOOL_WATCOMC11C_ENV_SETUP) $(TOOL_WATCOMC11C_CC16) \
+		$(flags) \
+		$(addsuffix , $(addprefix -i=, $(subst /,\\,$(incs)))) \
+		$(addprefix -d, $(defs)) \
+		-fo=$(subst /,\\,$(obj)) \
+		-fr=$(subst /,\\,$(obj)).err \
+		$(subst /,\\,$(abspath $(source)))
+	$(QUIET)$(APPEND) -n $(obj).err
+## @todo dependencies	
+endef
+
+TOOL_WATCOMC11C-16_COMPILE_CXX_DEPEND =
+TOOL_WATCOMC11C-16_COMPILE_CXX_DEPORD =
+TOOL_WATCOMC11C-16_COMPILE_CXX_OUTPUT = $(obj).err
+define TOOL_WATCOMC11C-16_COMPILE_CXX_CMDS
+	$(QUIET) $(call TOOL_WATCOMC11C_ENV_SETUP) $(TOOL_WATCOMC11C_CXX16) \
+		$(flags) \
+		$(addsuffix , $(addprefix -i=, $(subst /,\\,$(incs)))) \
+		$(addprefix -d, $(defs)) \
+		-fo=$(subst /,\\,$(obj)) \
+		-fr=$(subst /,\\,$(obj)).err \
+		$(subst /,\\,$(abspath $(source)))
+	$(QUIET)$(APPEND) -n $(obj).err
+## @todo dependencies	
+endef
+
+TOOL_WATCOMC11C-16_COMPILE_RC_OUTPUT =
+TOOL_WATCOMC11C-16_COMPILE_RC_DEPEND =
+TOOL_WATCOMC11C-16_COMPILE_RC_DEPORD =
+define TOOL_WATCOMC11C-16_COMPILE_RC_CMDS
+	$(QUIET) $(call TOOL_WATCOMC11C_ENV_SETUP) \
+		$(TOOL_WATCOMC11C_RC) -r\
+		$(flags) \
+		$(addprefix -i=, $(subst /,\\,$(incs))) \
+		$(addprefix -d, $(defs))\
+		-fo=$(subst /,\\,obj) \
+		$(subst /,\\,$(abspath $(source)))
+endef
+
+TOOL_WATCOMC11C-16_LINK_LIBRARY_OUTPUT = ## @todo $(outbase).rsp
+TOOL_WATCOMC11C-16_LINK_LIBRARY_DEPEND = $(othersrc)
+TOOL_WATCOMC11C-16_LINK_LIBRARY_DEPORD =
+define TOOL_WATCOMC11C-16_LINK_LIBRARY_CMDS
+	$(if $(strip $(othersrc)),\
+		$(QUIET)$(TOOL_WATCOMC11C_ENV_SETUP) \
+		$(TOOL_WATCOMC11C_IMP) $(TOOL_WATCOMC11C_IMPFLAGS) $(subst /,\\,$(out)) $(subst /,\\,$(othersrc)) )
+	$(if $(strip $(objs)),$(QUIET)$(TOOL_WATCOMC11C_ENV_SETUP) \
+		$(QUIET)$(TOOL_WATCOMC11C_ENV_SETUP) \
+		$(TOOL_WATCOMC11C_AR) $(flags) $(subst /,\\,$(out)) $(foreach obj,$(subst /,\\,$(objs)),+"$(obj)") ";" )
+endef
+
+TOOL_WATCOMC11C-16_LINK_PROGRAM_OUTPUT = $(outbase).map
+TOOL_WATCOMC11C-16_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
+TOOL_WATCOMC11C-16_LINK_PROGRAM_DEPORD =
+define TOOL_WATCOMC11C-16_LINK_PROGRAM_CMDS
+	$(QUIET)$(call TOOL_WATCOMC11C_ENV_SETUP,$(subst $(SP),,$(addsuffix ;,$(libpath)))) \
+		$(TOOL_WATCOMC11C_LD16) \
+		$(flags) \
+		-fe=$(subst /,\\,$(out)) \
+		-fm=$(subst /,\\,$(outbase).map) \
+		$(subst /,\\,$(filter-out %.res,$(objs))) \
+		$(subst /,\\,$(libs)) \
+		$(subst /,\\,$(othersrc))
+	$(if $(filter %.res,$(objs)), $(QUIET)$(call TOOL_WATCOMC11C_ENV_SETUP) \
+		$(TOOL_WATCOMC11C_RC) \
+			$(filter -bt=%,$(flags)) \
+			/fe=$(subst /,\\,$(out)) \
+			$(subst /,\\,$(filter %.res,$(objs))))
+endef
+
+TOOL_WATCOMC11C-16_LINK_DLL_OUTPUT = $(outbase).map
+TOOL_WATCOMC11C-16_LINK_DLL_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
+TOOL_WATCOMC11C-16_LINK_DLL_DEPORD =
+define TOOL_WATCOMC11C-16_LINK_DLL_CMDS
+	$(QUIET)$(call TOOL_WATCOMC11C_ENV_SETUP,$(subst $(SP),,$(addsuffix ;,$(libpath)))) \
+		$(TOOL_WATCOMC11C_LD16) \
+		$(flags) \
+		-fe=$(subst /,\\,$(out)) \
+		-fm=$(subst /,\\,$(outbase).map) \
+		$(subst /,\\,$(filter-out %.res,$(objs))) \
+		$(subst /,\\,$(libs)) \
+		$(subst /,\\,$(othersrc))
+	$(if $(filter %.res,$(objs)), $(QUIET)$(call TOOL_WATCOMC11C_ENV_SETUP) \
+		$(TOOL_WATCOMC11C_RC) \
+			$(filter -bt=%,$(flags)) \
+			/fe=$(subst /,\\,$(out)) \
+			$(subst /,\\,$(filter %.res,$(objs))))
+endef
+
+TOOL_WATCOMC11C-16_LINK_SYSMOD_OUTPUT = $(outbase).map
+TOOL_WATCOMC11C-16_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
+TOOL_WATCOMC11C-16_LINK_SYSMOD_DEPORD =
+define TOOL_WATCOMC11C-16_LINK_SYSMOD_CMDS
+	$(QUIET)$(call TOOL_WATCOMC11C_ENV_SETUP,$(subst $(SP),,$(addsuffix ;,$(libpath)))) \
+		$(TOOL_WATCOMC11C_LD16) \
+		$(flags) \
+		-fe=$(subst /,\\,$(out)) \
+		-fm=$(subst /,\\,$(outbase).map) \
+		$(subst /,\\,$(filter-out %.res,$(objs))) \
+		$(subst /,\\,$(libs)) \
+		$(subst /,\\,$(othersrc))
+	$(if $(filter %.res,$(objs)), $(QUIET)$(call TOOL_WATCOMC11C_ENV_SETUP) \
+		$(TOOL_WATCOMC11C_RC) \
+			$(filter -bt=%,$(flags)) \
+			/fe=$(subst /,\\,$(out)) \
+			$(subst /,\\,$(filter %.res,$(objs))))
+endef
+
Index: trunk/kBuild/tools/WATCOMC11C.kmk
===================================================================
--- trunk/kBuild/tools/WATCOMC11C.kmk	(revision 2065)
+++ trunk/kBuild/tools/WATCOMC11C.kmk	(revision 2065)
@@ -0,0 +1,250 @@
+# $Id$
+## @file
+# kBuild Tool Config - Watcom C v11.0c
+#
+
+#
+# Copyright (c) 2008 knut st. osmundsen <bird-kBuild-spam@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
+#
+#
+# As a special exception you are granted permission to include this file, via
+# the kmk include directive, as you wish without this in itself causing the
+# resulting makefile, program or whatever to be covered by the GPL license.
+# This exception does not however invalidate any other reasons why the makefile,
+# program, whatever should not be covered the GPL.
+#
+#
+
+TOOL_WATCOMC11C = Watcom C/C++ v11.0c (generic)
+
+ifeq ($(PATH_TOOL_WATCOMC11C),)
+ ifeq ($(PATH_TOOL_WATCOMC11C),)
+  PATH_TOOL_WATCOMC11C := $(wildcard $(PATH_DEVTOOLS_BLD)/watcom/v11.0c*)
+ endif
+ ifeq ($(PATH_TOOL_WATCOMC11C),)
+  PATH_TOOL_WATCOMC11C := $(wildcard $(PATH_DEVTOOLS_TRG)/watcom/v11.0c*)
+ endif
+ if1of ($(USER) $(USERNAME) $(LOGNAME), bird)
+  PATH_TOOL_WATCOMC11C := $(wildcard d:/dev/Watcom/v11.0c*)
+ endif
+ PATH_TOOL_WATCOMC11C := $(firstword $(sort $(PATH_TOOL_WATCOMC11C)))
+ # if not found, we'll enter 'pathless' mode.
+else
+ # Resolve any fancy stuff once and for all.
+ PATH_TOOL_WATCOMC11C := $(PATH_TOOL_WATCOMC11C)
+endif
+
+ifneq ($(PATH_TOOL_WATCOMC11C),)
+ TOOL_WATCOMC11C_PATHLESS := no
+
+ ifeq ($(KBUILD_HOST),os2)
+  PATH_TOOL_WATCOMC11C_BIN   = $(PATH_TOOL_WATCOMC11C)/binp
+  PATH_TOOL_WATCOMC11C_BIN2  = $(PATH_TOOL_WATCOMC11C)/binw
+  TOOL_WATCOMC11C_ENV_SETUP ?= $(REDIRECT) \
+ 	-E 'BEGINLIBPATH=$(PATH_TOOL_WATCOMC11C)/binp/dll;$(BEGINLIBPATH)' \
+ 	-E 'PATH=$(PATH_TOOL_WATCOMC11C_BIN);$(PATH_TOOL_WATCOMC11C_BIN2)' \
+ 	-E 'WATCOM=$(PATH_TOOL_WATCOMC11C)' \
+ 	-E 'LIB=$1' \
+ 	-E 'INCLUDE=' \
+ 	--
+ else
+  PATH_TOOL_WATCOMC11C_BIN   = $(PATH_TOOL_WATCOMC11C)/binnt
+  PATH_TOOL_WATCOMC11C_BIN2  = $(PATH_TOOL_WATCOMC11C_BIN)
+  TOOL_WATCOMC11C_ENV_SETUP ?= $(REDIRECT) \
+ 	-E 'PATH=$(PATH_TOOL_WATCOMC11C_BIN)' \
+ 	-E 'WATCOM=$(PATH_TOOL_WATCOMC11C)' \
+ 	-E 'LIB=$1' \
+ 	-E 'INCLUDE=' \
+ 	--
+ endif
+
+ TOOL_WATCOMC11C_CC    ?= $(PATH_TOOL_WATCOMC11C_BIN)/wcc386$(HOSTSUFF_EXE)
+ TOOL_WATCOMC11C_CC16  ?= $(PATH_TOOL_WATCOMC11C_BIN)/wcc$(HOSTSUFF_EXE)
+ TOOL_WATCOMC11C_CXX   ?= $(PATH_TOOL_WATCOMC11C_BIN)/wpp386$(HOSTSUFF_EXE)
+ TOOL_WATCOMC11C_CXX16 ?= $(PATH_TOOL_WATCOMC11C_BIN)/wpp$(HOSTSUFF_EXE)
+ TOOL_WATCOMC11C_AS    ?= $(PATH_TOOL_WATCOMC11C_BIN)/wasm$(HOSTSUFF_EXE) TOOL_WATCOMC11C_AR    ?= $(PATH_TOOL_WATCOMC11C_BIN)/wlib$(HOSTSUFF_EXE)
+ TOOL_WATCOMC11C_LD    ?= $(PATH_TOOL_WATCOMC11C_BIN2)/wcl386$(HOSTSUFF_EXE)
+ TOOL_WATCOMC11C_LD16  ?= $(PATH_TOOL_WATCOMC11C_BIN2)/wcl$(HOSTSUFF_EXE)
+ TOOL_WATCOMC11C_RC    ?= $(PATH_TOOL_WATCOMC11C_BIN2)/wrc$(HOSTSUFF_EXE)
+
+else
+ # Pathless, relies on the environment.
+ TOOL_WATCOMC11C_PATHLESS :=
+ TOOL_WATCOMC11C_ENV_SETUP ?= $(REDIRECT) \
+ 	-E 'LIB=$1' \
+ 	-E 'INCLUDE=' \
+ 	--
+ TOOL_WATCOMC11C_CC    ?= wcc386$(HOSTSUFF_EXE)
+ TOOL_WATCOMC11C_CC16  ?= wcc$(HOSTSUFF_EXE)
+ TOOL_WATCOMC11C_CXX   ?= wpp386$(HOSTSUFF_EXE)
+ TOOL_WATCOMC11C_CXX16 ?= wpp$(HOSTSUFF_EXE)
+ TOOL_WATCOMC11C_AS    ?= wasm$(HOSTSUFF_EXE)
+ TOOL_WATCOMC11C_AR    ?= wlib$(HOSTSUFF_EXE)
+ TOOL_WATCOMC11C_LD    ?= wcl386$(HOSTSUFF_EXE)
+ TOOL_WATCOMC11C_LD16  ?= wcl$(HOSTSUFF_EXE)
+ TOOL_WATCOMC11C_RC    ?= wrc$(HOSTSUFF_EXE)
+											
+endif
+							
+# General Properties used by kBuild
+TOOL_WATCOMC11C_COBJSUFF         ?= .obj
+TOOL_WATCOMC11C_CFLAGS           ?= -zq
+TOOL_WATCOMC11C_CFLAGS.os2       ?= -bt=os2
+TOOL_WATCOMC11C_CFLAGS.win       ?= -bt=nt
+TOOL_WATCOMC11C_CFLAGS.debug     ?=
+TOOL_WATCOMC11C_CFLAGS.release   ?=
+TOOL_WATCOMC11C_CINCS            ?= $(PATH_TOOL_WATCOMC11C)/h
+TOOL_WATCOMC11C_CDEFS            ?=
+
+TOOL_WATCOMC11C_CXXOBJSUFF       ?= .obj
+TOOL_WATCOMC11C_CXXFLAGS         ?= -zq
+TOOL_WATCOMC11C_CXXFLAGS.os2     ?= -bt=os2
+TOOL_WATCOMC11C_CXXFLAGS.win     ?= -bt=nt
+TOOL_WATCOMC11C_CXXFLAGS.debug   ?=
+TOOL_WATCOMC11C_CXXFLAGS.release ?=
+TOOL_WATCOMC11C_CXXINCS          ?= $(PATH_TOOL_WATCOMC11C)/h
+TOOL_WATCOMC11C_CXXDEFS          ?=
+
+TOOL_WATCOMC11C_RCOBJSUFF        ?= .res
+TOOL_WATCOMC11C_RCFLAGS          ?= -r
+TOOL_WATCOMC11C_RCINCS           ?= $(PATH_TOOL_WATCOMC11C)/h
+TOOL_WATCOMC11C_RCDEFS           ?=
+
+TOOL_WATCOMC11C_ARFLAGS          ?=
+TOOL_WATCOMC11C_ARLIBSUFF        ?= .lib
+
+TOOL_WATCOMC11C_LDFLAGS          ?= -zq -y
+TOOL_WATCOMC11C_LDFLAGS.os2      ?= -bt=os2
+TOOL_WATCOMC11C_LDFLAGS.win      ?= -bt=nt
+TOOL_WATCOMC11C_LDFLAGS.debug    ?=
+
+
+TOOL_WATCOMC11C_COMPILE_C_DEPEND =
+TOOL_WATCOMC11C_COMPILE_C_DEPORD =
+TOOL_WATCOMC11C_COMPILE_C_OUTPUT = $(obj).err
+define TOOL_WATCOMC11C_COMPILE_C_CMDS
+	$(QUIET) $(call TOOL_WATCOMC11C_ENV_SETUP) $(TOOL_WATCOMC11C_CC) \
+		$(flags) \
+		$(addsuffix , $(addprefix -i=, $(subst /,\\,$(incs)))) \
+		$(addprefix -d, $(defs)) \
+		-fo=$(subst /,\\,$(obj)) \
+		-fr=$(subst /,\\,$(obj)).err \
+		$(subst /,\\,$(abspath $(source)))
+	$(QUIET)$(APPEND) -n $(obj).err
+## @todo dependencies	
+endef
+
+TOOL_WATCOMC11C_COMPILE_CXX_DEPEND =
+TOOL_WATCOMC11C_COMPILE_CXX_DEPORD =
+TOOL_WATCOMC11C_COMPILE_CXX_OUTPUT = $(obj).err
+define TOOL_WATCOMC11C_COMPILE_CXX_CMDS
+	$(QUIET) $(call TOOL_WATCOMC11C_ENV_SETUP) $(TOOL_WATCOMC11C_CXX) \
+		$(flags) \
+		$(addsuffix , $(addprefix -i=, $(subst /,\\,$(incs)))) \
+		$(addprefix -d, $(defs)) \
+		-fo=$(subst /,\\,$(obj)) \
+		-fr=$(subst /,\\,$(obj)).err \
+		$(subst /,\\,$(abspath $(source)))
+	$(QUIET)$(APPEND) -n $(obj).err
+## @todo dependencies	
+endef
+
+TOOL_WATCOMC11C_COMPILE_RC_OUTPUT =
+TOOL_WATCOMC11C_COMPILE_RC_DEPEND =
+TOOL_WATCOMC11C_COMPILE_RC_DEPORD =
+define TOOL_WATCOMC11C_COMPILE_RC_CMDS
+	$(QUIET) $(call TOOL_WATCOMC11C_ENV_SETUP) \
+		$(TOOL_WATCOMC11C_RC) -r\
+		$(flags) \
+		$(addprefix -i=, $(subst /,\\,$(incs))) \
+		$(addprefix -d, $(defs))\
+		-fo=$(subst /,\\,obj) \
+		$(subst /,\\,$(abspath $(source)))
+endef
+
+TOOL_WATCOMC11C_LINK_LIBRARY_OUTPUT = ## @todo $(outbase).rsp
+TOOL_WATCOMC11C_LINK_LIBRARY_DEPEND = $(othersrc)
+TOOL_WATCOMC11C_LINK_LIBRARY_DEPORD =
+define TOOL_WATCOMC11C_LINK_LIBRARY_CMDS
+	$(if $(strip $(othersrc)),\
+		$(QUIET)$(TOOL_WATCOMC11C_ENV_SETUP) \
+		$(TOOL_WATCOMC11C_IMP) $(TOOL_WATCOMC11C_IMPFLAGS) $(subst /,\\,$(out)) $(subst /,\\,$(othersrc)) )
+	$(if $(strip $(objs)),$(QUIET)$(TOOL_WATCOMC11C_ENV_SETUP) \
+		$(QUIET)$(TOOL_WATCOMC11C_ENV_SETUP) \
+		$(TOOL_WATCOMC11C_AR) $(flags) $(subst /,\\,$(out)) $(foreach obj,$(subst /,\\,$(objs)),+"$(obj)") ";" )
+endef
+
+TOOL_WATCOMC11C_LINK_PROGRAM_OUTPUT = $(outbase).map
+TOOL_WATCOMC11C_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
+TOOL_WATCOMC11C_LINK_PROGRAM_DEPORD =
+define TOOL_WATCOMC11C_LINK_PROGRAM_CMDS
+	$(QUIET)$(call TOOL_WATCOMC11C_ENV_SETUP,$(subst $(SP),,$(addsuffix ;,$(libpath)))) \
+		$(TOOL_WATCOMC11C_LD) \
+		$(flags) \
+		-fe=$(subst /,\\,$(out)) \
+		-fm=$(subst /,\\,$(outbase).map) \
+		$(subst /,\\,$(filter-out %.res,$(objs))) \
+		$(subst /,\\,$(libs)) \
+		$(subst /,\\,$(othersrc))
+	$(if $(filter %.res,$(objs)), $(QUIET)$(call TOOL_WATCOMC11C_ENV_SETUP) \
+		$(TOOL_WATCOMC11C_RC) \
+			$(filter -bt=%,$(flags)) \
+			/fe=$(subst /,\\,$(out)) \
+			$(subst /,\\,$(filter %.res,$(objs))))
+endef
+
+TOOL_WATCOMC11C_LINK_DLL_OUTPUT = $(outbase).map
+TOOL_WATCOMC11C_LINK_DLL_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
+TOOL_WATCOMC11C_LINK_DLL_DEPORD =
+define TOOL_WATCOMC11C_LINK_DLL_CMDS
+	$(QUIET)$(call TOOL_WATCOMC11C_ENV_SETUP,$(subst $(SP),,$(addsuffix ;,$(libpath)))) \
+		$(TOOL_WATCOMC11C_LD) \
+		$(flags) \
+		-fe=$(subst /,\\,$(out)) \
+		-fm=$(subst /,\\,$(outbase).map) \
+		$(subst /,\\,$(filter-out %.res,$(objs))) \
+		$(subst /,\\,$(libs)) \
+		$(subst /,\\,$(othersrc))
+	$(if $(filter %.res,$(objs)), $(QUIET)$(call TOOL_WATCOMC11C_ENV_SETUP) \
+		$(TOOL_WATCOMC11C_RC) \
+			$(filter -bt=%,$(flags)) \
+			/fe=$(subst /,\\,$(out)) \
+			$(subst /,\\,$(filter %.res,$(objs))))
+endef
+
+TOOL_WATCOMC11C_LINK_SYSMOD_OUTPUT = $(outbase).map
+TOOL_WATCOMC11C_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
+TOOL_WATCOMC11C_LINK_SYSMOD_DEPORD =
+define TOOL_WATCOMC11C_LINK_SYSMOD_CMDS
+	$(QUIET)$(call TOOL_WATCOMC11C_ENV_SETUP,$(subst $(SP),,$(addsuffix ;,$(libpath)))) \
+		$(TOOL_WATCOMC11C_LD) \
+		$(flags) \
+		-fe=$(subst /,\\,$(out)) \
+		-fm=$(subst /,\\,$(outbase).map) \
+		$(subst /,\\,$(filter-out %.res,$(objs))) \
+		$(subst /,\\,$(libs)) \
+		$(subst /,\\,$(othersrc))
+	$(if $(filter %.res,$(objs)), $(QUIET)$(call TOOL_WATCOMC11C_ENV_SETUP) \
+		$(TOOL_WATCOMC11C_RC) \
+			$(filter -bt=%,$(flags)) \
+			/fe=$(subst /,\\,$(out)) \
+			$(subst /,\\,$(filter %.res,$(objs))))
+endef
+
+
