summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPete Batard <pbatard>2010-03-29 15:41:22 +0100
committerPete Batard <pbatard>2010-03-29 15:41:22 +0100
commit99587b5e2d51a5084ac5d42b5da67c6701b80f87 (patch)
tree270c72b8b0cbee74703fdc2117016db6ccc157cd
parentdb8c3ff754977a44b9d1b46314ad842a0f20ef0d (diff)
downloadlibusb-r230.tar.gz
ddk_build improvements (DLL option, static lib default)r230
-rw-r--r--INSTALL_WIN.txt8
-rw-r--r--ddk_build.cmd12
-rw-r--r--examples/lsusb_sources3
-rw-r--r--examples/xusb_sources3
-rw-r--r--libusb/os/libusb_sources (renamed from libusb/os/sources)2
5 files changed, 23 insertions, 5 deletions
diff --git a/INSTALL_WIN.txt b/INSTALL_WIN.txt
index a541e7e..6e9359b 100644
--- a/INSTALL_WIN.txt
+++ b/INSTALL_WIN.txt
@@ -14,16 +14,16 @@ If you are using Microsoft Visual Studio:
Note that if you are using Visual Studio Express, you will not be able to
compile the 64 bit version of the library.
-If you are using the freely available Windows DDK (Driver Development Kit)
+If you are using the freely available Windows DDK/WDK (Driver Development Kit)
- If you want to debug the library, uncomment the ENABLE_DEBUG_LOGGING define
in config.h
- Open one of the relevant Free Build or Checked Build prompt for your target
platform
-- Navigate to the directory where the source is located and run ddk_build.cmd
+- Navigate to the directory where the source is located and run 'ddk_build'
+- To produce a DLL rather than a static library, use: 'ddk_build DLL'
Note that using the Windows DDK, it is possible to compile both the 32 and 64
-bit versions of the library. The DDK build is currently set to produce only the
-DLL however.
+bit versions of the library.
Destination directories
diff --git a/ddk_build.cmd b/ddk_build.cmd
index 2c5dcf8..4ce38bd 100644
--- a/ddk_build.cmd
+++ b/ddk_build.cmd
@@ -1,9 +1,18 @@
@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)
+set TARGET=LIBRARY
+if Test%1==TestDLL set TARGET=DYNLINK
+echo TARGETTYPE=%TARGET% > target
+copy target+libusb_sources sources >NUL 2>&1
+del target
@echo on
build -cwgZ
@echo off
@@ -41,8 +50,10 @@ 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
@@ -108,6 +119,7 @@ goto done
:usage
echo ddk_build must be run in a WDK build environment
+pause
goto done
:done \ No newline at end of file
diff --git a/examples/lsusb_sources b/examples/lsusb_sources
index 82ea935..c4d2365 100644
--- a/examples/lsusb_sources
+++ b/examples/lsusb_sources
@@ -19,5 +19,8 @@ INCLUDES=..\..\msvc;..\..;$(DDK_INC_PATH)
UMLIBS=..\..\libusb\os\obj$(BUILD_ALT_DIR)\*\libusb-1.0.lib
+TARGETLIBS=$(SDK_LIB_PATH)\setupapi.lib \
+ $(SDK_LIB_PATH)\ole32.lib
+
SOURCES=..\lsusb.c
diff --git a/examples/xusb_sources b/examples/xusb_sources
index f69b9e0..e3262f4 100644
--- a/examples/xusb_sources
+++ b/examples/xusb_sources
@@ -19,5 +19,8 @@ INCLUDES=..\..\msvc;..\..;$(DDK_INC_PATH)
UMLIBS=..\..\libusb\os\obj$(BUILD_ALT_DIR)\*\libusb-1.0.lib
+TARGETLIBS=$(SDK_LIB_PATH)\setupapi.lib \
+ $(SDK_LIB_PATH)\ole32.lib
+
SOURCES=..\xusb.c
diff --git a/libusb/os/sources b/libusb/os/libusb_sources
index dc474ca..cdaaacf 100644
--- a/libusb/os/sources
+++ b/libusb/os/libusb_sources
@@ -1,5 +1,5 @@
+#TARGETTYPE is not defined, to allow selection between static lib or DLL with ddk_build
TARGETNAME=libusb-1.0
-TARGETTYPE=DYNLINK
DLLDEF=..\libusb-1.0.def