Index: trunk/kBuild/env.sh
===================================================================
--- trunk/kBuild/env.sh	(revision 730)
+++ trunk/kBuild/env.sh	(revision 731)
@@ -164,20 +164,20 @@
 
 # Make shell
-export MAKESHELL="$PATH_KBUILD/bin/$BUILD_PLATFORM_ARCH.$BUILD_PLATFORM/kmk_ash${_SUFF_EXE}";
+export MAKESHELL="$PATH_KBUILD/bin/$BUILD_PLATFORM.$BUILD_PLATFORM_ARCH/kmk_ash${_SUFF_EXE}";
 
 # The PATH.
-PATH="$PATH_KBUILD/bin/$BUILD_PLATFORM_ARCH.$BUILD_PLATFORM/${_PATH_SEP}$PATH"
+PATH="$PATH_KBUILD/bin/$BUILD_PLATFORM.$BUILD_PLATFORM_ARCH/${_PATH_SEP}$PATH"
 export PATH
 echo "dbg: PATH=$PATH"
 
 # Sanity and x bits.
-if [ ! -d "$PATH_KBUILD/bin/$BUILD_PLATFORM_ARCH.$BUILD_PLATFORM/" ]; then
-    echo "$0: warning: The bin directory for this platform doesn't exists. ($PATH_KBUILD/bin/$BUILD_PLATFORM_ARCH.$BUILD_PLATFORM/)"
+if [ ! -d "$PATH_KBUILD/bin/$BUILD_PLATFORM.$BUILD_PLATFORM_ARCH/" ]; then
+    echo "$0: warning: The bin directory for this platform doesn't exists. ($PATH_KBUILD/bin/$BUILD_PLATFORM.$BUILD_PLATFORM_ARCH/)"
 else
-    for prog in kmk kDepPre kDepIDB kmk_append kmk_ash kmk_cat kmk_cp kmk_echo kmk_install kmk_ln kmk_mkdir kmk_mv kmk_rm kmk_sed;
+    for prog in kmk kDepPre kDepIDB kmk_append kmk_ash kmk_cat kmk_cp kmk_echo kmk_install kmk_ln kmk_mkdir kmk_mv kmk_rm kmk_rmdir kmk_sed;
     do
-        chmod a+x $PATH_KBUILD/bin/$BUILD_PLATFORM_ARCH.$BUILD_PLATFORM/${prog} > /dev/null 2>&1
-        if [ ! -f "$PATH_KBUILD/bin/$BUILD_PLATFORM_ARCH.$BUILD_PLATFORM/${prog}${_SUFF_EXE}" ]; then
-            echo "$0: warning: The ${prog} program doesn't exist for this platform. ($PATH_KBUILD/bin/$BUILD_PLATFORM_ARCH.$BUILD_PLATFORM/${prog}${_SUFF_EXE})"
+        chmod a+x $PATH_KBUILD/bin/$BUILD_PLATFORM.$BUILD_PLATFORM_ARCH/${prog} > /dev/null 2>&1
+        if [ ! -f "$PATH_KBUILD/bin/$BUILD_PLATFORM.$BUILD_PLATFORM_ARCH/${prog}${_SUFF_EXE}" ]; then
+            echo "$0: warning: The ${prog} program doesn't exist for this platform. ($PATH_KBUILD/bin/$BUILD_PLATFORM.$BUILD_PLATFORM_ARCH/${prog}${_SUFF_EXE})"
         fi
     done
@@ -198,2 +198,3 @@
     $*
 fi
+
Index: trunk/kBuild/envos2.cmd
===================================================================
--- trunk/kBuild/envos2.cmd	(revision 730)
+++ trunk/kBuild/envos2.cmd	(revision 731)
@@ -8,5 +8,5 @@
  * Environment setup script for OS/2.
  *
- * Copyright (c) 2006 knut st. osmundsen <bird-kbuild-src@anduin.net>
+ * Copyright (c) 1999-2006 knut st. osmundsen <bird-kbuild-src@anduin.net>
  *
  *
