]> git.zerfleddert.de Git - usb-driver/blame_incremental - Makefile
add lib32 target to build a 32 bit library on 64 bit systems
[usb-driver] / Makefile
... / ...
CommitLineData
1#Add -DFORCE_PC3_IDENT to CFLAGS to force the identification of
2#a Parallel Cable III
3CFLAGS=-Wall -fPIC -DUSB_DRIVER_VERSION="\"$(shell stat -c '%y' usb-driver.c |cut -d\. -f1)\"" #-DFORCE_PC3_IDENT
4
5MARCH := $(shell uname -m)
6ifeq ($(MARCH),x86_64)
7CFLAGS += -m64
8else
9CFLAGS += -m32
10endif
11
12FTDI := $(shell libftdi-config --libs 2>/dev/null)
13ifneq ($(FTDI),)
14JTAGKEYSRC = jtagkey.c
15CFLAGS += -DJTAGKEY
16endif
17
18SOBJECTS=libusb-driver.so libusb-driver-DEBUG.so
19
20all: $(SOBJECTS)
21ifeq ($(MARCH),x86_64)
22 @echo Built library is 64 bit. Run \`make lib32\' to build a 32 bit version
23endif
24
25libusb-driver.so: usb-driver.c parport.c jtagkey.c config.c jtagmon.c usb-driver.h parport.h jtagkey.h config.h jtagmon.h Makefile
26 $(CC) $(CFLAGS) usb-driver.c parport.c config.c jtagmon.c $(JTAGKEYSRC) -o $@ -ldl -lusb -lpthread $(FTDI) -shared
27
28libusb-driver-DEBUG.so: usb-driver.c parport.c jtagkey.c config.c jtagmon.c usb-driver.h parport.h jtagkey.h config.h jtagmon.h Makefile
29 $(CC) -DDEBUG $(CFLAGS) usb-driver.c parport.c config.c jtagmon.c $(JTAGKEYSRC) -o $@ -ldl -lusb -lpthread $(FTDI) -shared
30
31lib32:
32 $(MAKE) MARCH=i386 clean all
33
34clean:
35 rm -f $(SOBJECTS)
36
37.PHONY: clean all
Impressum, Datenschutz