Index: trunk/kBuild/tools/OPENWATCOM-16.kmk
===================================================================
--- trunk/kBuild/tools/OPENWATCOM-16.kmk	(revision 2068)
+++ trunk/kBuild/tools/OPENWATCOM-16.kmk	(revision 2068)
@@ -0,0 +1,155 @@
+# $Id$
+## @file
+# kBuild Tool Config - Open Watcom v1.4 and later, 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_OPENWATCOM-16 = Open Watcom v1.4 and later - 16-bit targets.
+TOOL_OPENWATCOM-16_EXTENDS = OPENWATCOM
+TOOL_OPENWATCOM-16_ASFLAGS.win  ?= -bt=windows
+TOOL_OPENWATCOM-16_CFLAGS.win   ?= -bt=windows
+TOOL_OPENWATCOM-16_CXXFLAGS.win ?= -bt=windows
+TOOL_OPENWATCOM-16_RCFLAGS.win  ?= -bt=windows
+TOOL_OPENWATCOM-16_LDFLAGS.win  ?= -bt=windows
+
+							
+TOOL_OPENWATCOM-16_COMPILE_C_DEPEND =
+TOOL_OPENWATCOM-16_COMPILE_C_DEPORD =
+TOOL_OPENWATCOM-16_COMPILE_C_OUTPUT = $(obj).err
+define TOOL_OPENWATCOM-16_COMPILE_C_CMDS
+	$(QUIET) $(call TOOL_OPENWATCOM_ENV_SETUP) $(TOOL_OPENWATCOM_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_OPENWATCOM-16_COMPILE_CXX_DEPEND =
+TOOL_OPENWATCOM-16_COMPILE_CXX_DEPORD =
+TOOL_OPENWATCOM-16_COMPILE_CXX_OUTPUT = $(obj).err
+define TOOL_OPENWATCOM-16_COMPILE_CXX_CMDS
+	$(QUIET) $(call TOOL_OPENWATCOM_ENV_SETUP) $(TOOL_OPENWATCOM_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_OPENWATCOM-16_COMPILE_RC_OUTPUT =
+TOOL_OPENWATCOM-16_COMPILE_RC_DEPEND =
+TOOL_OPENWATCOM-16_COMPILE_RC_DEPORD =
+define TOOL_OPENWATCOM-16_COMPILE_RC_CMDS
+	$(QUIET) $(call TOOL_OPENWATCOM_ENV_SETUP) \
+		$(TOOL_OPENWATCOM_RC) -r\
+		$(flags) \
+		$(addprefix -i=, $(subst /,\\,$(incs))) \
+		$(addprefix -d, $(defs))\
+		-fo=$(subst /,\\,obj) \
+		$(subst /,\\,$(abspath $(source)))
+endef
+
+TOOL_OPENWATCOM-16_LINK_LIBRARY_OUTPUT = ## @todo $(outbase).rsp
+TOOL_OPENWATCOM-16_LINK_LIBRARY_DEPEND = $(othersrc)
+TOOL_OPENWATCOM-16_LINK_LIBRARY_DEPORD =
+define TOOL_OPENWATCOM-16_LINK_LIBRARY_CMDS
+	$(if $(strip $(othersrc)),\
+		$(QUIET)$(TOOL_OPENWATCOM_ENV_SETUP) \
+		$(TOOL_OPENWATCOM_IMP) $(TOOL_OPENWATCOM_IMPFLAGS) $(subst /,\\,$(out)) $(subst /,\\,$(othersrc)) )
+	$(if $(strip $(objs)),$(QUIET)$(TOOL_OPENWATCOM_ENV_SETUP) \
+		$(QUIET)$(TOOL_OPENWATCOM_ENV_SETUP) \
+		$(TOOL_OPENWATCOM_AR) $(flags) $(subst /,\\,$(out)) $(foreach obj,$(subst /,\\,$(objs)),+"$(obj)") ";" )
+endef
+
+TOOL_OPENWATCOM-16_LINK_PROGRAM_OUTPUT = $(outbase).map
+TOOL_OPENWATCOM-16_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
+TOOL_OPENWATCOM-16_LINK_PROGRAM_DEPORD =
+define TOOL_OPENWATCOM-16_LINK_PROGRAM_CMDS
+	$(QUIET)$(call TOOL_OPENWATCOM_ENV_SETUP,$(subst $(SP),,$(addsuffix ;,$(libpath)))) \
+		$(TOOL_OPENWATCOM_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_OPENWATCOM_ENV_SETUP) \
+		$(TOOL_OPENWATCOM_RC) \
+			$(filter -bt=%,$(flags)) \
+			/fe=$(subst /,\\,$(out)) \
+			$(subst /,\\,$(filter %.res,$(objs))))
+endef
+
+TOOL_OPENWATCOM-16_LINK_DLL_OUTPUT = $(outbase).map
+TOOL_OPENWATCOM-16_LINK_DLL_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
+TOOL_OPENWATCOM-16_LINK_DLL_DEPORD =
+define TOOL_OPENWATCOM-16_LINK_DLL_CMDS
+	$(QUIET)$(call TOOL_OPENWATCOM_ENV_SETUP,$(subst $(SP),,$(addsuffix ;,$(libpath)))) \
+		$(TOOL_OPENWATCOM_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_OPENWATCOM_ENV_SETUP) \
+		$(TOOL_OPENWATCOM_RC) \
+			$(filter -bt=%,$(flags)) \
+			/fe=$(subst /,\\,$(out)) \
+			$(subst /,\\,$(filter %.res,$(objs))))
+endef
+
+TOOL_OPENWATCOM-16_LINK_SYSMOD_OUTPUT = $(outbase).map
+TOOL_OPENWATCOM-16_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
+TOOL_OPENWATCOM-16_LINK_SYSMOD_DEPORD =
+define TOOL_OPENWATCOM-16_LINK_SYSMOD_CMDS
+	$(QUIET)$(call TOOL_OPENWATCOM_ENV_SETUP,$(subst $(SP),,$(addsuffix ;,$(libpath)))) \
+		$(TOOL_OPENWATCOM_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_OPENWATCOM_ENV_SETUP) \
+		$(TOOL_OPENWATCOM_RC) \
+			$(filter -bt=%,$(flags)) \
+			/fe=$(subst /,\\,$(out)) \
+			$(subst /,\\,$(filter %.res,$(objs))))
+endef
+
Index: trunk/kBuild/tools/OPENWATCOM.kmk
===================================================================
--- trunk/kBuild/tools/OPENWATCOM.kmk	(revision 2068)
+++ trunk/kBuild/tools/OPENWATCOM.kmk	(revision 2068)
@@ -0,0 +1,250 @@
+# $Id$
+## @file
+# kBuild Tool Config - Open Watcom v1.4 and later.
+#
+
+#
+# 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_OPENWATCOM = Open Watcom v1.4 and later (generic)
+
+ifeq ($(PATH_TOOL_OPENWATCOM),)
+ ifeq ($(PATH_TOOL_OPENWATCOM),)
+  PATH_TOOL_OPENWATCOM := $(wildcard $(PATH_DEVTOOLS_BLD)/openwatcom/v*)
+ endif
+ ifeq ($(PATH_TOOL_OPENWATCOM),)
+  PATH_TOOL_OPENWATCOM := $(wildcard $(PATH_DEVTOOLS_BLD)/openwatcom/v*)
+ endif
+ if1of ($(USER) $(USERNAME) $(LOGNAME), bird)
+  PATH_TOOL_OPENWATCOM := $(wildcard d:/dev/Watcom/v1.*)
+ endif
+ PATH_TOOL_OPENWATCOM := $(firstword $(sort $(PATH_TOOL_OPENWATCOM)))
+ # if not found, we'll enter 'pathless' mode.
+else
+ # Resolve any fancy stuff once and for all.
+ PATH_TOOL_OPENWATCOM := $(PATH_TOOL_OPENWATCOM)
+endif
+
+ifneq ($(PATH_TOOL_OPENWATCOM),)
+ TOOL_OPENWATCOM_PATHLESS := no
+
+ ifeq ($(KBUILD_HOST),os2)
+  PATH_TOOL_OPENWATCOM_BIN   = $(PATH_TOOL_OPENWATCOM)/binp
+  TOOL_OPENWATCOM_ENV_SETUP ?= $(REDIRECT) \
+ 	-E 'BEGINLIBPATH=$(PATH_TOOL_OPENWATCOM)/binp/dll;$(BEGINLIBPATH)' \
+ 	-E 'PATH=$(PATH_TOOL_OPENWATCOM_BIN)' \
+ 	-E 'WATCOM=$(PATH_TOOL_OPENWATCOM)' \
+ 	-E 'LIB=$1' \
+ 	-E 'INCLUDE=' \
+ 	--
+ else
+  PATH_TOOL_OPENWATCOM_BIN   = $(PATH_TOOL_OPENWATCOM)/binnt
+  TOOL_OPENWATCOM_ENV_SETUP ?= $(REDIRECT) \
+ 	-E 'PATH=$(PATH_TOOL_OPENWATCOM_BIN)' \
+ 	-E 'WATCOM=$(PATH_TOOL_OPENWATCOM)' \
+ 	-E 'LIB=$1' \
+ 	-E 'INCLUDE=' \
+ 	--
+ endif
+
+ TOOL_OPENWATCOM_CC    ?= $(PATH_TOOL_OPENWATCOM_BIN)/wcc386$(HOSTSUFF_EXE)
+ TOOL_OPENWATCOM_CC16  ?= $(PATH_TOOL_OPENWATCOM_BIN)/wcc$(HOSTSUFF_EXE)
+ TOOL_OPENWATCOM_CXX   ?= $(PATH_TOOL_OPENWATCOM_BIN)/wpp386$(HOSTSUFF_EXE)
+ TOOL_OPENWATCOM_CXX16 ?= $(PATH_TOOL_OPENWATCOM_BIN)/wpp$(HOSTSUFF_EXE)
+ TOOL_OPENWATCOM_AS    ?= $(PATH_TOOL_OPENWATCOM_BIN)/wasm$(HOSTSUFF_EXE)
+ TOOL_OPENWATCOM_AR    ?= $(PATH_TOOL_OPENWATCOM_BIN)/wlib$(HOSTSUFF_EXE)
+ TOOL_OPENWATCOM_LD    ?= $(PATH_TOOL_OPENWATCOM_BIN)/wcl386$(HOSTSUFF_EXE)
+ TOOL_OPENWATCOM_LD16  ?= $(PATH_TOOL_OPENWATCOM_BIN)/wcl$(HOSTSUFF_EXE)
+ TOOL_OPENWATCOM_RC    ?= $(PATH_TOOL_OPENWATCOM_BIN)/wrc$(HOSTSUFF_EXE)
+
+else
+ # Pathless, relies on the environment.
+ TOOL_OPENWATCOM_PATHLESS :=
+ TOOL_OPENWATCOM_ENV_SETUP ?= $(REDIRECT) \
+ 	-E 'LIB=$1' \
+ 	-E 'INCLUDE=' \
+ 	--
+ TOOL_OPENWATCOM_CC    ?= wcc386$(HOSTSUFF_EXE)
+ TOOL_OPENWATCOM_CC16  ?= wcc$(HOSTSUFF_EXE)
+ TOOL_OPENWATCOM_CXX   ?= wpp386$(HOSTSUFF_EXE)
+ TOOL_OPENWATCOM_CXX16 ?= wpp$(HOSTSUFF_EXE)
+ TOOL_OPENWATCOM_AS    ?= wasm$(HOSTSUFF_EXE)
+ TOOL_OPENWATCOM_AR    ?= wlib$(HOSTSUFF_EXE)
+ TOOL_OPENWATCOM_LD    ?= wcl386$(HOSTSUFF_EXE)
+ TOOL_OPENWATCOM_LD16  ?= wcl$(HOSTSUFF_EXE)
+ TOOL_OPENWATCOM_RC    ?= wrc$(HOSTSUFF_EXE)
+											
+endif
+							
+# General Properties used by kBuild
+TOOL_OPENWATCOM_COBJSUFF         ?= .obj
+TOOL_OPENWATCOM_CFLAGS           ?= -zq
+TOOL_OPENWATCOM_CFLAGS.os2       ?= -bt=os2
+TOOL_OPENWATCOM_CFLAGS.win       ?= -bt=nt
+TOOL_OPENWATCOM_CFLAGS.debug     ?=
+TOOL_OPENWATCOM_CFLAGS.release   ?=
+TOOL_OPENWATCOM_CINCS            ?= $(PATH_TOOL_OPENWATCOM)/h
+TOOL_OPENWATCOM_CDEFS            ?=
+
+TOOL_OPENWATCOM_CXXOBJSUFF       ?= .obj
+TOOL_OPENWATCOM_CXXFLAGS         ?= -zq
+TOOL_OPENWATCOM_CXXFLAGS.os2     ?= -bt=os2
+TOOL_OPENWATCOM_CXXFLAGS.win     ?= -bt=nt
+TOOL_OPENWATCOM_CXXFLAGS.debug   ?=
+TOOL_OPENWATCOM_CXXFLAGS.release ?=
+TOOL_OPENWATCOM_CXXINCS          ?= $(PATH_TOOL_OPENWATCOM)/h
+TOOL_OPENWATCOM_CXXDEFS          ?=
+
+TOOL_OPENWATCOM_RCOBJSUFF        ?= .res
+TOOL_OPENWATCOM_RCFLAGS          ?= -r
+TOOL_OPENWATCOM_RCFLAGS.os2      ?= -bt=os2
+TOOL_OPENWATCOM_RCFLAGS.win      ?= -bt=nt
+TOOL_OPENWATCOM_RCINCS           ?= $(PATH_TOOL_OPENWATCOM)/h
+TOOL_OPENWATCOM_RCDEFS           ?=
+
+TOOL_OPENWATCOM_ARFLAGS          ?=
+TOOL_OPENWATCOM_ARLIBSUFF        ?= .lib
+
+TOOL_OPENWATCOM_LDFLAGS          ?= -zq -y
+TOOL_OPENWATCOM_LDFLAGS.os2      ?= -bt=os2
+TOOL_OPENWATCOM_LDFLAGS.win      ?= -bt=nt
+TOOL_OPENWATCOM_LDFLAGS.debug    ?=
+
+
+TOOL_OPENWATCOM_COMPILE_C_DEPEND =
+TOOL_OPENWATCOM_COMPILE_C_DEPORD =
+TOOL_OPENWATCOM_COMPILE_C_OUTPUT = $(obj).err
+define TOOL_OPENWATCOM_COMPILE_C_CMDS
+	$(QUIET) $(call TOOL_OPENWATCOM_ENV_SETUP) $(TOOL_OPENWATCOM_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_OPENWATCOM_COMPILE_CXX_DEPEND =
+TOOL_OPENWATCOM_COMPILE_CXX_DEPORD =
+TOOL_OPENWATCOM_COMPILE_CXX_OUTPUT = $(obj).err
+define TOOL_OPENWATCOM_COMPILE_CXX_CMDS
+	$(QUIET) $(call TOOL_OPENWATCOM_ENV_SETUP) $(TOOL_OPENWATCOM_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_OPENWATCOM_COMPILE_RC_OUTPUT =
+TOOL_OPENWATCOM_COMPILE_RC_DEPEND =
+TOOL_OPENWATCOM_COMPILE_RC_DEPORD =
+define TOOL_OPENWATCOM_COMPILE_RC_CMDS
+	$(QUIET) $(call TOOL_OPENWATCOM_ENV_SETUP) \
+		$(TOOL_OPENWATCOM_RC) -r\
+		$(flags) \
+		$(addprefix -i=, $(subst /,\\,$(incs))) \
+		$(addprefix -d, $(defs))\
+		-fo=$(subst /,\\,obj) \
+		$(subst /,\\,$(abspath $(source)))
+endef
+
+TOOL_OPENWATCOM_LINK_LIBRARY_OUTPUT = ## @todo $(outbase).rsp
+TOOL_OPENWATCOM_LINK_LIBRARY_DEPEND = $(othersrc)
+TOOL_OPENWATCOM_LINK_LIBRARY_DEPORD =
+define TOOL_OPENWATCOM_LINK_LIBRARY_CMDS
+	$(if $(strip $(othersrc)),\
+		$(QUIET)$(TOOL_OPENWATCOM_ENV_SETUP) \
+		$(TOOL_OPENWATCOM_IMP) $(TOOL_OPENWATCOM_IMPFLAGS) $(subst /,\\,$(out)) $(subst /,\\,$(othersrc)) )
+	$(if $(strip $(objs)),$(QUIET)$(TOOL_OPENWATCOM_ENV_SETUP) \
+		$(QUIET)$(TOOL_OPENWATCOM_ENV_SETUP) \
+		$(TOOL_OPENWATCOM_AR) $(flags) $(subst /,\\,$(out)) $(foreach obj,$(subst /,\\,$(objs)),+"$(obj)") ";" )
+endef
+
+TOOL_OPENWATCOM_LINK_PROGRAM_OUTPUT = $(outbase).map
+TOOL_OPENWATCOM_LINK_PROGRAM_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
+TOOL_OPENWATCOM_LINK_PROGRAM_DEPORD =
+define TOOL_OPENWATCOM_LINK_PROGRAM_CMDS
+	$(QUIET)$(call TOOL_OPENWATCOM_ENV_SETUP,$(subst $(SP),,$(addsuffix ;,$(libpath)))) \
+		$(TOOL_OPENWATCOM_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_OPENWATCOM_ENV_SETUP) \
+		$(TOOL_OPENWATCOM_RC) \
+			$(filter -bt=%,$(flags)) \
+			/fe=$(subst /,\\,$(out)) \
+			$(subst /,\\,$(filter %.res,$(objs))))
+endef
+
+TOOL_OPENWATCOM_LINK_DLL_OUTPUT = $(outbase).map
+TOOL_OPENWATCOM_LINK_DLL_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
+TOOL_OPENWATCOM_LINK_DLL_DEPORD =
+define TOOL_OPENWATCOM_LINK_DLL_CMDS
+	$(QUIET)$(call TOOL_OPENWATCOM_ENV_SETUP,$(subst $(SP),,$(addsuffix ;,$(libpath)))) \
+		$(TOOL_OPENWATCOM_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_OPENWATCOM_ENV_SETUP) \
+		$(TOOL_OPENWATCOM_RC) \
+			$(filter -bt=%,$(flags)) \
+			/fe=$(subst /,\\,$(out)) \
+			$(subst /,\\,$(filter %.res,$(objs))))
+endef
+
+TOOL_OPENWATCOM_LINK_SYSMOD_OUTPUT = $(outbase).map
+TOOL_OPENWATCOM_LINK_SYSMOD_DEPEND = $(foreach lib,$(libs),$(if $(findstring $(lib),$(subst /,x,$(lib))),, $(lib))) $(othersrc)
+TOOL_OPENWATCOM_LINK_SYSMOD_DEPORD =
+define TOOL_OPENWATCOM_LINK_SYSMOD_CMDS
+	$(QUIET)$(call TOOL_OPENWATCOM_ENV_SETUP,$(subst $(SP),,$(addsuffix ;,$(libpath)))) \
+		$(TOOL_OPENWATCOM_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_OPENWATCOM_ENV_SETUP) \
+		$(TOOL_OPENWATCOM_RC) \
+			$(filter -bt=%,$(flags)) \
+			/fe=$(subst /,\\,$(out)) \
+			$(subst /,\\,$(filter %.res,$(objs))))
+endef
+
Index: trunk/kBuild/tools/WATCOMC11C-16.kmk
===================================================================
--- trunk/kBuild/tools/WATCOMC11C-16.kmk	(revision 2067)
+++ trunk/kBuild/tools/WATCOMC11C-16.kmk	(revision 2068)
@@ -35,4 +35,9 @@
 TOOL_WATCOMC11C-16 = Watcom C/C++ v11.0c - 16-bit targets.
 TOOL_WATCOMC11C-16_EXTENDS = WATCOMC11C
+TOOL_WATCOMC11C-16_ASFLAGS.win  ?= -bt=windows
+TOOL_WATCOMC11C-16_CFLAGS.win   ?= -bt=windows
+TOOL_WATCOMC11C-16_CXXFLAGS.win ?= -bt=windows
+TOOL_WATCOMC11C-16_RCFLAGS.win  ?= -bt=windows
+TOOL_WATCOMC11C-16_LDFLAGS.win  ?= -bt=windows
 						
 TOOL_WATCOMC11C-16_COMPILE_C_DEPEND =
