summarylogtreecommitdiffstats
path: root/Makefile
blob: bb6e3f46bc83f4ae870a5a4b3f355a1af407db35 (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
29
30
31
32
SRCS = ujprog.c
CFLAGS += -Wall -D__linux__ -std=gnu99 
INSTALL_DIR= /usr/bin

# for linux on PC (i386/amd64)
ARCHNAME = $(shell uname -m)-linux-gnu
# for linux on raspberrypi-3
# ARCHNAME = arm-linux-gnueabihf

#FTLIB = /usr/lib/${ARCHNAME}/libftdi.a
#USBLIB = /usr/lib/${ARCHNAME}/libusb.a
FTLIB = -lftdi1 
USBLIB = -lusb
USBLIB-1.0 = -I/usr/include/libusb-1.0/ -lusb-1.0

ujprog:	${SRCS}
	${CC} ${CFLAGS} ${FTLIB} ${USBLIB} ${SRCS}  -o ujprog

flash:	ft232r_flash.c
	${CC} ${CFLAGS} ${USBLIB-1.0} ft232r_flash.c ${FTLIB} -o ft232r_flash
	
install: ujprog
	install -m 4755 ujprog ${INSTALL_DIR}

uninstall: ujprog
	rm -f /usr/bin/ujprog

clean:
	rm -f ujprog ujprog.o *~

depend:
	mkdep ${INCLUDES} ${SRCS}