-
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
72 lines (60 loc) · 1.31 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
65
66
67
68
69
70
71
72
TARGETS:= lora-sx1262
# npl/linux/src/os_eventq.cc
CSRCS := \
src/main.c \
src/radio.c \
src/sx126x.c \
src/sx126x-linux.c \
npl/linux/src/os_callout.c \
npl/linux/src/os_sem.c \
npl/linux/src/os_task.c \
npl/linux/src/os_atomic.c \
npl/linux/src/os_time.c \
npl/linux/src/os_mutex.c \
DEPS := \
include/radio.h \
include/sx126x-board.h \
include/sx126x.h \
include/sx126x-utilities.h \
npl/linux/include/nimble/nimble_npl_os.h \
npl/linux/include/nimble/nimble_npl.h \
npl/linux/include/nimble/os_types.h \
npl/linux/include/console/console.h \
npl/linux/src/wqueue.h \
# TODO: -Werror=all
CCFLAGS:= \
-g \
-Wall \
-Wextra \
-Wno-unused-parameter \
-Wno-sign-compare \
-Wno-old-style-declaration \
-I include \
-I npl/linux/include \
-I npl/linux/include/nimble \
LDFLAGS:= \
-pthread \
-lrt \
-lstdc++ \
CC := gcc
CPP := gcc
MAINS := $(addsuffix .o, $(TARGETS) )
OBJ := \
$(MAINS) \
$(CSRCS:.c=.o)
.PHONY: all clean
all: $(TARGETS)
clean:
rm src/*.o || true
rm npl/linux/src/*.o || true
$(OBJ): %.o : %.c $(DEPS)
$(CC) -c -o $@ $< $(CCFLAGS)
# $(OBJ): %.o : %.cc $(DEPS)
# $(CPP) -c -o $@ $< $(CCFLAGS)
$(TARGETS): % : $(filter-out $(MAINS), $(OBJ))
$(CC) -o $@ \
npl/linux/src/os_eventq.cc \
$(LIBS) \
$^ \
$(CCFLAGS) \
$(LDFLAGS) \