forked from ataradov/edbg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
53 lines (44 loc) · 934 Bytes
/
Makefile
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
UNAME := $(shell uname)
SRCS = \
dap.c \
edbg.c \
target.c \
target_atmel_cm0p.c \
target_atmel_cm3.c \
target_atmel_cm4.c \
target_atmel_cm7.c
HDRS = \
dap.h \
dbg.h \
edbg.h \
target.h
ifeq ($(UNAME), Linux)
BIN = edbg
SRCS += dbg_lin.c
LIBS += -ludev
else
ifeq ($(UNAME), Darwin)
BIN = edbg
SRCS += dbg_mac.c
LIBS += hidapi/mac/.libs/libhidapi.a
LIBS += -framework IOKit
LIBS += -framework CoreFoundation
HIDAPI = hidapi/mac/.libs/libhidapi.a
CFLAGS += -Ihidapi/hidapi
else
BIN = edbg.exe
SRCS += dbg_win.c
LIBS += -lhid -lsetupapi
endif
endif
CFLAGS += -W -Wall -Wextra -O2 -std=gnu99
all: $(BIN)
$(BIN): $(SRCS) $(HDRS) $(HIDAPI)
gcc $(CFLAGS) $(SRCS) $(LIBS) -o $(BIN)
hidapi/mac/.libs/libhidapi.a:
git clone git://github.com/signal11/hidapi.git
cd hidapi && ./bootstrap
cd hidapi && ./configure
make -Chidapi
clean:
rm -rvf $(BIN) hidapi