Add libusb and libuvc
[rtmpclient.git] / app / src / main / jni / libusb-1.0.22 / msvc / ddk_build.cmd
1 @echo off
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)
6
7 if Test%BUILD_ALT_DIR%==Test goto usage
8
9 ::# process commandline parameters
10 set TARGET=LIBRARY
11 set STATIC_LIBC=
12 set version=1.0
13 set PWD=%~dp0
14 set BUILD_CMD=build /bcwgZ /M2
15
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
20
21 :no_more_args
22
23 cd ..\libusb\os
24 echo TARGETTYPE=%TARGET% > target
25 copy target+..\..\msvc\libusb_sources sources >NUL 2>&1
26 del target
27 @echo on
28 %BUILD_CMD%
29 @echo off
30 if errorlevel 1 goto builderror
31 cd ..\..
32
33 set cpudir=i386
34 set destType=Win32
35 if %_BUILDARCH%==x86 goto isI386
36 set cpudir=amd64
37 set destType=x64
38 :isI386
39
40 set srcPath=libusb\os\obj%BUILD_ALT_DIR%\%cpudir%
41
42 set dstPath=%destType%\Debug
43 if %DDKBUILDENV%==chk goto isDebug
44 set dstPath=%destType%\Release
45 :isDebug
46
47 if exist %destType% goto md2
48 md %destType%
49 :md2
50 if exist %dstPath% goto md3
51 md %dstPath%
52 :md3
53 if exist %dstPath%\dll goto md4
54 md %dstPath%\dll
55 :md4
56 if exist %dstPath%\lib goto md5
57 md %dstPath%\lib
58 :md5
59 if exist %dstPath%\examples goto md6
60 md %dstPath%\examples
61 :md6
62 if exist %dstPath%\tests goto md7
63 md %dstPath%\tests
64 :md7
65 @echo on
66
67 if %TARGET%==LIBRARY goto copylib
68 copy %srcPath%\libusb-%version%.dll %dstPath%\dll
69 copy %srcPath%\libusb-%version%.pdb %dstPath%\dll
70 :copylib
71 copy %srcPath%\libusb-%version%.lib %dstPath%\lib
72
73 @echo off
74
75 if exist examples\getopt\getopt_ddkbuild goto md8
76 md examples\getopt\getopt_ddkbuild
77 :md8
78
79 cd examples\getopt\getopt_ddkbuild
80 copy ..\..\..\msvc\getopt_sources sources >NUL 2>&1
81 @echo on
82 %BUILD_CMD%
83 @echo off
84 if errorlevel 1 goto builderror
85 cd ..\..\..
86
87 if exist examples\fxload_ddkbuild goto md9
88 md examples\fxload_ddkbuild
89 :md9
90
91 cd examples\fxload_ddkbuild
92 copy ..\..\msvc\fxload_sources sources >NUL 2>&1
93 @echo on
94 %BUILD_CMD%
95 @echo off
96 if errorlevel 1 goto builderror
97 cd ..\..
98
99 set srcPath=examples\fxload_ddkbuild\obj%BUILD_ALT_DIR%\%cpudir%
100 @echo on
101
102 copy %srcPath%\fxload.exe %dstPath%\examples
103 copy %srcPath%\fxload.pdb %dstPath%\examples
104
105 @echo off
106
107 if exist examples\hotplugtest_ddkbuild goto md10
108 md examples\hotplugtest_ddkbuild
109 :md10
110
111 cd examples\hotplugtest_ddkbuild
112 copy ..\..\msvc\hotplugtest_sources sources >NUL 2>&1
113 @echo on
114 %BUILD_CMD%
115 @echo off
116 if errorlevel 1 goto builderror
117 cd ..\..
118
119 set srcPath=examples\hotplugtest_ddkbuild\obj%BUILD_ALT_DIR%\%cpudir%
120 @echo on
121
122 copy %srcPath%\hotplugtest.exe %dstPath%\examples
123 copy %srcPath%\hotplugtest.pdb %dstPath%\examples
124
125 @echo off
126
127 if exist examples\listdevs_ddkbuild goto md11
128 md examples\listdevs_ddkbuild
129 :md11
130
131 cd examples\listdevs_ddkbuild
132 copy ..\..\msvc\listdevs_sources sources >NUL 2>&1
133 @echo on
134 %BUILD_CMD%
135 @echo off
136 if errorlevel 1 goto builderror
137 cd ..\..
138
139 set srcPath=examples\listdevs_ddkbuild\obj%BUILD_ALT_DIR%\%cpudir%
140 @echo on
141
142 copy %srcPath%\listdevs.exe %dstPath%\examples
143 copy %srcPath%\listdevs.pdb %dstPath%\examples
144
145 @echo off
146
147 if exist examples\testlibusb_ddkbuild goto md12
148 md examples\testlibusb_ddkbuild
149 :md12
150
151 cd examples\testlibusb_ddkbuild
152 copy ..\..\msvc\testlibusb_sources sources >NUL 2>&1
153 @echo on
154 %BUILD_CMD%
155 @echo off
156 if errorlevel 1 goto builderror
157 cd ..\..
158
159 set srcPath=examples\testlibusb_ddkbuild\obj%BUILD_ALT_DIR%\%cpudir%
160 @echo on
161
162 copy %srcPath%\testlibusb.exe %dstPath%\examples
163 copy %srcPath%\testlibusb.pdb %dstPath%\examples
164
165 @echo off
166
167 if exist examples\xusb_ddkbuild goto md13
168 md examples\xusb_ddkbuild
169 :md13
170
171 cd examples\xusb_ddkbuild
172 copy ..\..\msvc\xusb_sources sources >NUL 2>&1
173 @echo on
174 %BUILD_CMD%
175 @echo off
176 if errorlevel 1 goto builderror
177 cd ..\..
178
179 set srcPath=examples\xusb_ddkbuild\obj%BUILD_ALT_DIR%\%cpudir%
180 @echo on
181
182 copy %srcPath%\xusb.exe %dstPath%\examples
183 copy %srcPath%\xusb.pdb %dstPath%\examples
184
185 @echo off
186
187 if exist tests\stress_ddkbuild goto md14
188 md tests\stress_ddkbuild
189 :md14
190
191 cd tests\stress_ddkbuild
192 copy ..\..\msvc\stress_sources sources >NUL 2>&1
193 @echo on
194 %BUILD_CMD%
195 @echo off
196 if errorlevel 1 goto builderror
197 cd ..\..
198
199 set srcPath=tests\stress_ddkbuild\obj%BUILD_ALT_DIR%\%cpudir%
200 @echo on
201
202 copy %srcPath%\stress.exe %dstPath%\tests
203 copy %srcPath%\stress.pdb %dstPath%\tests
204
205 @echo off
206
207 cd msvc
208 goto done
209
210 :usage
211 echo ddk_build must be run in a WDK build environment
212 pause
213 goto done
214
215 :builderror
216 echo Build failed
217
218 :done
219 cd %PWD%