2 # This makefile attempts to compile the vhci core module and the
3 # libusb-vhci library by downloading known tarballs, hacking them
4 # a little and compiling them
6 # This has been tested on debian, but coild possibly work in other
7 # distro. the only "real" dependency is to have the linux kernel
8 # header symlinked at /lib/modules/<your host kernel version/build
13 BASE_URL = http://downloads.sourceforge.net/project/usb-vhci
18 module: vhci-hcd-$(HCD_V)/usb-vhci-hcd.ko
20 vhci-hcd-$(HCD_V)/usb-vhci-hcd.ko: vhci-hcd-$(HCD_V)
21 make -C vhci-hcd-$(HCD_V) \
22 KDIR=/lib/modules/${shell uname -r}/build \
23 CORE_INCLUDE_DIR=$(PWD)/vhci-hcd-$(HCD_V)/linux/2.6.32/drivers/usb/core
25 vhci-hcd-$(HCD_V).tar.bz2:
26 wget $(BASE_URL)/linux%20kernel%20module/$@
28 vhci-hcd-$(HCD_V): vhci-hcd-$(HCD_V).tar.bz2
29 tar jxf $@.tar.bz2 && \
31 cat ../patches/hcd-*.patch | patch --merge -p1
32 sed -i -e 's|#define DEBUG|#undef DEBUG|' vhci-hcd-$(HCD_V)/usb-vhci-hcd.c
34 library: lib/libusb_vhci.a
36 lib/libusb_vhci.a: module libusb_vhci-$(VHCI_V)
37 ln -snf vhci-hcd-$(HCD_V) linux && \
38 cd libusb_vhci-$(VHCI_V) && \
39 ./configure --prefix=$(PWD) CPPFLAGS="-I$(PWD)" --enable-static --disable-shared && \
40 make -j && make install
42 libusb_vhci-$(VHCI_V).tar.bz2:
43 wget $(BASE_URL)/native%20libraries/libusb_vhci-$(VHCI_V).tar.bz2
45 libusb_vhci-$(VHCI_V): libusb_vhci-$(VHCI_V).tar.bz2
46 tar jxf $@.tar.bz2 && \
48 cat ../patches/vhci-*.patch | patch --merge -p1
51 rm -rf libusb_vhci-$(VHCI_V) vhci-hcd-$(HCD_V) lib include linux