-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathMakefile
More file actions
83 lines (66 loc) · 1.3 KB
/
Makefile
File metadata and controls
83 lines (66 loc) · 1.3 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
.PHONY: all clean
# Requires libusb-dev libusb-1.0.0-dev libudev-dev
OUTPUT = \
readserial \
writeserial \
ping \
version \
coremap \
hfupdate \
createupdate \
enterloader \
readdb \
thermistor \
hfudump \
readdbstream \
hfterm \
hcm \
hfsetfans \
ctrltest \
opusbinit \
da2stest
SRCDIR = src
GCC = gcc
all: $(OUTPUT)
INCLUDE_DIRS = /usr/include/libusb-1.0 /usr/local/include/libusb-1.0
EXTRA_LINKER = -pthread -L/usr/local/lib
CFLAGS = -g -c -Wall -pthread
CCOPTS = $(CFLAGS)
CCOPTS += $(foreach INC,$(INCLUDE_DIRS),-I$(INC))
LIBS = -ludev -lpthread -lusb-1.0 -lm
LINKABLE_SOURCES = \
board_util.c \
crc.c \
usbctrl.c \
hfparse.c \
hfusb.c
C_SOURCES = \
enterloader.c \
ping.c \
readserial.c \
writeserial.c \
coremap.c \
createupdate.c \
hfupdate.c \
readdb.c \
readdbstream.c \
version.c \
thermistor.c \
hfudump.c \
hfterm.c \
hcm.c \
hfsetfans.c \
ctrltest.c \
opusbinit.c \
da2stest.c
OBJS = $(C_SOURCES:%.c=$(SRCDIR)/%.o)
LINKABLE_OBJS = $(LINKABLE_SOURCES:%.c=$(SRCDIR)/%.o)
$(LINKABLE_OBJS): $(SRCDIR)/%.o: $(SRCDIR)/%.c
$(GCC) $(CCOPTS) -o $@ $<
$(OBJS): $(SRCDIR)/%.o: $(SRCDIR)/%.c
$(GCC) $(CCOPTS) -o $@ $<
%: $(SRCDIR)/%.o $(LINKABLE_OBJS)
$(GCC) $(EXTRA_LINKER) -o $@ $< $(LINKABLE_OBJS) $(LIBS)
clean:
-$(RM) $(OBJS) $(LINKABLE_OBJS) $(OUTPUT)
-$(RM) *~