-
Notifications
You must be signed in to change notification settings - Fork 2
/
Makefile
executable file
·64 lines (50 loc) · 1.14 KB
/
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
53
54
55
56
57
58
59
60
61
62
63
64
#########
#
# The top level targets link in the two .o files for now.
#
TARGETS += ledspi-server
LEDSPI_OBJS = util.o spio.o lib/cesanta/frozen.o lib/cesanta/mongoose.o
all: $(TARGETS) ledspi.service ledspi-service
export CROSS_COMPILE:=
CFLAGS += \
-std=c99 \
-W \
-Wall \
-D_BSD_SOURCE \
-Wp,-MMD,$(dir $@).$(notdir $@).d \
-Wp,-MT,$@ \
-I. \
-O2 \
-lm \
-Wunused-parameter \
-DNS_ENABLE_IPV6 \
-Wunknown-pragmas \
-Wsign-compare
LDFLAGS += \
LDLIBS += \
-lm \
-lpthread \
COMPILE.o = $(CROSS_COMPILE)gcc $(CFLAGS) -c -o $@ $<
COMPILE.a = $(CROSS_COMPILE)ar crv $@ $^
COMPILE.link = $(CROSS_COMPILE)gcc $(LDFLAGS) -o $@ $^ $(LDLIBS)
$(foreach O,$(TARGETS),$(eval $O: $O.o $(LEDSPI_OBJS)))
$(TARGETS):
$(COMPILE.link)
ledspi.service: ledspi.service.in
sed 's%LEDSPI_PATH%'`pwd`'%' ledspi.service.in > ledspi.service
ledspi-service: ledspi-service.in
sed 's%LEDSPI_PATH%'`pwd`'%' ledspi-service.in > ledspi-service.sh
chmod +x ledspi-service.sh
.PHONY: clean
clean:
rm -rf \
*.o \
*.i \
.*.o.d \
*~ \
$(TARGETS) \
*.bin \
ledspi.service \
ledspi-service.sh
# Include all of the generated dependency files
-include .*.o.d