Index: /trunk/kBuild/sdks/DXSDK.kmk
===================================================================
--- /trunk/kBuild/sdks/DXSDK.kmk	(revision 664)
+++ /trunk/kBuild/sdks/DXSDK.kmk	(revision 664)
@@ -0,0 +1,63 @@
+# $Id$
+## @file
+#
+# kBuild SDK - The Microsoft Direct X SDK, targeting $(BUILD_TARGET).
+#
+# Copyright (c) 2006 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
+#
+#
+
+SDK_DXSDK := The Microsoft Direct X SDK, targeting $(BUILD_TARGET)
+
+# SDK Specific Properties
+ifndef PATH_SDK_DXSDK
+ ## @todo which order is logical here, BLD and then TRG or the other way?
+ PATH_SDK_DXSDK := $(sort $(wildcard $(PATH_DEVTOOLS_BLD)/dxsdk/2*))
+ ifeq ($(PATH_SDK_DXSDK),)
+  PATH_SDK_DXSDK := $(sort $(wildcard $(PATH_DEVTOOLS_TRG)/dxsdk/2*))
+ endif
+ ifeq ($(PATH_SDK_DXSDK),)
+  PATH_SDK_DXSDK := $(sort $(wildcard $(PATH_DEVTOOLS)/x86.win/dxsdk/2*))
+ endif
+ ifeq ($(PATH_SDK_DXSDK),)
+  PATH_SDK_DXSDK := $(sort $(wildcard $(PATH_DEVTOOLS)/x86.win32/dxsdk/2*))
+ endif
+ ifeq ($(PATH_SDK_DXSDK),)
+  PATH_SDK_DXSDK := $(sort $(wildcard $(PATH_DEVTOOLS)/amd64.win/dxsdk/2*))
+ endif
+ ifneq ($(PATH_SDK_DXSDK),)
+  PATH_SDK_DXSDK := $(call lastword,$(PATH_SDK_DXSDK))
+ else
+  $(warning kBuild: PATH_SDK_DXSDK couldn't be determined!)
+  PATH_SDK_DXSDK := $(PATH_DEVTOOLS_TRG)/dxsdk/not/found
+ endif
+else
+ # Resolve any fancy stuff once and for all.
+ PATH_SDK_DXSDK := $(PATH_SDK_DXSDK)
+endif
+PATH_SDK_DXSDK_INC ?= $(PATH_SDK_DXSDK)/Include
+PATH_SDK_DXSDK_LIB.x86 ?= $(PATH_SDK_DXSDK)/Lib
+PATH_SDK_DXSDK_LIB.amd64 ?= $(PATH_SDK_DXSDK)/Lib/x64
+PATH_SDK_DXSDK_LIB ?= $(PATH_SDK_DXSDK_LIB.$(BUILD_TARGET_ARCH))
+
+# General Properties used by kBuild
+SDK_DXSDK_INCS ?= $(PATH_SDK_DXSDK_INC)
+SDK_DXSDK_LIBPATHS ?= $(PATH_SDK_DXSDK_LIB)
+
Index: /trunk/kBuild/sdks/DXSDKAMD64.kmk
===================================================================
--- /trunk/kBuild/sdks/DXSDKAMD64.kmk	(revision 663)
+++ /trunk/kBuild/sdks/DXSDKAMD64.kmk	(revision 664)
@@ -1,6 +1,6 @@
-# $Id: $
+# $Id$
 ## @file
 #
-# kBuild SDK - Direct X SDK, AMD64.
+# kBuild SDK - The Microsoft Direct X SDK, targeting AMD64.
 #
 # Copyright (c) 2006 knut st. osmundsen <bird-srcspam@anduin.net>
@@ -25,22 +25,30 @@
 #
 
+SDK_DXSDKAMD64 := The Microsoft Direct X SDK, targeting AMD64.
 
-SDK_DXSDKAMD64          := MicroSoft Direct X SDK, AMD64.
+# SDK Specific Properties
 ifndef PATH_SDK_DXSDKAMD64
- PATH_SDK_DXSDKAMD64    := $(sort $(wildcard $(PATH_DEV)/amd64.win64/dxsdk/2*))
+ PATH_SDK_DXSDKAMD64 := $(sort $(wildcard $(PATH_DEVTOOLS)/amd64.win/dxsdk/2*))
  ifeq ($(PATH_SDK_DXSDKAMD64),)
-  PATH_SDK_DXSDKAMD64   := $(sort $(wildcard $(PATH_DEV)/x86.win32/dxsdk/2*))
+  PATH_SDK_DXSDKAMD64 := $(sort $(wildcard $(PATH_DEVTOOLS)/x86.win/dxsdk/2*))
+ endif
+ ifeq ($(PATH_SDK_DXSDKAMD64),)
+  PATH_SDK_DXSDKAMD64 := $(sort $(wildcard $(PATH_DEVTOOLS)/x86.win32/dxsdk/2*)) # legacy
  endif
  ifneq ($(PATH_SDK_DXSDKAMD64),)
-  PATH_SDK_DXSDKAMD64   := $(call lastword,$(PATH_SDK_DXSDKAMD64))
+  PATH_SDK_DXSDKAMD64 := $(call lastword,$(PATH_SDK_DXSDKAMD64))
  else
   $(warning kBuild: PATH_SDK_DXSDKAMD64 couldn't be determined!)
-  PATH_SDK_DXSDKAMD64   := $(PATH_DEV)/x86.win32/dxsdk/not/found
+  PATH_SDK_DXSDKAMD64 := $(PATH_DEVTOOLS)/amd64.win/dxsdk/not/found
  endif
+else
+ # Resolve any fancy stuff once and for all.
+ PATH_SDK_DXSDKAMD64 := $(PATH_SDK_DXSDKAMD64)
 endif
 PATH_SDK_DXSDKAMD64_INC ?= $(PATH_SDK_DXSDKAMD64)/Include
 PATH_SDK_DXSDKAMD64_LIB ?= $(PATH_SDK_DXSDKAMD64)/Lib/x64
 
-SDK_DXSDKAMD64_INCS     ?= $(PATH_SDK_DXSDKAMD64_INC)
+# General Properties used by kBuild
+SDK_DXSDKAMD64_INCS ?= $(PATH_SDK_DXSDKAMD64_INC)
 SDK_DXSDKAMD64_LIBPATHS ?= $(PATH_SDK_DXSDKAMD64_LIB)
 
Index: /trunk/kBuild/sdks/DXSDKX86.kmk
===================================================================
--- /trunk/kBuild/sdks/DXSDKX86.kmk	(revision 663)
+++ /trunk/kBuild/sdks/DXSDKX86.kmk	(revision 664)
@@ -1,6 +1,6 @@
-# $Id: $
+# $Id$
 ## @file
 #
-# kBuild SDK - Direct X SDK, X86.
+# kBuild SDK - The Microsoft Direct X SDK, targeting X86.
 #
 # Copyright (c) 2006 knut st. osmundsen <bird-srcspam@anduin.net>
@@ -26,18 +26,30 @@
 
 
-SDK_DXSDKX86          := MicroSoft Direct X SDK, X86.
+SDK_DXSDKX86 := The Microsoft Direct X SDK, targeting X86.
+
+# SDK Specific Properties
 ifndef PATH_SDK_DXSDKX86
- PATH_SDK_DXSDKX86    := $(sort $(wildcard $(PATH_DEV)/x86.win32/dxsdk/2*))
+ PATH_SDK_DXSDKX86 := $(sort $(wildcard $(PATH_DEVTOOLS)/x86.win/dxsdk/2*))
+ ifeq ($(PATH_SDK_DXSDKX86),)
+  PATH_SDK_DXSDKX86 := $(sort $(wildcard $(PATH_DEVTOOLS)/x86.win32/dxsdk/2*))
+ endif
+ ifeq ($(PATH_SDK_DXSDKX86),)
+  PATH_SDK_DXSDKX86 := $(sort $(wildcard $(PATH_DEVTOOLS)/amd64.win/dxsdk/2*))
+ endif
  ifneq ($(PATH_SDK_DXSDKX86),)
-  PATH_SDK_DXSDKX86   := $(call lastword,$(PATH_SDK_DXSDKX86))
+  PATH_SDK_DXSDKX86 := $(call lastword,$(PATH_SDK_DXSDKX86))
  else
   $(warning kBuild: PATH_SDK_DXSDKX86 couldn't be determined!)
-  PATH_SDK_DXSDKX86   := $(PATH_DEV)/x86.win32/dxsdk/not/found
+  PATH_SDK_DXSDKX86 := $(PATH_DEVTOOLS)/x86.win/dxsdk/not/found
  endif
+else
+ # Resolve any fancy stuff once and for all.
+ PATH_SDK_DXSDKX86 := $(PATH_SDK_DXSDKX86)
 endif
 PATH_SDK_DXSDKX86_INC ?= $(PATH_SDK_DXSDKX86)/Include
 PATH_SDK_DXSDKX86_LIB ?= $(PATH_SDK_DXSDKX86)/Lib/x86
 
-SDK_DXSDKX86_INCS     ?= $(PATH_SDK_DXSDKX86_INC)
+# General Properties used by kBuild
+SDK_DXSDKX86_INCS ?= $(PATH_SDK_DXSDKX86_INC)
 SDK_DXSDKX86_LIBPATHS ?= $(PATH_SDK_DXSDKX86_LIB)
 
Index: /trunk/kBuild/sdks/LIBSDL.kmk
===================================================================
--- /trunk/kBuild/sdks/LIBSDL.kmk	(revision 663)
+++ /trunk/kBuild/sdks/LIBSDL.kmk	(revision 664)
@@ -1,6 +1,6 @@
-# $Id: $
+# $Id$
 ## @file
 #
-# kBuild SDK - libsdl (default target only).
+# kBuild SDK - libsdl, targeting $(BUILD_TARGET).
 #
 # Copyright (c) 2006 knut st. osmundsen <bird-srcspam@anduin.net>
@@ -25,20 +25,31 @@
 #
 
-## @todo I need to come up with a decent way of dealing with non-default targets.
-# The different SDL distros and install patterns isn't making this very easy exactly.
+SDK_LIBSDL := libsdl, targeting $(BUILD_TARGET).
 
-SDK_LIBSDL          := libsdl
+# SDK Specific Properties
 ifndef PATH_SDK_LIBSDL
-PATH_SDK_LIBSDL     := $(sort $(wildcard $(PATH_DEV)/$(BUILD_TARGET_ARCH).$(BUILD_TARGET)/libsdl/v*))
+ PATH_SDK_LIBSDL := $(sort $(wildcard $(PATH_DEVTOOLS_TRG)/libsdl/v*))
+ ifeq ($(PATH_SDK_LIBSDL),)
+  PATH_SDK_LIBSDL := $(sort $(wildcard $(PATH_DEVTOOLS_BLD)/libsdl/v*))
+ endif
  ifneq ($(PATH_SDK_LIBSDL),)
-  PATH_SDK_LIBSDL   := $(call lastword,$(PATH_SDK_LIBSDL))
+  PATH_SDK_LIBSDL := $(call lastword,$(PATH_SDK_LIBSDL))
  else
   $(warning kBuild: PATH_SDK_LIBSDL couldn't be determined!)
-  PATH_SDK_LIBSDL   := /usr
+  PATH_SDK_LIBSDL := /usr
  endif
+else
+  PATH_SDK_LIBSDL := $(PATH_SDK_LIBSDL)
 endif
 
+#
+# The way libsdl is distributed on the different platforms 
+# varies quite a bit, thus this kludge.
+#
 ifeq ($(BUILD_TARGET),os2)
- SDK_LIBSDL_INCS     ?= \
+ SDK_LIBSDL_LIBMAIN ?= 
+
+ # General Properties used by kBuild
+ SDK_LIBSDL_INCS ?= \
  	$(PATH_SDK_LIBSDL)/SDL/include \
  	$(PATH_SDK_LIBSDL)/SDLGfx \
@@ -47,5 +58,5 @@
  	$(PATH_SDK_LIBSDL)/SDLNet \
  	$(PATH_SDK_LIBSDL)/SDLTTF
- SDK_LIBSDL_LIBS     ?= \
+ SDK_LIBSDL_LIBS ?= \
  	$(PATH_SDK_LIBSDL)/SDL/SDL12.lib \
  	$(PATH_SDK_LIBSDL)/SDLGfx/SDLGFX.lib \
@@ -61,25 +72,29 @@
  	$(PATH_SDK_LIBSDL)/SDLNet \
  	$(PATH_SDK_LIBSDL)/SDLTTF
- SDK_LIBSDL_LIBMAIN  ?= 
+
 else
- ifneq ($(filter nt win win32 win64,$(BUILD_TARGET)),)
-  # only vc++, not mingw/cygwin.
-  SDK_LIBSDL_INCS    ?= \
+ ifeq ($(BUILD_TARGET),win) # ASSUMES VC++ on windows, sorry.
+  SDK_LIBSDL_LIBMAIN ?= \
+	$(PATH_SDK_LIBSDL)/lib/SDLmain.lib
+
+  # General Properties used by kBuild
+  SDK_LIBSDL_INCS ?= \
 	$(PATH_SDK_LIBSDL)/include/SDL \
 	$(PATH_SDK_LIBSDL)/include
-  SDK_LIBSDL_LIBS    ?= \
+  SDK_LIBSDL_LIBS ?= \
  	$(PATH_SDK_LIBSDL)/lib/SDL.lib
   SDK_LIBSDL_LIBPATHS?= \
  	$(PATH_SDK_LIBSDL)/lib
-  SDK_LIBSDL_LIBMAIN ?= \
-	$(PATH_SDK_LIBSDL)/lib/SDLmain.lib
- else
-  SDK_LIBSDL_INCS    ?= \
+
+ else # ASSUMES Unix like system
+  SDK_LIBSDL_LIBMAIN ?= sdlmain
+
+  # General Properties used by kBuild
+  SDK_LIBSDL_INCS ?= \
 	$(PATH_SDK_LIBSDL)/include/SDL \
 	$(PATH_SDK_LIBSDL)/include
-  SDK_LIBSDL_LIBS    ?= sdl sdlgfx sdlimage sdlmixer sdlnet sdlttf
-  SDK_LIBSDL_LIBPATHS?= \
+  SDK_LIBSDL_LIBS ?= sdl sdlgfx sdlimage sdlmixer sdlnet sdlttf
+  SDK_LIBSDL_LIBPATHS ?= \
  	$(PATH_SDK_LIBSDL)/lib
-  SDK_LIBSDL_LIBMAIN ?= sdlmain
  endif
 endif
Index: /trunk/kBuild/sdks/NT4DDK.kmk
===================================================================
--- /trunk/kBuild/sdks/NT4DDK.kmk	(revision 663)
+++ /trunk/kBuild/sdks/NT4DDK.kmk	(revision 664)
@@ -2,5 +2,5 @@
 ## @file
 #
-# kBuild SDK - NT4 DDK, X86.
+# kBuild SDK - The Windows NT 4 DDK, targeting X86.
 #
 # Copyright (c) 2004-2006 knut st. osmundsen <bird-srcspam@anduin.net>
@@ -25,11 +25,28 @@
 #
 
+SDK_NT4DDK := The MicroSoft NT 4 DDK, targeting X86 (free, not checked).
 
-SDK_NT4DDK          := MicroSoft NT 4 DDK, X86
-PATH_SDK_NT4DDK     ?= $(PATH_DEV)/x86.win32/ddknt4
+# SDK Specific Properties
+ifndef PATH_SDK_NT4DDK
+ PATH_SDK_NT4DDK := $(wildcard $(PATH_DEVTOOLS)/x86.win/ddknt4)
+ ifeq ($(PATH_SDK_NT4DDK),)
+  PATH_SDK_NT4DDK := $(wildcard $(PATH_DEVTOOLS)/x86.win32/ddknt4) # legacy
+ endif
+ ifneq ($(PATH_SDK_NT4DDK),)
+  # only one version here, currently.
+ else
+  $(warning kBuild: PATH_SDK_NT4DDK couldn't be determined!)
+  PATH_SDK_NT4DDK := $(PATH_DEVTOOLS)/x86.win/ddknt4/not/found
+ endif
+else
+ # Resolve any fancy stuff once and for all.
+ PATH_SDK_NT4DDK := $(PATH_SDK_NT4DDK)
+endif
 PATH_SDK_NT4DDK_INC ?= $(PATH_SDK_NT4DDK)/inc
 PATH_SDK_NT4DDK_LIB ?= $(PATH_SDK_NT4DDK)/lib/i386/free
-SDK_NT4DDK_DEFS	    ?= _X86_
-SDK_NT4DDK_INCS	    ?= $(PATH_SDK_NT4DDK_INC)
+
+# General Properties used by kBuild
+SDK_NT4DDK_DEFS ?= _X86_
+SDK_NT4DDK_INCS	?= $(PATH_SDK_NT4DDK_INC)
 SDK_NT4DDK_LIBPATHS ?= $(PATH_SDK_NT4DDK_LIB)
 
Index: /trunk/kBuild/sdks/W2K3DDK.kmk
===================================================================
--- /trunk/kBuild/sdks/W2K3DDK.kmk	(revision 664)
+++ /trunk/kBuild/sdks/W2K3DDK.kmk	(revision 664)
@@ -0,0 +1,69 @@
+# $Id$
+## @file
+#
+# kBuild SDK - The Microsoft Windows 2003 DDK, targeting $(BUILD_TARGET).
+#
+# Copyright (c) 2006 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
+#
+#
+
+SDK_W2K3DDKAMD64 := The Microsoft Windows 2003 DDK, targeting $(BUILD_TARGET).
+
+# SDK Specific Properties
+ifndef PATH_SDK_W2K3DDK
+ PATH_SDK_W2K3DDK := $(sort $(wildcard $(PATH_DEVTOOLS_TRG)/ddkwin2k3/2*))
+ ifeq ($(PATH_SDK_W2K3DDK),)
+  PATH_SDK_W2K3DDK := $(sort $(wildcard $(PATH_DEVTOOLS_BLD)/ddkwin2k3/2*))
+ endif
+ ifeq ($(PATH_SDK_W2K3DDK),)
+  PATH_SDK_W2K3DDK := $(sort $(wildcard $(PATH_DEVTOOLS)/amd64.win/ddkwin2k3/2*))
+ endif
+ ifeq ($(PATH_SDK_W2K3DDK),)
+  PATH_SDK_W2K3DDK := $(sort $(wildcard $(PATH_DEVTOOLS)/x86.win/ddkwin2k3/2*))
+ endif
+ ifeq ($(PATH_SDK_W2K3DDK),)
+  PATH_SDK_W2K3DDK := $(sort $(wildcard $(PATH_DEVTOOLS)/x86.win32/ddkwin2k3/2*))
+ endif
+ ifneq ($(PATH_SDK_W2K3DDK),)
+  PATH_SDK_W2K3DDK := $(call lastword,$(PATH_SDK_W2K3DDK))
+ else
+  $(warning kBuild: PATH_SDK_W2K3DDK couldn't be determined!)
+  PATH_SDK_W2K3DDK := $(PATH_DEVTOOLS)/x86.win32/ddkwin2k3
+ endif
+else
+ # Resolve any fancy stuff once and for all.
+ PATH_SDK_W2K3DDK := $(PATH_SDK_W2K3DDK)
+endif
+PATH_SDK_W2K3DDK_INC ?= $(PATH_SDK_W2K3DDK)/inc
+PATH_SDK_W2K3DDK_LIB.amd64 ?= $(PATH_SDK_W2K3DDK)/lib/wnet/AMD64
+PATH_SDK_W2K3DDK_LIB.x86 ?= $(PATH_SDK_W2K3DDK)/lib/wnet/i386
+PATH_SDK_W2K3DDK_LIB ?= $(PATH_SDK_W2K3DDK.$(BUILD_TARGET_ARCH))
+
+# General Properties used by kBuild
+SDK_W2K3DDK_DEFS.amd64 ?= _AMD64_
+SDK_W2K3DDK_DEFS.x86 ?= _X86_
+SDK_W2K3DDK_INCS ?= \
+	$(PATH_SDK_W2K3DDK_INC)/ddk \
+	$(PATH_SDK_W2K3DDK_INC)/ddk/wnet \
+	$(PATH_SDK_W2K3DDK_INC)/wnet \
+	$(PATH_SDK_W2K3DDK_INC)/ddk/wdw/wnet
+SDK_W2K3DDK_LIBPATHS.amd64 ?= $(PATH_SDK_W2K3DDK_LIB.amd64)
+SDK_W2K3DDK_LIBPATHS.x86 ?= $(PATH_SDK_W2K3DDK_LIB.x86)
+
Index: /trunk/kBuild/sdks/W2K3DDKAMD64.kmk
===================================================================
--- /trunk/kBuild/sdks/W2K3DDKAMD64.kmk	(revision 663)
+++ /trunk/kBuild/sdks/W2K3DDKAMD64.kmk	(revision 664)
@@ -1,6 +1,6 @@
-# $Id: NT4DDK.kmk 78 2004-06-01 01:07:24Z bird $
+# $Id$
 ## @file
 #
-# kBuild SDK - Windows 2003 DDK, AMD64.
+# kBuild SDK - The Microsoft Windows 2003 DDK, targeting AMD64.
 #
 # Copyright (c) 2006 knut st. osmundsen <bird-srcspam@anduin.net>
@@ -25,28 +25,36 @@
 #
 
+SDK_W2K3DDKAMD64 := The Microsoft Windows 2003 DDK, targeting AMD64.
 
-SDK_W2K3DDKAMD64          := MicroSoft Windows 2003 DDK, AMD64
+# SDK Specific Properties
 ifndef PATH_SDK_W2K3DDKAMD64
- PATH_SDK_W2K3DDKAMD64    := $(sort $(wildcard $(PATH_DEV)/amd64.win64/ddkwin2k3/2*))
+ PATH_SDK_W2K3DDKAMD64 := $(sort $(wildcard $(PATH_DEVTOOLS)/amd64.win/ddkwin2k3/2*))
  ifeq ($(PATH_SDK_W2K3DDKAMD64),)
-  PATH_SDK_W2K3DDKAMD64   := $(sort $(wildcard $(PATH_DEV)/x86.win32/ddkwin2k3/2*))
+  PATH_SDK_W2K3DDKAMD64 := $(sort $(wildcard $(PATH_DEVTOOLS)/x86.win/ddkwin2k3/2*))
+ endif
+ ifeq ($(PATH_SDK_W2K3DDKAMD64),)
+  PATH_SDK_W2K3DDKAMD64 := $(sort $(wildcard $(PATH_DEVTOOLS)/x86.win32/ddkwin2k3/2*))
  endif
  ifneq ($(PATH_SDK_W2K3DDKAMD64),)
-  PATH_SDK_W2K3DDKAMD64   := $(call lastword,$(PATH_SDK_W2K3DDKAMD64))
+  PATH_SDK_W2K3DDKAMD64 := $(call lastword,$(PATH_SDK_W2K3DDKAMD64))
  else
-  PATH_SDK_W2K3DDKAMD64   := $(PATH_DEV)/x86.win32/ddkwin2k3
+  $(warning kBuild: PATH_SDK_W2K3DDKAMD64 couldn't be determined!)
+  PATH_SDK_W2K3DDKAMD64 := $(PATH_DEVTOOLS)/x86.win32/ddkwin2k3
  endif
+else
+ # Resolve any fancy stuff once and for all.
+ PATH_SDK_W2K3DDKAMD64 := $(PATH_SDK_W2K3DDKAMD64)
 endif
 PATH_SDK_W2K3DDKAMD64_INC ?= $(PATH_SDK_W2K3DDKAMD64)/inc
 PATH_SDK_W2K3DDKAMD64_LIB ?= $(PATH_SDK_W2K3DDKAMD64)/lib/wnet/AMD64
 
-SDK_W2K3DDKAMD64_DEFS     ?= _AMD64_
-SDK_W2K3DDKAMD64_INCS     ?= \
+# General Properties used by kBuild
+SDK_W2K3DDKAMD64_DEFS ?= _AMD64_
+SDK_W2K3DDKAMD64_INCS ?= \
 	$(PATH_SDK_W2K3DDKAMD64_INC)/ddk \
 	$(PATH_SDK_W2K3DDKAMD64_INC)/ddk/wnet \
 	$(PATH_SDK_W2K3DDKAMD64_INC)/wnet \
 	$(PATH_SDK_W2K3DDKAMD64_INC)/ddk/wdw/wnet
-#	$(PATH_SDK_W2K3DDKAMD64_INC)/crt
+SDK_W2K3DDKAMD64_LIBPATHS ?= \
+	$(PATH_SDK_W2K3DDKAMD64_LIB)
 
-SDK_W2K3DDKAMD64_LIBPATHS ?= $(PATH_SDK_W2K3DDKAMD64_LIB)
-
Index: /trunk/kBuild/sdks/W2K3DDKX86.kmk
===================================================================
--- /trunk/kBuild/sdks/W2K3DDKX86.kmk	(revision 663)
+++ /trunk/kBuild/sdks/W2K3DDKX86.kmk	(revision 664)
@@ -1,6 +1,6 @@
-# $Id: NT4DDK.kmk 78 2004-06-01 01:07:24Z bird $
+# $Id$
 ## @file
 #
-# kBuild SDK - Windows 2003 DDK, X86.
+# kBuild SDK - The Microsoft Windows 2003 DDK, targeting X86.
 #
 # Copyright (c) 2006 knut st. osmundsen <bird-srcspam@anduin.net>
@@ -25,25 +25,36 @@
 #
 
+SDK_W2K3DDKX86 := The Microsoft Windows 2003 DDK, targeting X86.
 
-SDK_W2K3DDKX86          := MicroSoft Windows 2003 DDK, X86
+# SDK Specific Properties
 ifndef PATH_SDK_W2K3DDKX86
- PATH_SDK_W2K3DDKX86    := $(sort $(wildcard $(PATH_DEV)/x86.win32/ddkwin2k3/2*))
+ PATH_SDK_W2K3DDKX86 := $(sort $(wildcard $(PATH_DEVTOOLS)/x86.win/ddkwin2k3/2*))
+ ifeq ($(PATH_SDK_W2K3DDKX86),)
+  PATH_SDK_W2K3DDKX86 := $(sort $(wildcard $(PATH_DEVTOOLS)/x86.win32/ddkwin2k3/2*))
+ endif
+ ifeq ($(PATH_SDK_W2K3DDKX86),)
+  PATH_SDK_W2K3DDKX86 := $(sort $(wildcard $(PATH_DEVTOOLS)/amd64.win/ddkwin2k3/2*))
+ endif
  ifneq ($(PATH_SDK_W2K3DDKX86),)
-  PATH_SDK_W2K3DDKX86   := $(call lastword,$(PATH_SDK_W2K3DDKX86))
+  PATH_SDK_W2K3DDKX86 := $(call lastword,$(PATH_SDK_W2K3DDKX86))
  else
-  PATH_SDK_W2K3DDKX86   := $(PATH_DEV)/x86.win32/ddkwin2k3
+  $(warning kBuild: PATH_SDK_W2K3DDKX86 couldn't be determined!)
+  PATH_SDK_W2K3DDKX86 := $(PATH_DEVTOOL)/x86.win/ddkwin2k3/not/found
  endif
+else
+ # Resolve any fancy stuff once and for all.
+ PATH_SDK_W2K3DDKX86 := $(PATH_SDK_W2K3DDKX86)
 endif
 PATH_SDK_W2K3DDKX86_INC ?= $(PATH_SDK_W2K3DDKX86)/inc
 PATH_SDK_W2K3DDKX86_LIB ?= $(PATH_SDK_W2K3DDKX86)/lib/wnet/i386
 
-SDK_W2K3DDKX86_DEFS     ?= _X86_
-SDK_W2K3DDKX86_INCS     ?= \
+# General Properties used by kBuild
+SDK_W2K3DDKX86_DEFS ?= _X86_
+SDK_W2K3DDKX86_INCS ?= \
 	$(PATH_SDK_W2K3DDKX86_INC)/ddk \
 	$(PATH_SDK_W2K3DDKX86_INC)/ddk/wnet \
 	$(PATH_SDK_W2K3DDKX86_INC)/wnet \
 	$(PATH_SDK_W2K3DDKX86_INC)/ddk/wdm/wnet
-#	$(PATH_SDK_W2K3DDKX86_INC)/crt
+SDK_W2K3DDKX86_LIBPATHS	?= \
+	$(PATH_SDK_W2K3DDKX86_LIB)
 
-SDK_W2K3DDKX86_LIBPATHS	?= $(PATH_SDK_W2K3DDKX86_LIB)
-
Index: /trunk/kBuild/sdks/W32API.kmk
===================================================================
--- /trunk/kBuild/sdks/W32API.kmk	(revision 663)
+++ /trunk/kBuild/sdks/W32API.kmk	(revision 664)
@@ -2,7 +2,7 @@
 ## @file
 #
-# kBuild SDK - MinGW Windows API.
+# kBuild SDK - w32api (MinGW), targeting x86.
 #
-# Copyright (c) 2004 knut st. osmundsen <bird-srcspam@anduin.net>
+# Copyright (c) 2004-2006 knut st. osmundsen <bird-srcspam@anduin.net>
 #
 #
@@ -25,19 +25,27 @@
 #
 
+SDK_W32API := w32api (MinGW), targeting x86.
 
-SDK_W32API                  := MinGW Windows API
+# SDK Specific Properties
 ifndef PATH_SDK_W32API
- PATH_SDK_W32API            := $(sort $(wildcard $(PATH_DEV)/x86.win32/w32api/v*))
+ PATH_SDK_W32API := $(sort $(wildcard $(PATH_DEVTOOLS)/x86.win/w32api/v*))
+ ifeq ($(PATH_SDK_W32API),)
+  PATH_SDK_W32API := $(sort $(wildcard $(PATH_DEVTOOLS)/x86.win32/w32api/v*))
+ endif
  ifneq ($(PATH_SDK_W32API),)
-  PATH_SDK_W32API           := $(call lastword,$(PATH_SDK_W32API))
+  PATH_SDK_W32API := $(call lastword,$(PATH_SDK_W32API))
  else
   $(warning kBuild: PATH_SDK_W32API couldn't be determined!)
-  PATH_SDK_W32API           := $(PATH_DEV)/x86.win32/w32api/not/found
+  PATH_SDK_W32API := $(PATH_DEVTOOLS)/x86.win/w32api/not/found
  endif
+else
+ # Resolve any fancy stuff once and for all.
+ PATH_SDK_W32API := $(PATH_SDK_W32API)
 endif
-PATH_SDK_W32API_INC         ?= $(PATH_SDK_W32API)/include
-PATH_SDK_W32API_LIB         ?= $(PATH_SDK_W32API)/lib
+PATH_SDK_W32API_INC ?= $(PATH_SDK_W32API)/include
+PATH_SDK_W32API_LIB ?= $(PATH_SDK_W32API)/lib
 
-SDK_W32API_INCS		    ?= $(PATH_SDK_W32API_INC)
-SDK_W32API_LIBPATH          ?= $(PATH_SDK_W32API_LIB)
+# General Properties used by kBuild
+SDK_W32API_INCS	?= $(PATH_SDK_W32API_INC)
+SDK_W32API_LIBPATH ?= $(PATH_SDK_W32API_LIB)
 
Index: /trunk/kBuild/sdks/WIN32SDK.kmk
===================================================================
--- /trunk/kBuild/sdks/WIN32SDK.kmk	(revision 663)
+++ /trunk/kBuild/sdks/WIN32SDK.kmk	(revision 664)
@@ -1,6 +1,6 @@
-# $Id: W32API.kmk 132 2004-06-30 20:29:28Z bird $
+# $Id$
 ## @file
 #
-# kBuild SDK - Windows Platform SDK.
+# kBuild SDK - The Windows Platform SDK, targeting x86.
 #
 # Copyright (c) 2006 knut st. osmundsen <bird-srcspam@anduin.net>
@@ -25,13 +25,20 @@
 #
 
+SDK_WIN32SDK := The Windows Platform SDK, targeting x86.
 
-SDK_WIN32SDK          := Win32 Platform SDK
+# SDK Specific Properties
 ifndef PATH_SDK_WIN32SDK
- PATH_SDK_WIN32SDK    := $(sort $(wildcard $(PATH_DEV)/x86.win32/sdk/2*))
+ PATH_SDK_WIN32SDK := $(sort $(wildcard $(PATH_DEVTOOLS)/x86.win/sdk/2*))
+ ifeq ($(PATH_SDK_WIN32SDK),)
+  PATH_SDK_WIN32SDK := $(sort $(wildcard $(PATH_DEVTOOLS)/x86.win32/sdk/2*))
+ endif
+ ifeq ($(PATH_SDK_WIN32SDK),)
+  PATH_SDK_WIN32SDK := $(sort $(wildcard $(PATH_DEVTOOLS)/amd64.win/sdk/2*))
+ endif
  ifneq ($(PATH_SDK_WIN32SDK),)
-  PATH_SDK_WIN32SDK   := $(call lastword,$(PATH_SDK_WIN32SDK))
+  PATH_SDK_WIN32SDK := $(call lastword,$(PATH_SDK_WIN32SDK))
  else
   $(warning kBuild: PATH_SDK_WIN32SDK couldn't be determined!)
-  PATH_SDK_WIN32SDK   := $(PATH_DEV)/x86.win32/sdk/not/found
+  PATH_SDK_WIN32SDK := $(PATH_DEVTOOLS)/x86.win32/sdk/not/found
  endif
 endif
@@ -39,7 +46,8 @@
 PATH_SDK_WIN32SDK_LIB ?= $(PATH_SDK_WIN32SDK)/lib
 
-SDK_WIN32SDK_INCS     ?= $(PATH_SDK_WIN32SDK_INC)
-SDK_WIN32SDK_LIBPATH  ?= $(PATH_SDK_WIN32SDK_LIB)
-SDK_WIN32SDK_LIBS     ?= \
+# General Properties used by kBuild
+SDK_WIN32SDK_INCS ?= $(PATH_SDK_WIN32SDK_INC)
+SDK_WIN32SDK_LIBPATH ?= $(PATH_SDK_WIN32SDK_LIB)
+SDK_WIN32SDK_LIBS ?= \
 	$(PATH_SDK_WIN32SDK_LIB)/Kernel32.Lib \
 	$(PATH_SDK_WIN32SDK_LIB)/User32.Lib \
Index: /trunk/kBuild/sdks/WIN32SDK2002.kmk
===================================================================
--- /trunk/kBuild/sdks/WIN32SDK2002.kmk	(revision 663)
+++ /trunk/kBuild/sdks/WIN32SDK2002.kmk	(revision 664)
@@ -1,6 +1,7 @@
-# $Id: W32API.kmk 132 2004-06-30 20:29:28Z bird $
+# $Id$
 ## @file
 #
-# kBuild SDK - Windows Platform SDK (2002).
+# kBuild SDK - Windows Platform SDK (from ~2002), targeting x86.
+#              Differs in that it has ddraw.lib and dxguid.lib.
 #
 # Copyright (c) 2006 knut st. osmundsen <bird-srcspam@anduin.net>
@@ -26,23 +27,36 @@
 
 
-SDK_WIN32SDK2002          := Win32 Platform SDK 2002
+SDK_WIN32SDK2002 := Windows Platform SDK (from ~2002), targeting x86. \
+	Differs in that it has ddraw.lib and dxguid.lib.
+
+# SDK Specific Properties
 ifndef PATH_SDK_WIN32SDK2002
- PATH_SDK_WIN32SDK2002    := $(sort $(wildcard $(PATH_DEV)/x86.win32/sdk/2002*))
+ PATH_SDK_WIN32SDK2002 := $(sort $(wildcard $(PATH_DEVTOOLS)/x86.win/sdk/2002*))
  ifeq ($(PATH_SDK_WIN32SDK2002),)
-  PATH_SDK_WIN32SDK2002   := $(sort $(wildcard $(PATH_DEV)/x86.win32/sdk2002*))
+  PATH_SDK_WIN32SDK2002 := $(sort $(wildcard $(PATH_DEVTOOLS)/x86.win32/sdk/2002*))
+ endif
+ ifeq ($(PATH_SDK_WIN32SDK2002),)
+  PATH_SDK_WIN32SDK2002 := $(sort $(wildcard $(PATH_DEVTOOLS)/x86.win/sdk2002*))
+ endif
+ ifeq ($(PATH_SDK_WIN32SDK2002),)
+  PATH_SDK_WIN32SDK2002 := $(sort $(wildcard $(PATH_DEVTOOLS)/x86.win32/sdk2002*))
  endif
  ifneq ($(PATH_SDK_WIN32SDK2002),)
-  PATH_SDK_WIN32SDK2002   := $(call lastword,$(PATH_SDK_WIN32SDK2002))
+  PATH_SDK_WIN32SDK2002 := $(call lastword,$(PATH_SDK_WIN32SDK2002))
  else
   $(warning kBuild: PATH_SDK_WIN32SDK2002 couldn't be determined!)
-  PATH_SDK_WIN32SDK2002   := $(PATH_DEV)/x86.win32/sdk/not/found
+  PATH_SDK_WIN32SDK2002 := $(PATH_DEVTOOLS)/x86.win/sdk/not/found
  endif
+else
+ # Resolve any fancy stuff once and for all.
+ PATH_SDK_WIN32SDK2002 := $(PATH_SDK_WIN32SDK2002)
 endif
 PATH_SDK_WIN32SDK2002_INC ?= $(PATH_SDK_WIN32SDK2002)/include
 PATH_SDK_WIN32SDK2002_LIB ?= $(PATH_SDK_WIN32SDK2002)/lib
 
-SDK_WIN32SDK2002_INCS     ?= $(PATH_SDK_WIN32SDK2002_INC)
-SDK_WIN32SDK2002_LIBPATH  ?= $(PATH_SDK_WIN32SDK2002_LIB)
-SDK_WIN32SDK2002_LIBS     ?= \
+# General Properties used by kBuild
+SDK_WIN32SDK2002_INCS ?= $(PATH_SDK_WIN32SDK2002_INC)
+SDK_WIN32SDK2002_LIBPATH ?= $(PATH_SDK_WIN32SDK2002_LIB)
+SDK_WIN32SDK2002_LIBS ?= \
 	$(PATH_SDK_WIN32SDK2002_LIB)/Kernel32.Lib \
 	$(PATH_SDK_WIN32SDK2002_LIB)/User32.Lib \
Index: /trunk/kBuild/sdks/WIN64SDK.kmk
===================================================================
--- /trunk/kBuild/sdks/WIN64SDK.kmk	(revision 663)
+++ /trunk/kBuild/sdks/WIN64SDK.kmk	(revision 664)
@@ -1,6 +1,6 @@
-# $Id: W32API.kmk 132 2004-06-30 20:29:28Z bird $
+# $Id$
 ## @file
 #
-# kBuild SDK - Windows Platform SDK.
+# kBuild SDK - The Windows Platform SDK, targeting AMD64.
 #
 # Copyright (c) 2006 knut st. osmundsen <bird-srcspam@anduin.net>
@@ -26,23 +26,32 @@
 
 
-SDK_WIN64SDK          := Win64 Platform SDK
+SDK_WIN64SDK := The Windows Platform SDK, targeting AMD64.
+
+# SDK Specific Properties
 ifndef PATH_SDK_WIN64SDK
- PATH_SDK_WIN64SDK    := $(sort $(wildcard $(PATH_DEV)/amd64.win64/sdk/2*))
+ PATH_SDK_WIN64SDK := $(sort $(wildcard $(PATH_DEVTOOLS)/amd64.win/sdk/2*))
  ifeq ($(PATH_SDK_WIN64SDK),)
-  PATH_SDK_WIN64SDK   := $(sort $(wildcard $(PATH_DEV)/x86.win32/sdk/2*))
+  PATH_SDK_WIN64SDK := $(sort $(wildcard $(PATH_DEVTOOLS)/x86.win/sdk/2*))
+ endif
+ ifeq ($(PATH_SDK_WIN64SDK),)
+  PATH_SDK_WIN64SDK := $(sort $(wildcard $(PATH_DEVTOOLS)/x86.win32/sdk/2*))
  endif
  ifneq ($(PATH_SDK_WIN64SDK),)
-  PATH_SDK_WIN64SDK   := $(call lastword,$(PATH_SDK_WIN64SDK))
+  PATH_SDK_WIN64SDK := $(call lastword,$(PATH_SDK_WIN64SDK))
  else
   $(warning kBuild: PATH_SDK_WIN64SDK couldn't be determined!)
-  PATH_SDK_WIN64SDK   := $(PATH_DEV)/amd64.win64/sdk/not/found
+  PATH_SDK_WIN64SDK := $(PATH_DEVTOOLS)/amd64.win/sdk/not/found
  endif
+else
+ # Resolve any fancy stuff once and for all.
+ PATH_SDK_WIN64SDK := $(PATH_SDK_WIN64SDK)
 endif
 PATH_SDK_WIN64SDK_INC ?= $(PATH_SDK_WIN64SDK)/include
 PATH_SDK_WIN64SDK_LIB ?= $(PATH_SDK_WIN64SDK)/lib/AMD64
 
-SDK_WIN64SDK_INCS     ?= $(PATH_SDK_WIN64SDK_INC)
-SDK_WIN64SDK_LIBPATH  ?= $(PATH_SDK_WIN64SDK_LIB)
-SDK_WIN64SDK_LIBS     ?= \
+# General Properties used by kBuild
+SDK_WIN64SDK_INCS ?= $(PATH_SDK_WIN64SDK_INC)
+SDK_WIN64SDK_LIBPATH ?= $(PATH_SDK_WIN64SDK_LIB)
+SDK_WIN64SDK_LIBS ?= \
 	$(PATH_SDK_WIN64SDK_LIB)/Kernel32.Lib \
 	$(PATH_SDK_WIN64SDK_LIB)/User32.Lib \
Index: /trunk/kBuild/sdks/WINPSDK.kmk
===================================================================
--- /trunk/kBuild/sdks/WINPSDK.kmk	(revision 664)
+++ /trunk/kBuild/sdks/WINPSDK.kmk	(revision 664)
@@ -0,0 +1,88 @@
+# $Id$
+## @file
+#
+# kBuild SDK - The Windows Platform SDK, targeting (BUILD_TARGET).
+#
+# Copyright (c) 2006 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
+#
+#
+
+SDK_WINPSDK := The Windows Platform SDK, targeting (BUILD_TARGET).
+
+# SDK Specific Properties
+ifndef PATH_SDK_WINPSDK
+ PATH_SDK_WINPSDK := $(sort $(wildcard $(PATH_DEVTOOLS_BLD)/sdk/2*))
+ ifeq ($(PATH_SDK_WINPSDK),)
+  PATH_SDK_WINPSDK := $(sort $(wildcard $(PATH_DEVTOOLS_TRG)/sdk/2*))
+ endif
+ ifeq ($(PATH_SDK_WINPSDK),)
+  PATH_SDK_WINPSDK := $(sort $(wildcard $(PATH_DEVTOOLS)/x86.win/sdk/2*))
+ endif
+ ifeq ($(PATH_SDK_WINPSDK),)
+  PATH_SDK_WINPSDK := $(sort $(wildcard $(PATH_DEVTOOLS)/x86.win32/sdk/2*))
+ endif
+ ifeq ($(PATH_SDK_WINPSDK),)
+  PATH_SDK_WINPSDK := $(sort $(wildcard $(PATH_DEVTOOLS)/amd64.win/sdk/2*))
+ endif
+ ifneq ($(PATH_SDK_WINPSDK),)
+  PATH_SDK_WINPSDK := $(call lastword,$(PATH_SDK_WINPSDK))
+ else
+  $(warning kBuild: PATH_SDK_WINPSDK couldn't be determined!)
+  PATH_SDK_WINPSDK := $(PATH_DEVTOOLS_BLD)/sdk//not/found
+ endif
+else
+ PATH_SDK_WINPSDK := $(PATH_SDK_WINPSDK)
+endif
+PATH_SDK_WINPSDK_INC ?= $(PATH_SDK_WINPSDK)/include
+PATH_SDK_WINPSDK_LIB.x86 ?= $(PATH_SDK_WINPSDK)/lib
+PATH_SDK_WINPSDK_LIB.amd64 ?= $(PATH_SDK_WINPSDK)/lib
+PATH_SDK_WINPSDK_LIB ?= $(PATH_SDK_WINPSDK_LIB.$(BUILD_TARGET_ARCH))
+PATH_SDK_WINPSDK_BIN ?= $(PATH_SDK_WINPSDK)/bin
+PATH_SDK_WINPSDK_BIN_AMD64 ?= $(PATH_SDK_WINPSDK)/bin/win64/x86/AMD64
+PATH_SDK_WINPSDK_BIN_IA64 ?= $(PATH_SDK_WINPSDK)/bin/win64/
+
+# General Properties used by kBuild
+SDK_WINPSDK_INCS ?= $(PATH_SDK_WINPSDK_INC)
+SDK_WINPSDK_LIBPATH ?= $(PATH_SDK_WINPSDK_LIB)
+SDK_WINPSDK_LIBS ?= \
+	$(PATH_SDK_WINPSDK_LIB)/Kernel32.Lib \
+	$(PATH_SDK_WINPSDK_LIB)/User32.Lib \
+	$(PATH_SDK_WINPSDK_LIB)/Gdi32.Lib \
+	$(PATH_SDK_WINPSDK_LIB)/AdvAPI32.Lib \
+	$(PATH_SDK_WINPSDK_LIB)/Shell32.Lib \
+	$(PATH_SDK_WINPSDK_LIB)/ShLwApi.Lib \
+	$(PATH_SDK_WINPSDK_LIB)/SetupAPI.Lib \
+	$(PATH_SDK_WINPSDK_LIB)/Uuid.Lib \
+	$(PATH_SDK_WINPSDK_LIB)/Version.Lib \
+	$(PATH_SDK_WINPSDK_LIB)/WS2_32.Lib \
+	\
+	$(PATH_SDK_WINPSDK_LIB)/Ole32.Lib \
+	$(PATH_SDK_WINPSDK_LIB)/OleAut32.Lib \
+	$(PATH_SDK_WINPSDK_LIB)/OleDlg.Lib \
+	$(PATH_SDK_WINPSDK_LIB)/RpcRT4.Lib \
+	\
+	$(PATH_SDK_WINPSDK_LIB)/DbgHelp.Lib \
+	$(PATH_SDK_WINPSDK_LIB)/ImageHlp.Lib \
+	$(PATH_SDK_WINPSDK_LIB)/IPHlpApi.Lib \
+	$(PATH_SDK_WINPSDK_LIB)/ComCtl32.Lib \
+	$(PATH_SDK_WINPSDK_LIB)/ComDlg32.Lib \
+	$(PATH_SDK_WINPSDK_LIB)/WinSpool.Lib \
+	$(PATH_SDK_WINPSDK_LIB)/WinMM.Lib
+
