diff options
author | Pete Batard <pete@akeo.ie> | 2011-11-07 17:45:55 +0000 |
---|---|---|
committer | Pete Batard <pete@akeo.ie> | 2011-11-07 17:45:55 +0000 |
commit | b19b25514bae568886f53ec0f0366bebc238893c (patch) | |
tree | 52d050307317815a93cee243a70a8f75e579682a | |
parent | 1753c93467a5a1e00c27457aad7156d9b8cb2d99 (diff) | |
download | libusb-b19b25514bae568886f53ec0f0366bebc238893c.tar.gz |
[wdk] ddk_build improvements
* easier to spot comments
* simplify errors through the use of a %PWD%
* used a BUILD_CMD variable with updated options
-rw-r--r-- | msvc/ddk_build.cmd | 46 |
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% |