blob: 88d3c25ffa6993633c21b2e4caea141ffdcb14fa (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
|
@echo off
rem default builds static library. Pass argument 'DLL' to build a DLL
if Test%BUILD_ALT_DIR%==Test goto usage
set version=1.0
cd libusb\os
rem DLL or static lib selection (must use concatenation)
if Test%1==TestDLL goto libusb_dll
:libusb_static
set TARGET=LIBRARY
goto libusb_common
:libusb_dll
set TARGET=DYNLINK
:libusb_common
echo TARGETTYPE=%TARGET% > target
copy target+libusb_sources sources >NUL 2>&1
del target
@echo on
build -cwgZ
@echo off
if errorlevel 1 goto builderror
cd ..\..
set cpudir=i386
set destType=Win32
if %_BUILDARCH%==x86 goto isI386
set cpudir=amd64
set destType=x64
:isI386
set srcPath=libusb\os\obj%BUILD_ALT_DIR%\%cpudir%
set dstPath=%destType%\Debug
if %DDKBUILDENV%==chk goto isDebug
set dstPath=%destType%\Release
:isDebug
if exist %destType% goto md2
mkdir %destType%
:md2
if exist %dstPath% goto md3
mkdir %dstPath%
:md3
if exist %dstPath%\dll goto md4
mkdir %dstPath%\dll
:md4
if exist %dstPath%\lib goto md5
md %dstPath%\lib
:md5
if exist %dstPath%\examples goto md6
md %dstPath%\examples
:md6
@echo on
@if NOT Test%1==TestDLL goto copylib
copy %srcPath%\libusb-%version%.dll %dstPath%\dll
copy %srcPath%\libusb-%version%.pdb %dstPath%\dll
:copylib
copy %srcPath%\libusb-%version%.lib %dstPath%\lib
@echo off
if exist examples\lsusb_ddkbuild goto md7
md examples\lsusb_ddkbuild
:md7
cd examples\lsusb_ddkbuild
copy ..\lsusb_sources sources >NUL 2>&1
@echo on
build -cwgZ
@echo off
if errorlevel 1 goto buildlsusberror
cd ..\..
set srcPath=examples\lsusb_ddkbuild\obj%BUILD_ALT_DIR%\%cpudir%
@echo on
copy %srcPath%\lsusb.exe %dstPath%\examples
copy %srcPath%\lsusb.pdb %dstPath%\examples
@echo off
if exist examples\xusb_ddkbuild goto md8
md examples\xusb_ddkbuild
:md8
cd examples\xusb_ddkbuild
copy ..\xusb_sources sources >NUL 2>&1
@echo on
build -cwgZ
@echo off
if errorlevel 1 goto buildxusberror
cd ..\..
set srcPath=examples\xusb_ddkbuild\obj%BUILD_ALT_DIR%\%cpudir%
@echo on
copy %srcPath%\xusb.exe %dstPath%\examples
copy %srcPath%\xusb.pdb %dstPath%\examples
@echo off
goto done
:builderror
cd ..\..
echo Build failed
goto done
:buildlsusberror
cd ..\..
echo lsusb build failed
goto done
:buildxusberror
cd ..\..
echo xusb build failed
goto done
:usage
echo ddk_build must be run in a WDK build environment
pause
goto done
:done
|