]>
Commit | Line | Data |
---|---|---|
05e1bfcd | 1 | #Add -DFORCE_PC3_IDENT to CFLAGS to force the identification of |
2 | #a Parallel Cable III | |
81cf3658 | 3 | CFLAGS=-Wall -fPIC -DUSB_DRIVER_VERSION="\"$(shell stat -c '%y' usb-driver.c |cut -d\. -f1)\"" #-DFORCE_PC3_IDENT |
2c2119eb | 4 | |
69a88eeb MG |
5 | LIBS=-ldl -lusb -lpthread |
6 | ||
7 | SRC=usb-driver.c parport.c config.c jtagmon.c | |
8 | HEADER=usb-driver.h parport.h jtagkey.h config.h jtagmon.h | |
9 | ||
d59d5fb4 | 10 | ifeq ($(LIBVER),32) |
7517e9fe MG |
11 | CFLAGS += -m32 |
12 | endif | |
13 | ||
19b2e286 | 14 | FTDI := $(shell libftdi-config --libs 2>/dev/null) |
15 | ifneq ($(FTDI),) | |
69a88eeb | 16 | SRC += jtagkey.c |
19b2e286 | 17 | CFLAGS += -DJTAGKEY |
69a88eeb | 18 | LIBS += $(FTDI) |
19b2e286 | 19 | endif |
20 | ||
05e1bfcd | 21 | SOBJECTS=libusb-driver.so libusb-driver-DEBUG.so |
cdc9c5bf | 22 | |
23 | all: $(SOBJECTS) | |
d59d5fb4 | 24 | @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 |
7216ce6c | 25 | |
69a88eeb MG |
26 | libusb-driver.so: $(SRC) $(HEADER) Makefile |
27 | $(CC) $(CFLAGS) $(SRC) -o $@ $(LIBS) -shared | |
cdc9c5bf | 28 | |
69a88eeb MG |
29 | libusb-driver-DEBUG.so: $(SRC) $(HEADER) Makefile |
30 | $(CC) -DDEBUG $(CFLAGS) $(SRC) -o $@ $(LIBS) -shared | |
7517e9fe MG |
31 | |
32 | lib32: | |
d59d5fb4 | 33 | $(MAKE) LIBVER=32 clean all |
cdc711dc | 34 | |
35 | clean: | |
cdc9c5bf | 36 | rm -f $(SOBJECTS) |
2c0c1255 | 37 | |
69a88eeb | 38 | .PHONY: clean all lib32 |