@echo off
REM
REM This batch file will get the source of libusb-win32 (64-bit compilable code)
REM from the libusb-win32 CVS repository:  http://libusb-win32.sourceforge.net.
REM This file will also compile the drivers
REM
REM This batch files depends upon the presence of the Microsoft Windows Server 
REM 2003 Device Driver Kit (DDK) having been pre-installed.  See microsoft.com 
REM on how to obtain. This batch file also depends upon the presence of Cygwin 
REM having pre-installed.  It is available from: http://www.cygwin.com
REM
REM Two Cygwin programs are used:  CVS (to get libusb source) and dos2unix.
REM 
REM When asked for a password from CVS command (in Cygwin), just hit return.
REM
REM Please set the following three environment variables to your system before 
REM running this batch file from either the "Windows Server 2003 Checked x64 Build
REM Environment" command-line or the "Windows Server 2003 Checked IA-64 Build
REM Environment" command-line.
REM
set CYGWIN_BIN_DIR=c:\cygwin\bin
set LIBUSB_BUILD_DIR=c:\Work\SVNWorkspace\PDK\builds\libusbw64ddk
REM The following environment variable needs the "forward" slashes for Cygwin's dos2unix program
set LIBUSB_CVS_DIR=c:/Work/SVNWorkspace/PDK/builds/libusbw64ddk/libusb_src
REM
REM Login to CVS server (hit enter when prompted for password) and checkout the code (ignore .cvspass errors)
REM
cvs -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/libusb-win32 login
cvs -z3 -d:pserver:anonymous@cvs.sourceforge.net:/cvsroot/libusb-win32 co -P -d libusb_src -D 2006-04-25 libusb
REM Run Cygwin's dos2unix on the source files (to get them into Microsoft compiler readable form)
cd %CYGWIN_BIN_DIR%
dos2unix %LIBUSB_CVS_DIR%/src/*.c
dos2unix %LIBUSB_CVS_DIR%/src/*.h
dos2unix %LIBUSB_CVS_DIR%/src/driver/*.c
dos2unix %LIBUSB_CVS_DIR%/src/driver/*.h
cd %LIBUSB_BUILD_DIR%
REM
REM Next, clean the environment, build the libusb drivers, and make each program
REM
call make_clean.bat
call build_drivers.bat
call make_atodtst.bat amd64
call make_counter.bat amd64
call make_coupler.bat amd64
call make_debit.bat amd64
call make_debitvm.bat amd64
call make_fish.bat amd64
call make_gethumd.bat amd64
call make_humalog.bat amd64
call make_initcopr.bat amd64
call make_initcoprvm.bat amd64
call make_initrov.bat amd64
call make_initrovvm.bat amd64
call make_memutil.bat amd64
call make_mweather.bat amd64
call make_ps_check.bat amd64
call make_ps_init.bat amd64
call make_sha_chck.bat amd64
call make_sha_init.bat amd64
call make_shaapp.bat amd64
call make_swtduo.bat amd64
call make_swtloop.bat amd64
call make_swtmain1c.bat amd64
call make_swtmulti.bat amd64
call make_swtsngl.bat amd64
call make_temp.bat amd64
call make_thermodl.bat amd64
call make_thermoms.bat amd64
call make_tm_check.bat amd64
call make_tstfind.bat amd64
REM
REM Copy libusb API dll to the binary build directory
REM
copy .\Install\amd64\libusb0.dll .\amd64
REM
REM cleanup
REM
cd .\amd64
del *.pdb
cd ..
del *.log
del CONFIG.SYS
