-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathmake-unix
58 lines (48 loc) · 1.57 KB
/
make-unix
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
CC = gcc
GITCOUNT = $(shell git rev-list HEAD --count)
UNAME = $(shell uname)
CFLAGS = -Wall -g -O -Ihidapi -DGITCOUNT='"$(GITCOUNT)"'
LDFLAGS =
# Linux
ifeq ($(UNAME),Linux)
LIBS += -lusb-1.0 -lpthread
HIDSRC = hidapi/hid-libusb.c
endif
# Mac OS X
ifeq ($(UNAME),Darwin)
LIBS += -framework IOKit -framework CoreFoundation
HIDSRC = hidapi/hid-mac.c
endif
OBJS = gdbproxy.o rpmisc.o target-ejtag.o hid.o \
proxy-mips.o adapter-pickit2.o
# Olimex ARM-USB-Tiny JTAG adapter.
CFLAGS += -DUSE_MPSSE
OBJS += adapter-mpsse.o
ifeq ($(UNAME),Linux)
# Use 'sudo port install libusb-0.1-dev'
LIBS += -lusb
endif
ifeq ($(UNAME),Darwin)
# Use 'sudo port install libusb-legacy'
CFLAGS += -I/opt/local/include/libusb-legacy
LIBS += -L/opt/local/lib/libusb-legacy -lusb-legacy
endif
all: ejtagproxy
ejtagproxy: $(OBJS)
$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)
hid.o: $(HIDSRC)
$(CC) $(CFLAGS) -c -o $@ $<
clean:
rm -f *~ *.o core ejtagproxy
install: ejtagproxy
install -c -s ejtagproxy /usr/local/bin/ejtagproxy
###
adapter-mpsse.o: adapter-mpsse.c adapter.h mips.h ejtag.h
adapter-pickit2.o: adapter-pickit2.c adapter.h hidapi/hidapi.h pickit2.h \
mips.h ejtag.h
gdbproxy.o: gdbproxy.c gdbproxy.h
proxy-mips.o: proxy-mips.c gdbproxy.h target.h mips.h
proxy-skeleton.o: proxy-skeleton.c gdbproxy.h
rpmisc.o: rpmisc.c gdbproxy.h
target-ejtag.o: target-ejtag.c target.h adapter.h mips.h ejtag.h
hid.o: hidapi/hid-linux.c hidapi/hid-mac.c hidapi/hidapi.h