815592a189c2d28c30a671355f894d878fe3facb
[fw/openocd] / testing / build.test1 / Makefile.libusb
1 # -*- mode: makefile -*-
2 default: _complain_
3
4 include ./local.uses
5
6 ifeq (x"$BUILD_SYSNAME",x"cygwin")
7 $(error Please use the Win32 specific port of LibUSB not the Unix version)
8 endif
9 ifeq (x"$BUILD_SYSNAME",x"mingw32")
10 $(error Please use the win32 specific port of LibUSB not the Unix version)
11 endif 
12
13 TARFILE_LOCAL    = ${VIRGINS}/libusb-${LIBUSB_VERSION_linux}.tar.bz2
14 TARFILE_URL      = http://downloads.sourceforge.net/libusb/libusb-${LIBUSB_VERSION_linux}.tar.gz
15
16 LIBUSB_SRC_DIR   = ${HERE}/libusb-${LIBUSB_VERSION}
17 LIBUSB_BUILD_DIR = ${HERE}/libusb-build
18
19 download:
20         wget -O ${TARFILE_LOCAL} ${TARFILE_URL}
21
22 unpack:
23         rm -rf ${LIBUSB_SRC_DIR}
24         tar xfz ${TARFILE_LOCAL}
25
26 clean::
27         rm -rf ${LIBUSB_SRC_DIR}
28
29 configure:
30         rm -rf ${LIBUSB_BUILD_DIR}
31         mkdir -p ${LIBUSB_BUILD_DIR}
32         cd ${LIBUSB_BUILD_DIR} && ${LIBUSB_SRC_DIR}/configure \
33                 --prefix=${PREFIX} --exec-prefix=${EXEC_PREFIX}
34
35 clean::
36         rm -rf ${LIBUSB_BUILD_DIR}
37
38 build:
39         cd ${LIBUSB_BUILD_DIR} && ${MAKE}
40
41 install: 
42         cd ${LIBUSB_BUILD_DIR} && ${MAKE} install
43
44 all: unpack configure build install
45
46 .PHONY: install
47
48 _complain_:
49         @echo ""
50         @echo "Please try one of these targets: bootstrap, clean, configure, build, install"
51         @echo " Or read the makefile and learn about the permutation test targets"
52         @echo ""
53         @echo "You also might find the download and unpack targets helpful."
54         @echo ""
55         @exit 1