@@ -129,5 +129,5 @@
 
 
-sPlatformBin = EnvGet("PATH_KBUILD")||"\bin\"||EnvGet("BUILD_PLATFORM_ARCH")||"."||EnvGet("BUILD_PLATFORM");
+sPlatformBin = EnvGet("PATH_KBUILD")||"\bin\"||EnvGet("BUILD_PLATFORM")||"."||EnvGet("BUILD_PLATFORM_ARCH");
 
 /* Make shell */
@@ -149,5 +149,5 @@
 else
 do
-    sPrograms = "kmk kDepPre kDepIDB kmk_append kmk_ash kmk_cat kmk_cp kmk_echo kmk_install kmk_ln kmk_mkdir kmk_mv kmk_rm kmk_sed";
+    sPrograms = "kmk kDepPre kDepIDB kmk_append kmk_ash kmk_cat kmk_cp kmk_echo kmk_install kmk_ln kmk_mkdir kmk_mv kmk_rm kmk_rmdir kmk_sed";
     do i = 1 to words(sPrograms)
         sProgram = word(sPrograms, i);
Index: trunk/kBuild/envwin.cmd
===================================================================
--- trunk/kBuild/envwin.cmd	(revision 730)
+++ trunk/kBuild/envwin.cmd	(revision 731)
@@ -36,8 +36,8 @@
 if ".%1" = ".--help"    goto help
 
-if ".%1" = ".-win"      goto want_win_bit
+if ".%1" = ".-win"      goto want_win
 if ".%1" = ".-win32"    goto want_win32_bit
 if ".%1" = ".-win64"    goto want_win64_bit
-if ".%1" = ".-nt"       goto want_nt_bit
+if ".%1" = ".-nt"       goto want_nt
 if ".%1" = ".-nt32"     goto want_nt32_bit
 if ".%1" = ".-nt64"     goto want_nt64_bit
@@ -53,5 +53,5 @@
 
 
-:want_win_bit
+:want_win
 shift
 set BUILD_TARGET=win
@@ -61,6 +61,6 @@
 :want_win32_bit
 shift
-set BUILD_PLATFORM=win32
-set BUILD_TARGET=win32
+set BUILD_PLATFORM=win
+set BUILD_TARGET=win
 set BUILD_TARGET_ARCH=x86
 goto done_arguments
@@ -68,9 +68,9 @@
 :want_win64_bit
 shift
-set BUILD_TARGET=win64
+set BUILD_TARGET=win
 set BUILD_TARGET_ARCH=amd64
 goto done_arguments
 
-:want_nt_bit
+:want_nt
 shift
 set BUILD_PLATFORM=nt
@@ -93,4 +93,28 @@
 
 :done_arguments
+
+
+REM #
+REM # Check for illegal target/platforms.
+REM #
+if "%BUILD_TARGET" = "win32" goto illegal_target
+if "%BUILD_TARGET" = "win64" goto illegal_target
+
+if "%BUILD_PLATFORM" = "win32" goto illegal_platform
+if "%BUILD_PLATFORM" = "win64" goto illegal_platform
+goto target_and_platform_ok
+
+:illegal_target
+echo error: BUILD_TARGET=%BUILD_TARGET is no longer valid. 
+echo        Only 'win' and 'nt' are permitted for targeting microsoft windows.
+goto failed
+
+:illegal_platform
+echo error: BUILD_PLATFORM=%BUILD_PLATFORM is no longer valid. 
+echo        Only 'win' and 'nt' are permitted for building on microsoft windows.
+goto failed
+
+:target_and_platform_ok
+
 
 REM #
@@ -168,6 +192,4 @@
 :have_2_BUILD_PLATFORM
 echo dbg: BUILD_PLATFORM=%BUILD_PLATFORM%
-IF "%BUILD_PLATFORM%" = "win32"         set BUILD_PLATFORM_ARCH=x86
-IF "%BUILD_PLATFORM%" = "win64"         set BUILD_PLATFORM_ARCH=amd64
 IF NOT ".%BUILD_PLATFORM_ARCH%" = "."   goto have_2_BUILD_PLATFORM_ARCH
 set TEST_PROCESSOR_ARCH=%PROCESSOR_ARCHITECTURE%
