2 ::# default builds static library.
3 ::# you can pass the following arguments
(case insensitive
):
4 ::#
- "DLL" to build a DLL instead of a static library
5 ::#
- "/MT" to build a static library compatible with MSVC
's /MT option (LIBCMT vs MSVCRT)
7 if Test%BUILD_ALT_DIR%==Test goto usage
9 ::# process commandline parameters
14 set BUILD_CMD=build -bcwgZ -M2
16 if "%1" == "" goto no_more_args
17 ::# /I for case insensitive
18 if /I Test%1==TestDLL set TARGET=DYNLINK
19 if /I Test%1==Test/MT set STATIC_LIBC=1
23 echo TARGETTYPE=%TARGET% > target
24 copy target+..\..\msvc\libusb_sources sources >NUL 2>&1
29 if errorlevel 1 goto builderror
34 if %_BUILDARCH%==x86 goto isI386
39 set srcPath=libusb\os\obj%BUILD_ALT_DIR%\%cpudir%
41 set dstPath=%destType%\Debug
42 if %DDKBUILDENV%==chk goto isDebug
43 set dstPath=%destType%\Release
46 if exist %destType% goto md2
49 if exist %dstPath% goto md3
52 if exist %dstPath%\dll goto md4
55 if exist %dstPath%\lib goto md5
58 if exist %dstPath%\examples goto md6
63 @if /I NOT Test%1==TestDLL goto copylib
64 copy %srcPath%\libusb-%version%.dll %dstPath%\dll
65 copy %srcPath%\libusb-%version%.pdb %dstPath%\dll
67 copy %srcPath%\libusb-%version%.lib %dstPath%\lib
71 if exist examples\listdevs_ddkbuild goto md7
72 md examples\listdevs_ddkbuild
75 cd examples\listdevs_ddkbuild
76 copy ..\..\msvc\listdevs_sources sources >NUL 2>&1
80 if errorlevel 1 goto builderror
83 set srcPath=examples\listdevs_ddkbuild\obj%BUILD_ALT_DIR%\%cpudir%
86 copy %srcPath%\listdevs.exe %dstPath%\examples
87 copy %srcPath%\listdevs.pdb %dstPath%\examples
91 if exist examples\xusb_ddkbuild goto md8
92 md examples\xusb_ddkbuild
95 cd examples\xusb_ddkbuild
96 copy ..\..\msvc\xusb_sources sources >NUL 2>&1
100 if errorlevel 1 goto builderror
103 set srcPath=examples\xusb_ddkbuild\obj%BUILD_ALT_DIR%\%cpudir%
106 copy %srcPath%\xusb.exe %dstPath%\examples
107 copy %srcPath%\xusb.pdb %dstPath%\examples
111 if exist examples\getopt\getopt_ddkbuild goto md9
112 md examples\getopt\getopt_ddkbuild
115 cd examples\getopt\getopt_ddkbuild
116 copy ..\..\..\msvc\getopt_sources sources >NUL 2>&1
120 if errorlevel 1 goto builderror
123 if exist examples\fxload_ddkbuild goto md10
124 md examples\fxload_ddkbuild
127 cd examples\fxload_ddkbuild
128 copy ..\..\msvc\fxload_sources sources >NUL 2>&1
132 if errorlevel 1 goto builderror
135 set srcPath=examples\fxload_ddkbuild\obj%BUILD_ALT_DIR%\%cpudir%
138 copy %srcPath%\fxload.exe %dstPath%\examples
139 copy %srcPath%\fxload.pdb %dstPath%\examples
143 if exist examples\hotplugtest_ddkbuild goto md11
144 md examples\hotplugtest_ddkbuild
147 cd examples\hotplugtest_ddkbuild
148 copy ..\..\msvc\hotplugtest_sources sources >NUL 2>&1
152 if errorlevel 1 goto builderror
155 set srcPath=examples\hotplugtest_ddkbuild\obj%BUILD_ALT_DIR%\%cpudir%
158 copy %srcPath%\hotplugtest.exe %dstPath%\examples
159 copy %srcPath%\hotplugtest.pdb %dstPath%\examples
167 echo ddk_build must be run in a WDK build environment