Machine Interface Utility:VER1.0
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
@ECHO OFF
|
||||
:: Use this batch file instead of the winddk "build" command.
|
||||
::
|
||||
:: - Calls the winddk build command. Sets BUILD_ERRORLEVEL=1 if
|
||||
:: a build error is detected.
|
||||
:: - Sets LOG_APPNAME define (unless already set)
|
||||
:: - Sets libusb-win32 version defines (unless already set)
|
||||
::
|
||||
|
||||
IF "%LOG_APPNAME%"=="" SET LOG_APPNAME=$(TARGETNAME)
|
||||
SET COMMON_C_DEFINES=
|
||||
SET COMMON_C_DEFINES=%COMMON_C_DEFINES% /DLOG_APPNAME="\"$(LOG_APPNAME)\""
|
||||
IF DEFINED CMDVAR_LOG_DIRECTORY SET COMMON_C_DEFINES=%COMMON_C_DEFINES% /DLOG_DIRECTORY="\"$(CMDVAR_LOG_DIRECTORY)\""
|
||||
SET COMMON_C_DEFINES=%COMMON_C_DEFINES% %*
|
||||
|
||||
IF EXIST "build%BUILD_ALT_DIR%.err" DEL /Q "build%BUILD_ALT_DIR%.err" >NUL
|
||||
IF EXIST "build%BUILD_ALT_DIR%.wrn" DEL /Q "build%BUILD_ALT_DIR%.wrn" >NUL
|
||||
SET BUILD_ERRORLEVEL=0
|
||||
|
||||
if exist libusb0.lib move /Y libusb0.lib libusb.lib >NUL
|
||||
|
||||
build -cwgZ 2>NUL>NUL
|
||||
IF EXIST "build%BUILD_ALT_DIR%.err" TYPE "build%BUILD_ALT_DIR%.err"
|
||||
IF EXIST "build%BUILD_ALT_DIR%.wrn" TYPE "build%BUILD_ALT_DIR%.wrn"
|
||||
IF EXIST "build%BUILD_ALT_DIR%.err" SET BUILD_ERRORLEVEL=1
|
||||
IF EXIST "build%BUILD_ALT_DIR%.err" SET ERRORLEVEL=1
|
||||
|
||||
+142
@@ -0,0 +1,142 @@
|
||||
; LIBUSB-WIN32, Generic Windows USB Library
|
||||
; Copyright (c) 2002-2010 Stephan Meyer <ste_meyer@web.de>
|
||||
; Copyright (c) 2010 Travis Robinson <libusbdotnet@gmail.com>
|
||||
;
|
||||
; This program is free software; you can redistribute it and/or modify
|
||||
; it under the terms of the GNU General Public License as published by
|
||||
; the Free Software Foundation; either version 2 of the License, or
|
||||
; (at your option) any later version.
|
||||
;
|
||||
; This program is distributed in the hope that it will be useful,
|
||||
; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
; GNU General Public License for more details.
|
||||
;
|
||||
; You should have received a copy of the GNU General Public License
|
||||
; along with this program; if not, write to the Free Software
|
||||
; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
|
||||
|
||||
[Setup]
|
||||
AppName = LibUSB-Win32
|
||||
AppVerName = LibUSB-Win32-@VERSION@
|
||||
AppId = LibUSB-Win32
|
||||
AppPublisher = LibUSB-Win32
|
||||
AppPublisherURL = http://libusb-win32.sourceforge.net
|
||||
AppVersion = @VERSION@
|
||||
VersionInfoVersion = @VERSION@
|
||||
DefaultDirName = {pf}\LibUSB-Win32
|
||||
DefaultGroupName = LibUSB-Win32
|
||||
LicenseFile = installer_license.txt
|
||||
InfoBeforeFile = libusb-win32-changelog-@VERSION@.txt
|
||||
Compression = lzma
|
||||
SolidCompression = yes
|
||||
OutputDir = .
|
||||
OutputBaseFilename = @PCKGNAME@
|
||||
; requires Win2k, or higher
|
||||
MinVersion = 0, 5.0.2195
|
||||
PrivilegesRequired=admin
|
||||
|
||||
; "ArchitecturesInstallIn64BitMode=x64 ia64" requests that the install
|
||||
; be done in "64-bit mode" on x64 & Itanium, meaning it should use the
|
||||
; native 64-bit Program Files directory and the 64-bit view of the
|
||||
; registry. On all other architectures it will install in "32-bit mode".
|
||||
ArchitecturesInstallIn64BitMode=x64 ia64
|
||||
AllowNoIcons=yes
|
||||
|
||||
[Code]
|
||||
function IsX64: Boolean;
|
||||
begin
|
||||
Result := Is64BitInstallMode and (ProcessorArchitecture = paX64);
|
||||
end;
|
||||
|
||||
function IsI64: Boolean;
|
||||
begin
|
||||
Result := Is64BitInstallMode and (ProcessorArchitecture = paIA64);
|
||||
end;
|
||||
|
||||
function IsX86: Boolean;
|
||||
begin
|
||||
Result := not IsX64 and not IsI64;
|
||||
end;
|
||||
|
||||
function Is64: Boolean;
|
||||
begin
|
||||
Result := IsX64 or IsI64;
|
||||
end;
|
||||
|
||||
function IsNormalInstall: Boolean;
|
||||
begin
|
||||
Result := not IsTaskSelected('installmode_upgade');
|
||||
end;
|
||||
|
||||
[Files]
|
||||
; LibUsb-win32 x86 (Windows 2000/XP and greater)
|
||||
Source: @PACKAGE_BIN_DIR@x86\libusb0_x86.dll; DestName: libusb0.dll; DestDir: {sys}; Flags: uninsneveruninstall replacesameversion restartreplace promptifolder; Check: IsX86;
|
||||
Source: @PACKAGE_BIN_DIR@x86\libusb0.sys; DestDir: {sys}\drivers; Flags: uninsneveruninstall replacesameversion restartreplace promptifolder; Check: IsX86;
|
||||
Source: @PACKAGE_BIN_DIR@x86\install-filter.exe; DestDir: {app}\bin; Flags: ignoreversion; Check: IsX86;
|
||||
Source: @PACKAGE_BIN_DIR@x86\install-filter-win.exe; DestDir: {app}\bin; Flags: ignoreversion; Check: IsX86;
|
||||
Source: @PACKAGE_BIN_DIR@x86\testlibusb-win.exe; DestDir: {app}\bin; Flags: ignoreversion; Check: IsX86;
|
||||
Source: @PACKAGE_BIN_DIR@x86\testlibusb.exe; DestDir: {app}\bin; Flags: ignoreversion; Check: IsX86;
|
||||
|
||||
; LibUsb-win32 AMD 64bit
|
||||
Source: @PACKAGE_BIN_DIR@x86\libusb0_x86.dll; DestName: libusb0.dll; DestDir: {syswow64}; Flags: uninsneveruninstall replacesameversion restartreplace promptifolder; Check: IsX64;
|
||||
Source: @PACKAGE_BIN_DIR@amd64\libusb0.sys; DestDir: {sys}\drivers; Flags: uninsneveruninstall replacesameversion restartreplace promptifolder; Check: IsX64;
|
||||
Source: @PACKAGE_BIN_DIR@amd64\libusb0.dll; DestDir: {sys}; Flags: uninsneveruninstall replacesameversion restartreplace promptifolder; Check: IsX64;
|
||||
Source: @PACKAGE_BIN_DIR@amd64\install-filter.exe; DestDir: {app}\bin; Flags: ignoreversion; Check: IsX64;
|
||||
Source: @PACKAGE_BIN_DIR@amd64\install-filter-win.exe; DestDir: {app}\bin; Flags: ignoreversion; Check: IsX64;
|
||||
Source: @PACKAGE_BIN_DIR@amd64\testlibusb-win.exe; DestDir: {app}\bin; Flags: ignoreversion; Check: IsX64;
|
||||
Source: @PACKAGE_BIN_DIR@amd64\testlibusb.exe; DestDir: {app}\bin; Flags: ignoreversion; Check: IsX64;
|
||||
|
||||
; LibUsb-win32 Itanium 64bit
|
||||
Source: @PACKAGE_BIN_DIR@x86\libusb0_x86.dll; DestName: libusb0.dll; DestDir: {syswow64}; Flags: uninsneveruninstall replacesameversion restartreplace promptifolder; Check: IsI64;
|
||||
Source: @PACKAGE_BIN_DIR@ia64\libusb0.sys; DestDir: {sys}\drivers; Flags: uninsneveruninstall replacesameversion restartreplace promptifolder; Check: IsI64;
|
||||
Source: @PACKAGE_BIN_DIR@ia64\libusb0.dll; DestDir: {sys}; Flags: uninsneveruninstall replacesameversion restartreplace promptifolder; Check: IsI64;
|
||||
Source: @PACKAGE_BIN_DIR@ia64\install-filter.exe; DestDir: {app}\bin; Flags: ignoreversion; Check: IsI64;
|
||||
Source: @PACKAGE_BIN_DIR@ia64\install-filter-win.exe; DestDir: {app}\bin; Flags: ignoreversion; Check: IsI64;
|
||||
Source: @PACKAGE_BIN_DIR@ia64\testlibusb-win.exe; DestDir: {app}\bin; Flags: ignoreversion; Check: IsI64;
|
||||
Source: @PACKAGE_BIN_DIR@ia64\testlibusb.exe; DestDir: {app}\bin; Flags: ignoreversion; Check: IsI64;
|
||||
|
||||
;inf-wizard (x86 only)
|
||||
Source: @PACKAGE_BIN_DIR@inf-wizard.exe; DestDir: {app}\bin; Flags: ignoreversion;
|
||||
|
||||
Source: @LIBUSB_DIR@src\install-filter-help.txt; DestDir: {app}; Flags: ignoreversion;
|
||||
|
||||
; test applications(x86 runtimes for 64bit machines)
|
||||
Source: @PACKAGE_BIN_DIR@x86\testlibusb-win.exe; DestDir: {app}\bin\x86; Flags: ignoreversion; Check: Is64;
|
||||
Source: @PACKAGE_BIN_DIR@x86\testlibusb.exe; DestDir: {app}\bin\x86; Flags: ignoreversion; Check: Is64;
|
||||
|
||||
; Text, Licenses
|
||||
Source: *.txt; DestDir: {app}; Flags: ignoreversion;
|
||||
|
||||
; Test Certificate (This is only included in debug builds)
|
||||
Source: *.cer; DestDir: {app}; Flags: ignoreversion skipifsourcedoesntexist; Check: Is64;
|
||||
|
||||
; DebugView (This is only included in debug builds)
|
||||
Source: @PACKAGE_ROOT_DIR@additional\dbgview.*; DestDir: {app}\additional; Flags: ignoreversion skipifsourcedoesntexist;
|
||||
|
||||
[Icons]
|
||||
; these icons are only used in debug builds
|
||||
Name: "{group}\Libusb-Win32 Test Certificate"; Filename: {app}\LibusbWin32TestCert.cer; Flags: createonlyiffileexists;
|
||||
Name: "{group}\DebugView\DebugView"; Filename: {app}\additional\Dbgview.exe; Flags: createonlyiffileexists;
|
||||
Name: "{group}\DebugView\DebugView Help"; Filename: {app}\additional\dbgview.chm; Flags: createonlyiffileexists;
|
||||
|
||||
; libusb-win32 icons
|
||||
Name: "{group}\Test (Win) Program"; Filename: {app}\bin\testlibusb-win.exe;
|
||||
Name: "{group}\Inf Wizard"; Filename: {app}\bin\inf-wizard.exe;
|
||||
Name: "{group}\Filter Wizard"; Filename: {app}\bin\install-filter-win.exe;
|
||||
Name: "{group}\Filter Console Help"; Filename: {app}\install-filter-help.txt;
|
||||
Name: "{group}\Class Filter\Install all class filters"; Filename: {app}\bin\install-filter-win.exe; Parameters:"i -ac -p -w"; Comment: "Installs all libusb-win32 class filters."
|
||||
Name: "{group}\Class Filter\Remove all class filters"; Filename: {app}\bin\install-filter-win.exe; Parameters:"u -ac -w"; Comment: "Removes all libusb-win32 class filters."
|
||||
Name: "{group}\License\GPL License"; Filename: {app}\COPYING_GPL.txt;
|
||||
Name: "{group}\License\LGPL License"; Filename: {app}\COPYING_LGPL.txt;
|
||||
Name: "{group}\Uninstall LibUsb-Win32"; Filename: {uninstallexe};
|
||||
|
||||
[Run]
|
||||
Filename: "{app}\bin\install-filter-win.exe"; Description: "Launch filter installer wizard"; Flags: postinstall nowait runascurrentuser; Check: not WizardNoIcons;
|
||||
|
||||
[UninstallRun]
|
||||
Filename: "rundll32.exe"; RunOnceID:"FilterAllDeviceClasses"; Parameters: "libusb0,usb_install_np_rundll u -ac";
|
||||
|
||||
[Messages]
|
||||
StatusUninstalling=Uninstalling %1 and removing all class filters..
|
||||
@@ -0,0 +1,110 @@
|
||||
; oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
|
||||
; LIBUSB-WIN32 WINDDK MAKE CONFIGURATION FILE
|
||||
; Travis Robinson (libusbdotnet@gmail.com)
|
||||
;
|
||||
; NOTE: param/values passed into make.cmd will override these values
|
||||
; NOTE: destination directories are automatically created
|
||||
; oooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo
|
||||
|
||||
;
|
||||
; Sets the libusb-win32 build version
|
||||
;
|
||||
VERSION_MAJOR=1
|
||||
VERSION_MINOR=2
|
||||
VERSION_MICRO=4
|
||||
VERSION_NANO=0
|
||||
|
||||
;
|
||||
; The libusb-win32 version string.
|
||||
; (Should not be changed)
|
||||
VERSION=!VERSION_MAJOR!.!VERSION_MINOR!.!VERSION_MICRO!.!VERSION_NANO!
|
||||
|
||||
;
|
||||
; Default WinDDK directory(s) Adjust these values to match your environment
|
||||
; (REQUIRED)
|
||||
WINDDK_BASE=Z:\WinDDK
|
||||
WINDDK_DIR=!WINDDK_BASE!\6001.18002\
|
||||
;
|
||||
; (optional)
|
||||
WINDDK_W2K_DIR=!WINDDK_BASE!\6001.18002\
|
||||
|
||||
;
|
||||
LIBWDI_DIR=..\projects\additional\libwdi\
|
||||
;
|
||||
; Default build app (forced to all when packaging)
|
||||
; (optional)
|
||||
APP=all
|
||||
|
||||
;
|
||||
; Whether or not to use microsofts OACR
|
||||
; (http://msdn.microsoft.com/en-us/library/ff549179%28v=VS.85%29.aspx)
|
||||
;
|
||||
WINDDK_AUTOCODEREVIEW=true
|
||||
|
||||
; ## PACKAGING ONLY
|
||||
; The variables below are only used when packaging. IE: dist, snapshot
|
||||
; (package directories must NOT reside in the libusb-win32 trunk)
|
||||
;
|
||||
; Additional libusb-win32 content is placed here
|
||||
PACKAGE_ROOT_DIR=Z:\packages\libusb-win32\
|
||||
|
||||
; Binaries are placed here (exe,sys,dll)
|
||||
PACKAGE_BIN_DIR=!PACKAGE_ROOT_DIR!bin\
|
||||
;
|
||||
; Libraries are placed here (lib,la)
|
||||
PACKAGE_LIB_DIR=!PACKAGE_ROOT_DIR!lib\
|
||||
;
|
||||
; Distributables and snapshots are placed here
|
||||
PACKAGE_SAVE_DIR=!PACKAGE_ROOT_DIR!package\
|
||||
;
|
||||
; Temporary packaging directory (WARNING: this directory is destroyed/created.)
|
||||
PACKAGE_WORKING=!PACKAGE_ROOT_DIR!_working\
|
||||
;
|
||||
;
|
||||
; Base bin, src, setup package name (version/snapshotid is appended)
|
||||
PACKAGE_BIN_NAME=libusb-win32-bin
|
||||
PACKAGE_SRC_NAME=libusb-win32-src
|
||||
PACKAGE_SETUP_NAME=libusb-win32-devel-filter
|
||||
|
||||
;
|
||||
; Path to 7Zip (http://www.7-zip.org/)
|
||||
; (optional)
|
||||
ZIP=C:\Program Files\7-Zip\7z.exe
|
||||
|
||||
;
|
||||
; Path to Inno Setup Compiler (http://www.jrsoftware.org/isdl.php)
|
||||
ISCC=C:\Program Files (x86)\Inno Setup 5\ISCC.exe
|
||||
|
||||
;
|
||||
; Path to borland c implib tool (http://downloads.embarcadero.com/free/c_builder)
|
||||
; (optional)
|
||||
IMPLIB=C:\Borland\BCC55\Bin\implib.exe
|
||||
|
||||
;
|
||||
; Path to gcc dlltool tool (http://www.mingw.org/)
|
||||
; (optional)
|
||||
DLLTOOL=C:\MinGW\bin\dlltool.exe
|
||||
|
||||
;
|
||||
; Filename (only) of the digital test certificate to use for signing
|
||||
; when the "testsigning=on" argument is used. make.cmd looks for this
|
||||
; file in the !PACKAGE_ROOT_DIR!\cert directory. If the cert file does
|
||||
; not exists is is created and used for subsequent signing requests.
|
||||
; (optional)
|
||||
CERT_FILE=LibusbWin32TestCert.cer
|
||||
|
||||
; The directory where all log files are placed.
|
||||
; File logging is disabled by default (see make.cmd help for more information)
|
||||
; (Consider using DebugView instead of file logging)
|
||||
; http://download.sysinternals.com/Files/DebugView.zip
|
||||
; (optional)
|
||||
;LOG_DIRECTORY=!SystemDrive!\\\\Log\\\\
|
||||
|
||||
|
||||
;
|
||||
; Month, day, year, and snapshot id variables
|
||||
; (Should not be changed)
|
||||
_MM_=!DATE:~4,2!
|
||||
_DD_=!DATE:~7,2!
|
||||
_YYYY_=!DATE:~10,4!
|
||||
SNAPSHOT_ID=!_YYYY_!!_MM_!!_DD_!
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,29 @@
|
||||
@echo off
|
||||
call make_clean.bat
|
||||
SET ERRORLEVEL=0
|
||||
|
||||
call make_dll.bat %*
|
||||
IF NOT %ERRORLEVEL%==0 GOTO BUILD_ERROR
|
||||
call make_driver.bat %*
|
||||
IF NOT %ERRORLEVEL%==0 GOTO BUILD_ERROR
|
||||
call make_test.bat %*
|
||||
IF NOT %ERRORLEVEL%==0 GOTO BUILD_ERROR
|
||||
call make_test_win.bat %*
|
||||
IF NOT %ERRORLEVEL%==0 GOTO BUILD_ERROR
|
||||
call make_install_filter.bat %*
|
||||
IF NOT %ERRORLEVEL%==0 GOTO BUILD_ERROR
|
||||
call make_install_filter_win.bat %*
|
||||
IF NOT %ERRORLEVEL%==0 GOTO BUILD_ERROR
|
||||
|
||||
REM DDK builkdInf-Wizard embeds drivers for multiple
|
||||
REM platforms and can no longer be here.
|
||||
REM
|
||||
REM call make_inf_wizard.bat %*
|
||||
REM IF NOT %ERRORLEVEL%==0 GOTO INF_BUILD_ERROR
|
||||
|
||||
GOTO DONE
|
||||
|
||||
:BUILD_ERROR
|
||||
GOTO DONE
|
||||
|
||||
:DONE
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
@echo off
|
||||
|
||||
set OUTDIR=
|
||||
|
||||
if exist .\output\i386 set OUTDIR=.\output\i386
|
||||
if exist .\output\amd64 set OUTDIR=.\output\amd64
|
||||
if exist .\output\ia64 set OUTDIR=.\output\ia64
|
||||
|
||||
if "%OUTDIR%"=="" GOTO NO_OUTDIR
|
||||
if exist %OUTDIR%\*.exe copy /y %OUTDIR%\*.exe . >NUL
|
||||
if exist %OUTDIR%\*.dll copy /y %OUTDIR%\*.dll . >NUL
|
||||
if exist %OUTDIR%\*.lib copy /y %OUTDIR%\*.lib . >NUL
|
||||
if exist %OUTDIR%\*.sys copy /y %OUTDIR%\*.sys . >NUL
|
||||
:NO_OUTDIR
|
||||
|
||||
if exist .\output rmdir /s /q .\output
|
||||
|
||||
if exist .\objchk_wxp_x86 rmdir /s /q .\objchk_wxp_x86
|
||||
if exist .\objchk_wnet_AMD64 rmdir /s /q .\objchk_wnet_AMD64
|
||||
if exist .\objchk_wnet_IA64 rmdir /s /q .\objchk_wnet_IA64
|
||||
if exist .\objchk_wxp_ia64 rmdir /s /q .\objchk_wxp_ia64
|
||||
if exist .\objchk_w2k_x86 rmdir /s /q .\objchk_w2k_x86
|
||||
|
||||
if exist .\objfre_wxp_x86 rmdir /s /q .\objfre_wxp_x86
|
||||
if exist .\objfre_wnet_AMD64 rmdir /s /q .\objfre_wnet_AMD64
|
||||
if exist .\objfre_wnet_IA64 rmdir /s /q .\objfre_wnet_IA64
|
||||
if exist .\objfre_wxp_ia64 rmdir /s /q .\objfre_wxp_ia64
|
||||
if exist .\objfre_w2k_x86 rmdir /s /q .\objfre_w2k_x86
|
||||
|
||||
if exist sources del /q sources
|
||||
if exist *.def del *.def
|
||||
if exist *.h del *.h
|
||||
if exist *.c del *.c
|
||||
if exist *.rc del *.rc
|
||||
if exist manifest_*.xml del /q manifest_*.xml
|
||||
if exist install-filter*.txt del /q install-filter*.txt
|
||||
DEL /Q "..\*.o" "..\*.dll" "..\*.a" "..\*.exp" "..\*.lib" "..\*.exe" 2>NUL>NUL
|
||||
DEL /Q "..\*.tar.gz" "..\*.iss" "..\*.rc" "..\*.h" "..\*.sys" "..\*.log" 2>NUL>NUL
|
||||
DEL /Q /S "..\*~" 2>NUL>NUL
|
||||
DEL /Q "..\README.txt" 2>NUL>NUL
|
||||
@@ -0,0 +1,26 @@
|
||||
@echo off
|
||||
|
||||
set SRC_DIR=..\src
|
||||
|
||||
call make_clean.bat
|
||||
|
||||
copy sources_dll sources >NUL
|
||||
|
||||
copy %SRC_DIR%\*.c . >NUL
|
||||
copy ..\*.def . >NUL
|
||||
copy %SRC_DIR%\*.h . >NUL
|
||||
copy %SRC_DIR%\*.rc . >NUL
|
||||
copy %SRC_DIR%\driver\driver_api.h . >NUL
|
||||
|
||||
ECHO Building (%BUILD_ALT_DIR%) %0..
|
||||
CALL build_ddk.bat %*
|
||||
IF %BUILD_ERRORLEVEL%==0 GOTO BUILD_SUCCESS
|
||||
GOTO BUILD_ERROR
|
||||
|
||||
:BUILD_ERROR
|
||||
ECHO [%0] WinDDK build failed (%BUILD_ALT_DIR%)
|
||||
EXIT /B 1
|
||||
|
||||
:BUILD_SUCCESS
|
||||
if exist libusb0.lib move /Y libusb0.lib libusb.lib >NUL
|
||||
:BUILD_DONE
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
@echo off
|
||||
|
||||
set SRC_DIR=..\src\driver
|
||||
|
||||
call make_clean.bat
|
||||
|
||||
copy sources_drv sources >NUL
|
||||
|
||||
copy %SRC_DIR%\*.c . >NUL
|
||||
copy %SRC_DIR%\*.h . >NUL
|
||||
copy %SRC_DIR%\*.rc . >NUL
|
||||
copy %SRC_DIR%\..\*.rc . >NUL
|
||||
copy %SRC_DIR%\..\libusb-win32_version.h . >NUL
|
||||
copy %SRC_DIR%\..\error.? . >NUL
|
||||
|
||||
ECHO Building (%BUILD_ALT_DIR%) %0..
|
||||
CALL build_ddk.bat %*
|
||||
IF %BUILD_ERRORLEVEL%==0 GOTO BUILD_SUCCESS
|
||||
GOTO BUILD_ERROR
|
||||
|
||||
:BUILD_ERROR
|
||||
ECHO [%0] WinDDK build failed (%BUILD_ALT_DIR%)
|
||||
EXIT /B 1
|
||||
|
||||
:BUILD_SUCCESS
|
||||
|
||||
:BUILD_DONE
|
||||
+94
@@ -0,0 +1,94 @@
|
||||
@ECHO OFF
|
||||
SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
|
||||
|
||||
SET TESTS_DIR=..\tests
|
||||
SET SRC_DIR=..\src
|
||||
call make_clean.bat
|
||||
|
||||
:: Check arguments
|
||||
::
|
||||
|
||||
IF "!LIBWDI_DIR!" EQU "" SET LIBWDI_DIR=..\projects\additional\libwdi\
|
||||
|
||||
:: Check for libwdi ddk_build.cmd
|
||||
::
|
||||
IF NOT EXIST "!LIBWDI_DIR!\ddk_build.cmd" (
|
||||
ECHO libwdi ddk_build.cmd not found at '!LIBWDI_DIR!'
|
||||
GOTO SHOW_LIBWDI_HELP
|
||||
)
|
||||
|
||||
:: Build libwdi
|
||||
::
|
||||
SET BUILD_ERRORLEVEL=0
|
||||
SET _CD_=!CD!
|
||||
PUSHD !_CD_!
|
||||
|
||||
CD /D "!LIBWDI_DIR!"
|
||||
IF EXIST "build%BUILD_ALT_DIR%.err" DEL /Q "build%BUILD_ALT_DIR%.err" >NUL
|
||||
IF EXIST "build%BUILD_ALT_DIR%.wrn" DEL /Q "build%BUILD_ALT_DIR%.wrn" >NUL
|
||||
|
||||
IF EXIST "!LIBUSB0_DIR!" (
|
||||
SET C_DEFINES=/DLIBUSB0_DIR=\"!LIBUSB0_DIR!\" /DOPT_M32 /DOPT_M64 /DOPT_IA64
|
||||
) ELSE (
|
||||
ECHO.
|
||||
ECHO [Warning] The LIBUSB0_DIR environment variable has not been set. This
|
||||
ECHO inf-wizard will contain only the inf generator and not
|
||||
ECHO embedded libusb-win32 binaries.
|
||||
ECHO.
|
||||
ECHO '!LIBUSB0_DIR!'
|
||||
SET C_DEFINES=/DUSER_DIR=\"\" /DOPT_M32 /DOPT_M64
|
||||
)
|
||||
ECHO Building (%BUILD_ALT_DIR%) libwdi..
|
||||
CALL ddk_build.cmd no_samples 2>NUL
|
||||
|
||||
IF EXIST "build%BUILD_ALT_DIR%.err" SET BUILD_ERRORLEVEL=1
|
||||
IF EXIST "build%BUILD_ALT_DIR%.err" SET ERRORLEVEL=1
|
||||
IF !BUILD_ERRORLEVEL! NEQ 0 (
|
||||
|
||||
ECHO Failed building libwdi.
|
||||
GOTO BUILD_ERROR
|
||||
)
|
||||
|
||||
POPD
|
||||
|
||||
::
|
||||
:: Copy in the inf-wizard sources
|
||||
COPY /Y "!LIBWDI_DIR!\libwdi\libwdi.lib" >NUL
|
||||
COPY /Y "!LIBWDI_DIR!\libwdi\libwdi.h" >NUL
|
||||
COPY /Y "!LIBWDI_DIR!\libwdi\msapi_utf8.h" >NUL
|
||||
COPY /Y sources_inf_wizard sources >NUL
|
||||
COPY /Y %SRC_DIR%\inf_wizard*.* >NUL
|
||||
COPY /Y %SRC_DIR%\libusb-win32_version.* >NUL
|
||||
copy %SRC_DIR%\*.manifest . >NUL
|
||||
|
||||
ECHO Building (%BUILD_ALT_DIR%) %0..
|
||||
CALL build_ddk.bat !_ARGS_!
|
||||
IF %BUILD_ERRORLEVEL%==0 GOTO BUILD_SUCCESS
|
||||
GOTO BUILD_ERROR
|
||||
|
||||
:BUILD_ERROR
|
||||
ECHO [%0] WinDDK build failed (%BUILD_ALT_DIR%)
|
||||
EXIT /B 1
|
||||
GOTO BUILD_DONE
|
||||
|
||||
:SHOW_LIBWDI_HELP
|
||||
ECHO.
|
||||
ECHO inf-wizard-libusb-win32 WinDDK build utility
|
||||
ECHO.
|
||||
ECHO Summary: This batch script automates the inf-wizard WinDDK build process
|
||||
ECHO and creates inf-wizard with embedded binaries.
|
||||
ECHO.
|
||||
ECHO NOTE : This batch script must be run from a x86 windkk build environment.
|
||||
ECHO.
|
||||
ECHO USAGE EXAMPLE:
|
||||
ECHO
|
||||
ECHO example #1.
|
||||
ECHO SET LIBUSB0_DIR=Z:\packages\libusb-win32\
|
||||
ECHO make_inf_wizard.bat
|
||||
ECHO.
|
||||
GOTO BUILD_DONE
|
||||
|
||||
:BUILD_SUCCESS
|
||||
GOTO BUILD_DONE
|
||||
|
||||
:BUILD_DONE
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
@echo off
|
||||
set TESTS_DIR=..\tests
|
||||
set SRC_DIR=..\src
|
||||
|
||||
call make_clean.bat
|
||||
|
||||
copy sources_install_filter sources >NUL
|
||||
copy %SRC_DIR%\*.c . >NUL
|
||||
copy %SRC_DIR%\*.h . >NUL
|
||||
copy %SRC_DIR%\*.rc . >NUL
|
||||
copy %SRC_DIR%\driver\driver_api.h . >NUL
|
||||
copy %SRC_DIR%\install-filter*.* . >NUL
|
||||
copy ..\manifest.txt . >NUL
|
||||
|
||||
ECHO Building (%BUILD_ALT_DIR%) %0..
|
||||
CALL build_ddk.bat %*
|
||||
IF %BUILD_ERRORLEVEL%==0 GOTO BUILD_SUCCESS
|
||||
GOTO BUILD_ERROR
|
||||
|
||||
:BUILD_ERROR
|
||||
ECHO [%0] WinDDK build failed (%BUILD_ALT_DIR%)
|
||||
EXIT /B 1
|
||||
|
||||
:BUILD_SUCCESS
|
||||
|
||||
:BUILD_DONE
|
||||
+26
@@ -0,0 +1,26 @@
|
||||
@echo off
|
||||
set TESTS_DIR=..\tests
|
||||
set SRC_DIR=..\src
|
||||
|
||||
call make_clean.bat
|
||||
|
||||
copy sources_install_filter_win sources >NUL
|
||||
copy %SRC_DIR%\*.c . >NUL
|
||||
copy %SRC_DIR%\*.h . >NUL
|
||||
copy %SRC_DIR%\*.rc . >NUL
|
||||
copy %SRC_DIR%\driver\driver_api.h . >NUL
|
||||
copy %SRC_DIR%\install_filter_win.* . >NUL
|
||||
copy %SRC_DIR%\common_controls_admin.manifest . >NUL
|
||||
|
||||
ECHO Building (%BUILD_ALT_DIR%) %0..
|
||||
CALL build_ddk.bat %*
|
||||
IF %BUILD_ERRORLEVEL%==0 GOTO BUILD_SUCCESS
|
||||
GOTO BUILD_ERROR
|
||||
|
||||
:BUILD_ERROR
|
||||
ECHO [%0] WinDDK build failed (%BUILD_ALT_DIR%)
|
||||
EXIT /B 1
|
||||
|
||||
:BUILD_SUCCESS
|
||||
|
||||
:BUILD_DONE
|
||||
+51
@@ -0,0 +1,51 @@
|
||||
@echo off
|
||||
|
||||
call make_clean.bat
|
||||
DEL /Q *.exe *.dll *.sys *.lib *.log *.wrn *.err *.cer *.manifest *.ico ..\*.inf.in 2>NUL>NUL
|
||||
|
||||
if exist .\x86 rmdir /s /q .\x86
|
||||
if exist .\x64 rmdir /s /q .\x64
|
||||
if exist .\AMD64 rmdir /s /q .\AMD64
|
||||
if exist .\i64 rmdir /s /q .\i64
|
||||
if exist .\w2k rmdir /s /q .\w2k
|
||||
|
||||
IF NOT EXIST ..\projects\ GOTO DONE
|
||||
|
||||
PUSHD !CD!
|
||||
CD ..\projects
|
||||
RMDIR /S /Q .\Debug 2>NUL>NUL
|
||||
RMDIR /S /Q .\Release 2>NUL>NUL
|
||||
RMDIR /S /Q .\Win32 2>NUL>NUL
|
||||
RMDIR /S /Q .\x64 2>NUL>NUL
|
||||
RMDIR /S /Q .\_ReSharper.libusb-win32 2>NUL>NUL
|
||||
|
||||
DEL /S /Q *.gitignore *.log *.user *.ncb *.resharper 2>NUL>NUL
|
||||
DEL /S /Q /AH *.suo 2>NUL>NUL
|
||||
DEL /S /Q .\additional\libwdi\*.exe 2>NUL>NUL
|
||||
DEL /S /Q .\additional\libwdi\*.lib 2>NUL>NUL
|
||||
|
||||
RMDIR /S /Q .\additional\libwdi\libwdi\objfre_wxp_x86 2>NUL>NUL
|
||||
RMDIR /S /Q .\additional\libwdi\libwdi\objchk_wxp_x86 2>NUL>NUL
|
||||
RMDIR /S /Q .\additional\libwdi\libwdi\objfre_wxp_amd64 2>NUL>NUL
|
||||
RMDIR /S /Q .\additional\libwdi\libwdi\objchk_wxp_amd64 2>NUL>NUL
|
||||
RMDIR /S /Q .\additional\libwdi\libwdi\objfre_w2k_x86 2>NUL>NUL
|
||||
RMDIR /S /Q .\additional\libwdi\libwdi\objchk_w2k_x86 2>NUL>NUL
|
||||
RMDIR /S /Q .\additional\libwdi\libwdi\objfre_w2k_amd64 2>NUL>NUL
|
||||
RMDIR /S /Q .\additional\libwdi\libwdi\objchk_w2k_amd64 2>NUL>NUL
|
||||
RMDIR /S /Q .\additional\libwdi\Win32 2>NUL>NUL
|
||||
RMDIR /S /Q .\additional\libwdi\x64 2>NUL>NUL
|
||||
RMDIR /S /Q .\additional\libwdi\examples\objfre_wxp_x86 2>NUL>NUL
|
||||
RMDIR /S /Q .\additional\libwdi\examples\objchk_wxp_x86 2>NUL>NUL
|
||||
RMDIR /S /Q .\additional\libwdi\examples\objfre_wxp_w2k 2>NUL>NUL
|
||||
RMDIR /S /Q .\additional\libwdi\examples\objchk_wxp_w2k 2>NUL>NUL
|
||||
|
||||
DEL .\additional\libwdi\libwdi\embedded.h 2>NUL>NUL
|
||||
DEL .\additional\libwdi\libwdi\config.h 2>NUL>NUL
|
||||
DEL /S /Q .\additional\libwdi\*.o 2>NUL>NUL
|
||||
RMDIR /S /Q ".\Win32" 2>NUL>NUL
|
||||
RMDIR /S /Q ".\x64" 2>NUL>NUL
|
||||
POPD
|
||||
|
||||
:DONE
|
||||
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
@echo off
|
||||
|
||||
set TESTS_DIR=..\tests
|
||||
set SRC_DIR=..\src
|
||||
|
||||
call make_clean.bat
|
||||
|
||||
copy sources_test sources >NUL
|
||||
copy %TESTS_DIR%\testlibusb.c . >NUL
|
||||
copy %SRC_DIR%\usb.h . >NUL
|
||||
copy %SRC_DIR%\*.rc . >NUL
|
||||
|
||||
ECHO Building (%BUILD_ALT_DIR%) %0..
|
||||
CALL build_ddk.bat %*
|
||||
IF %BUILD_ERRORLEVEL%==0 GOTO BUILD_SUCCESS
|
||||
GOTO BUILD_ERROR
|
||||
|
||||
:BUILD_ERROR
|
||||
ECHO [%0] WinDDK build failed (%BUILD_ALT_DIR%)
|
||||
EXIT /B 1
|
||||
|
||||
:BUILD_SUCCESS
|
||||
|
||||
:BUILD_DONE
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
@echo off
|
||||
|
||||
set TESTS_DIR=..\tests
|
||||
set SRC_DIR=..\src
|
||||
|
||||
call make_clean.bat
|
||||
|
||||
copy sources_test_win sources >NUL
|
||||
copy %TESTS_DIR%\testlibusb_win.c . >NUL
|
||||
copy %TESTS_DIR%\testlibusb_win_rc.rc . >NUL
|
||||
copy %SRC_DIR%\usb.h . >NUL
|
||||
copy %SRC_DIR%\libusb-win32_version.h . >NUL
|
||||
copy %SRC_DIR%\*.rc . >NUL
|
||||
copy %SRC_DIR%\*.manifest . >NUL
|
||||
|
||||
ECHO Building (%BUILD_ALT_DIR%) %0..
|
||||
CALL build_ddk.bat %*
|
||||
IF %BUILD_ERRORLEVEL%==0 GOTO BUILD_SUCCESS
|
||||
GOTO BUILD_ERROR
|
||||
|
||||
:BUILD_ERROR
|
||||
ECHO [%0] WinDDK build failed (%BUILD_ALT_DIR%)
|
||||
EXIT /B 1
|
||||
|
||||
:BUILD_SUCCESS
|
||||
|
||||
:BUILD_DONE
|
||||
@@ -0,0 +1 @@
|
||||
!INCLUDE $(NTMAKEENV)\makefile.def
|
||||
@@ -0,0 +1,18 @@
|
||||
TARGETNAME = libusb0
|
||||
TARGETPATH = output
|
||||
TARGETTYPE = DYNLINK
|
||||
USE_MSVCRT = 1
|
||||
386_STDCALL = 0
|
||||
USER_C_FLAGS = /Gd /O2
|
||||
C_DEFINES = $(COMMON_C_DEFINES) /Dwcsicmp=_wcsicmp /Dstricmp=_stricmp /DTARGETTYPE=DYNLINK /DLOG_APPNAME="\"$(TARGETNAME)-dll\""
|
||||
|
||||
TARGETLIBS = $(SDK_LIB_PATH)\setupapi.lib \
|
||||
$(SDK_LIB_PATH)\kernel32.lib \
|
||||
$(SDK_LIB_PATH)\advapi32.lib \
|
||||
$(SDK_LIB_PATH)\user32.lib \
|
||||
$(SDK_LIB_PATH)\gdi32.lib
|
||||
|
||||
INCLUDES=$(INCLUDES);$(DDK_INC_PATH);
|
||||
|
||||
SOURCES = windows.c usb.c error.c install.c descriptors.c registry.c \
|
||||
resource.rc
|
||||
@@ -0,0 +1,36 @@
|
||||
TARGETNAME = libusb0
|
||||
TARGETPATH = output
|
||||
TARGETTYPE = DRIVER
|
||||
USER_C_FLAGS = /O2
|
||||
|
||||
C_DEFINES = $(COMMON_C_DEFINES) /DTARGETTYPE=DRIVER /DLOG_APPNAME="\"$(TARGETNAME)-sys\""
|
||||
|
||||
TARGETLIBS = $(DDK_LIB_PATH)\usbd.lib
|
||||
|
||||
SOURCES = abort_endpoint.c \
|
||||
claim_interface.c \
|
||||
clear_feature.c \
|
||||
dispatch.c \
|
||||
driver_registry.c \
|
||||
get_configuration.c \
|
||||
get_descriptor.c \
|
||||
get_interface.c \
|
||||
get_status.c \
|
||||
ioctl.c \
|
||||
libusb_driver.c \
|
||||
pnp.c \
|
||||
power.c \
|
||||
release_interface.c \
|
||||
reset_device.c \
|
||||
reset_endpoint.c \
|
||||
set_configuration.c \
|
||||
set_descriptor.c \
|
||||
set_feature.c \
|
||||
set_interface.c \
|
||||
transfer.c \
|
||||
vendor_request.c \
|
||||
error.c \
|
||||
libusb_driver_rc.rc
|
||||
|
||||
|
||||
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
TARGETNAME = inf-wizard
|
||||
TARGETPATH = output
|
||||
TARGETTYPE = PROGRAM
|
||||
UMTYPE = windows
|
||||
UMENTRY = winmain
|
||||
USE_MSVCRT = 1
|
||||
386_STDCALL = 0
|
||||
USER_C_FLAGS = /Gd /O2
|
||||
C_DEFINES = $(COMMON_C_DEFINES) /Dstricmp=_stricmp /DTARGETTYPE=PROGRAMwindows /DLOG_APPNAME="\"$(TARGETNAME)\""
|
||||
|
||||
TARGETLIBS = $(SDK_LIB_PATH)\setupapi.lib \
|
||||
$(SDK_LIB_PATH)\kernel32.lib \
|
||||
$(SDK_LIB_PATH)\user32.lib \
|
||||
$(SDK_LIB_PATH)\comctl32.lib \
|
||||
$(SDK_LIB_PATH)\comdlg32.lib \
|
||||
$(SDK_LIB_PATH)\shell32.lib \
|
||||
$(SDK_LIB_PATH)\ole32.lib \
|
||||
libwdi.lib
|
||||
|
||||
SOURCES = inf_wizard.c inf_wizard_rc.rc
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
TARGETNAME = install-filter
|
||||
TARGETPATH = output
|
||||
TARGETTYPE = PROGRAM
|
||||
UMTYPE = console
|
||||
USE_MSVCRT = 1
|
||||
386_STDCALL = 0
|
||||
USER_C_FLAGS = /Gd /O2
|
||||
C_DEFINES = $(COMMON_C_DEFINES) /DLOG_STYLE_SHORT /DTARGETTYPE=PROGRAMconsole /DLOG_APPNAME="\"$(TARGETNAME)\""
|
||||
|
||||
TARGETLIBS = $(SDK_LIB_PATH)\setupapi.lib \
|
||||
$(SDK_LIB_PATH)\kernel32.lib \
|
||||
$(SDK_LIB_PATH)\advapi32.lib \
|
||||
$(SDK_LIB_PATH)\user32.lib \
|
||||
$(SDK_LIB_PATH)\gdi32.lib
|
||||
|
||||
INCLUDES=$(INCLUDES);$(DDK_INC_PATH);
|
||||
|
||||
SOURCES = install_filter.c install.c registry.c error.c install_filter_rc.rc
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
TARGETNAME = install-filter-win
|
||||
TARGETPATH = output
|
||||
TARGETTYPE = PROGRAM
|
||||
UMTYPE = windows
|
||||
UMENTRY = winmain
|
||||
USE_MSVCRT = 1
|
||||
386_STDCALL = 0
|
||||
USER_C_FLAGS = /Gd /O2
|
||||
C_DEFINES = $(COMMON_C_DEFINES) /Dstricmp=_stricmp /DTARGETTYPE=PROGRAMwindows /DLOG_APPNAME="\"$(TARGETNAME)\""
|
||||
|
||||
TARGETLIBS = $(SDK_LIB_PATH)\setupapi.lib \
|
||||
$(SDK_LIB_PATH)\kernel32.lib \
|
||||
$(SDK_LIB_PATH)\advapi32.lib \
|
||||
$(SDK_LIB_PATH)\user32.lib \
|
||||
$(SDK_LIB_PATH)\comctl32.lib \
|
||||
$(SDK_LIB_PATH)\comdlg32.lib \
|
||||
$(SDK_LIB_PATH)\shell32.lib \
|
||||
$(SDK_LIB_PATH)\ole32.lib
|
||||
|
||||
INCLUDES=$(INCLUDES);$(DDK_INC_PATH);
|
||||
|
||||
SOURCES = install_filter_win.c install.c registry.c error.c install_filter_win_rc.rc
|
||||
@@ -0,0 +1,17 @@
|
||||
TARGETNAME = testlibusb
|
||||
TARGETPATH = output
|
||||
TARGETTYPE = PROGRAM
|
||||
UMTYPE = console
|
||||
USE_MSVCRT = 1
|
||||
386_STDCALL = 0
|
||||
USER_C_FLAGS = /Gd /O2
|
||||
C_DEFINES = $(COMMON_C_DEFINES) /Dsnprintf=_snprintf /DTARGETTYPE=PROGRAMconsole \
|
||||
/DLOG_APPNAME="\"$(TARGETNAME)\""
|
||||
|
||||
TARGETLIBS = $(SDK_LIB_PATH)\setupapi.lib \
|
||||
$(SDK_LIB_PATH)\kernel32.lib \
|
||||
$(SDK_LIB_PATH)\advapi32.lib \
|
||||
$(SDK_LIB_PATH)\user32.lib \
|
||||
libusb.lib
|
||||
|
||||
SOURCES = testlibusb.c
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
TARGETNAME = testlibusb-win
|
||||
TARGETPATH = output
|
||||
TARGETTYPE = PROGRAM
|
||||
UMTYPE = windows
|
||||
UMENTRY = winmain
|
||||
USE_MSVCRT = 1
|
||||
386_STDCALL = 0
|
||||
USER_C_FLAGS = /Gd /O2
|
||||
C_DEFINES = $(COMMON_C_DEFINES) /Dvsnprintf=_vsnprintf /DTARGETTYPE=PROGRAMwindows /DLOG_APPNAME="\"$(TARGETNAME)\""
|
||||
|
||||
TARGETLIBS = $(SDK_LIB_PATH)\setupapi.lib \
|
||||
$(SDK_LIB_PATH)\kernel32.lib \
|
||||
$(SDK_LIB_PATH)\advapi32.lib \
|
||||
$(SDK_LIB_PATH)\user32.lib \
|
||||
libusb.lib
|
||||
|
||||
SOURCES = testlibusb_win.c testlibusb_win_rc.rc
|
||||
Reference in New Issue
Block a user