@@ -216,6 +238,4 @@
 IF NOT ".%BUILD_TARGET_ARCH%" = "." goto have_2_BUILD_TARGET_ARCH
 IF "%BUILD_TARGET%" = "os2"             set BUILD_TARGET_ARCH=x86
-IF "%BUILD_TARGET%" = "win32"           set BUILD_TARGET_ARCH=x86
-IF "%BUILD_TARGET%" = "win64"           set BUILD_TARGET_ARCH=amd64
 IF ".%BUILD_TARGET_ARCH%" = "."         set BUILD_TARGET_ARCH=%BUILD_PLATFORM_ARCH%
 :have_2_BUILD_TARGET_ARCH
@@ -233,10 +253,6 @@
 
 REM # The PATH.
-IF "%BUILD_PLATFORM_ARCH%.%BUILD_PLATFORM%" = "x86.nt"      set PATH=%PATH_KBUILD%\bin\x86.win32;%PATH%
-IF "%BUILD_PLATFORM_ARCH%.%BUILD_PLATFORM%" = "x86.win"     set PATH=%PATH_KBUILD%\bin\x86.win32;%PATH%
-IF "%BUILD_PLATFORM_ARCH%.%BUILD_PLATFORM%" = "amd64.nt"    set PATH=%PATH_KBUILD%\bin\amd64.nt;%PATH_KBUILD%\bin\x86.win32;%PATH%
-IF "%BUILD_PLATFORM_ARCH%.%BUILD_PLATFORM%" = "amd64.win"   set PATH=%PATH_KBUILD%\bin\amd64.win64;%PATH_KBUILD%\bin\x86.win32;%PATH%
-IF "%BUILD_PLATFORM_ARCH%.%BUILD_PLATFORM%" = "amd64.win64" set PATH=%PATH_KBUILD%\bin\x86.win32;%PATH%
-set PATH=%PATH_KBUILD%\bin\%BUILD_PLATFORM_ARCH%.%BUILD_PLATFORM%;%PATH%
+set PATH=%PATH_KBUILD%\bin\win.x86;%PATH%
+IF "%BUILD_PLATFORM_ARCH%" = "win.amd64" set PATH=%PATH_KBUILD%\bin\win.amd64;%PATH%
 echo dbg: PATH=%PATH%
 
Index: trunk/kBuild/header.kmk
===================================================================
--- trunk/kBuild/header.kmk	(revision 730)
+++ trunk/kBuild/header.kmk	(revision 731)
@@ -273,17 +273,17 @@
 
 ifndef PATH_KBUILD_BIN
- PATH_KBUILD_BIN    := $(PATH_KBUILD)/bin/$(BUILD_PLATFORM_ARCH).$(BUILD_PLATFORM)
+ PATH_KBUILD_BIN    := $(PATH_KBUILD)/bin/$(BUILD_PLATFORM).$(BUILD_PLATFORM_ARCH)
  ifeq ($(wildcard $(PATH_KBUILD_BIN)/kmk_ash$(HOSTSUFF_EXE)),)
   ifeq ($(BUILD_TARGET_ARCH),amd64)
-   PATH_KBUILD_BIN  := $(PATH_KBUILD)/bin/x86.$(BUILD_PLATFORM)
+   PATH_KBUILD_BIN  := $(PATH_KBUILD)/bin/$(BUILD_PLATFORM).x86
   endif
   ifeq ($(wildcard $(PATH_KBUILD_BIN)/kmk_ash$(HOSTSUFF_EXE)),)
    ifeq ($(filter-out win64 win32 win nt ,$(BUILD_PLATFORM)),)
-    PATH_KBUILD_BIN := $(PATH_KBUILD)/bin/x86.win
+    PATH_KBUILD_BIN := $(PATH_KBUILD)/bin/win.x86
    endif
   endif
   ifeq ($(wildcard $(PATH_KBUILD_BIN)/kmk_ash$(HOSTSUFF_EXE)),)
    # give up
-   PATH_KBUILD_BIN  := $(PATH_KBUILD)/bin/$(BUILD_PLATFORM_ARCH).$(BUILD_PLATFORM)
+   PATH_KBUILD_BIN  := $(PATH_KBUILD)/bin/$(BUILD_PLATFORM).$(BUILD_PLATFORM_ARCH)
   endif
  endif
