]> git.zerfleddert.de Git - usb-driver/blame_incremental - Makefile
declare variables at the beginning of the scope
[usb-driver] / Makefile
... / ...
CommitLineData
1#Add -DFORCE_PC3_IDENT to CFLAGS to force the identification of
2#a Parallel Cable III
3#Add -DNO_USB_RESET to disable the hard reset of the cable when
4#opening the device
5CFLAGS=-Wall -fPIC -DUSB_DRIVER_VERSION="\"$(shell stat -c '%y' usb-driver.c |cut -d\. -f1)\"" #-DFORCE_PC3_IDENT -DNO_USB_RESET
6
7LIBS=-ldl -lusb -lpthread
8
9SRC=usb-driver.c xpcu.c parport.c config.c jtagmon.c
10HEADER=usb-driver.h xpcu.h parport.h jtagkey.h config.h jtagmon.h
11
12ifeq ($(LIBVER),32)
13CFLAGS += -m32
14endif
15
16FTDI := $(shell libftdi-config --libs 2>/dev/null)
17ifneq ($(FTDI),)
18SRC += jtagkey.c
19CFLAGS += -DJTAGKEY
20LIBS += $(FTDI)
21endif
22
23SOBJECTS=libusb-driver.so libusb-driver-DEBUG.so
24
25all: $(SOBJECTS)
26 @file libusb-driver.so | grep x86-64 >/dev/null && echo Built library is 64 bit. Run \`make lib32\' to build a 32 bit version || true
27
28libusb-driver.so: $(SRC) $(HEADER) Makefile
29 $(CC) $(CFLAGS) $(SRC) -o $@ $(LIBS) -shared
30
31libusb-driver-DEBUG.so: $(SRC) $(HEADER) Makefile
32 $(CC) -DDEBUG $(CFLAGS) $(SRC) -o $@ $(LIBS) -shared
33
34lib32:
35 $(MAKE) LIBVER=32 clean all
36
37clean:
38 rm -f $(SOBJECTS)
39
40.PHONY: clean all lib32
Impressum, Datenschutz