[build] Add top-level build.bat and clean.bat files
authorMichael Brown <mbrown@fensystems.co.uk>
Fri, 19 Dec 2008 02:08:06 +0000 (02:08 +0000)
committerMichael Brown <mbrown@fensystems.co.uk>
Fri, 19 Dec 2008 02:08:06 +0000 (02:08 +0000)
Why would anyone want to use Makefiles when the DDK makes it so easy
to write custom batch scripts to mimic such essential functionality?

("Mimic" is a very appropriate word; it seems as though the DDK's
"build" utility doesn't reflect build failures in its exit status, so
we have no way to detect build errors other than watching the
console!)

build.bat [new file with mode: 0644]
clean.bat [new file with mode: 0644]

diff --git a/build.bat b/build.bat
new file mode 100644 (file)
index 0000000..dc7405c
--- /dev/null
+++ b/build.bat
@@ -0,0 +1,21 @@
+@echo off
+
+if "%ddkdir%" == "" set ddkdir=C:\WinDDK\6001.18001
+
+for /f "delims=" %%i in ('cd') do set cwd=%%i
+
+call :build driver chk w2k i386
+call :build installer chk w2k i386
+call :build driver chk wnet x64
+call :build installer chk wnet x64
+
+goto :end
+
+:build
+set subdir=%cwd%\%1
+set ddkenv=%2 %3 %4
+echo Building %subdir% for %ddkenv%
+cmd /c "%ddkdir%\bin\setenv.bat %ddkdir% %ddkenv% && cd /d %subdir% && build /c" || exit /b 1
+goto :end
+
+:end
diff --git a/clean.bat b/clean.bat
new file mode 100644 (file)
index 0000000..c814bf2
--- /dev/null
+++ b/clean.bat
@@ -0,0 +1,4 @@
+@echo off
+
+del /q bin\i386\*.*
+del /q bin\amd64\*.*