summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--msvc/ddk_build.cmd46
1 files changed, 18 insertions, 28 deletions
diff --git a/msvc/ddk_build.cmd b/msvc/ddk_build.cmd
index cf7daa0..2c95998 100644
--- a/msvc/ddk_build.cmd
+++ b/msvc/ddk_build.cmd
@@ -1,18 +1,20 @@
-@rem default builds static library.
-@rem you can pass the following arguments (case insensitive):
-@rem - "DLL" to build a DLL instead of a static library
-@rem - "/MT" to build a static library compatible with MSVC's /MT option (LIBCMT vs MSVCRT)
@echo off
+::# default builds static library.
+::# you can pass the following arguments (case insensitive):
+::# - "DLL" to build a DLL instead of a static library
+::# - "/MT" to build a static library compatible with MSVC's /MT option (LIBCMT vs MSVCRT)
if Test%BUILD_ALT_DIR%==Test goto usage
-rem process commandline parameters
+::# process commandline parameters
set TARGET=LIBRARY
set STATIC_LIBC=
set version=1.0
+set PWD=%~dp0
+set BUILD_CMD=build -bcwgZ -M2
if "%1" == "" goto no_more_args
-rem /I for case insensitive
+::# /I for case insensitive
if /I Test%1==TestDLL set TARGET=DYNLINK
if /I Test%1==Test/MT set STATIC_LIBC=1
:no_more_args
@@ -22,7 +24,7 @@ echo TARGETTYPE=%TARGET% > target
copy target+..\..\msvc\libusb_sources sources >NUL 2>&1
del target
@echo on
-build -cwgZ
+%BUILD_CMD%
@echo off
if errorlevel 1 goto builderror
cd ..\..
@@ -73,9 +75,9 @@ md examples\lsusb_ddkbuild
cd examples\lsusb_ddkbuild
copy ..\..\msvc\lsusb_sources sources >NUL 2>&1
@echo on
-build -cwgZ
+%BUILD_CMD%
@echo off
-if errorlevel 1 goto buildlsusberror
+if errorlevel 1 goto builderror
cd ..\..
set srcPath=examples\lsusb_ddkbuild\obj%BUILD_ALT_DIR%\%cpudir%
@@ -93,9 +95,9 @@ md examples\xusb_ddkbuild
cd examples\xusb_ddkbuild
copy ..\..\msvc\xusb_sources sources >NUL 2>&1
@echo on
-build -cwgZ
+%BUILD_CMD%
@echo off
-if errorlevel 1 goto buildxusberror
+if errorlevel 1 goto builderror
cd ..\..
set srcPath=examples\xusb_ddkbuild\obj%BUILD_ALT_DIR%\%cpudir%
@@ -109,25 +111,13 @@ copy %srcPath%\xusb.pdb %dstPath%\examples
cd msvc
goto done
-
-:builderror
-cd ..\..\msvc
-echo Build failed
-goto done
-
-:buildlsusberror
-cd ..\..\msvc
-echo lsusb build failed
-goto done
-
-:buildxusberror
-cd ..\..\msvc
-echo xusb build failed
-goto done
-
:usage
echo ddk_build must be run in a WDK build environment
pause
goto done
-:done \ No newline at end of file
+:builderror
+echo Build failed
+
+:done
+cd %PWD%