summaryrefslogtreecommitdiffstats
path: root/src/Makefile
blob: a04638f4d9b4d617ec27556b0a9031021a18acc1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
include ../config.mk
OBJ=main.o fiasco.o hexdump.o dump.o flash.o serial.o qmode.o
OBJ+=hash.o fpid.o query.o pieces.o utils.o devices.o console.o
OBJ+=squeue/squeue.o
BIN=0xFFFF
#LIBS=`${HAVE_USB} && echo -- '-lusb'`
LIBS=`if [ "${HAVE_USB}" = 1 ]; then echo '-lusb'; fi`
CFLAGS+=-DVERSION=\"${VERSION}\" -Wall -I .
CFLAGS+=-pedantic -std=c99 -DHAVE_USB=${HAVE_USB} -Wno-unused-result
USBOBJ=../libusb/error.o ../libusb/usb.o ../libusb/descriptors.o
USBOBJ+=../libusb/linux.o ## XXX not portable

CFLAGS+=-I../libusb
LDFLAGS+=-L../libusb

all: ${BIN}

${BIN}: ${OBJ}
	${CC} ${LDFLAGS} -o ${BIN} ${OBJ} ${LIBS}

allusb: ${OBJ}
	${CC} ${LDFLAGS} -o ${BIN} ${OBJ} ${USBOBJ}

static: ${OBJ}
	${CC} ${LDFLAGS} -o ${BIN} -static ${OBJ} ${USBOBJ}

clean:
	-rm -f ${OBJ} ${BIN}