-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
executable file
·74 lines (57 loc) · 1.61 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
73
74
#ROLE := BOARD
ROLE := GROUND
#OPT_TELEM := TELEM
OPT_TELEM :=
PROT := RAW
#PROT :=
ROLEFLAG :=
ifeq ($(ROLE),BOARD)
ROLEFLAG = -DBOARD=1
else ifeq ($(ROLE),GROUND)
ROLEFLAG = -DBOARD=0
endif
PROTFLAG :=
ifeq ($(PROT),RAW)
PROTFLAG += -DRAW=1
PROTFLAG += -DDRIVERNAME=\"rtl88XXau\"
# PROTFLAG += -DDRIVERNAME=\"rtl88xxau_wfb\"
else
PROTFLAG += -DRAW=0
PROTFLAG += -DDRIVERNAME=\"\"
# PROTFLAG += -DADDR_LOCAL_RAW=\"10.33.38.113\"
# PROTFLAG += -DADDR_REMOTE_RAW=\"10.33.38.74\"
PROTFLAG += -DADDR_LOCAL_RAW=\"192.168.3.1\"
PROTFLAG += -DADDR_REMOTE_RAW=\"192.168.3.2\"
# PROTFLAG += -DADDR_LOCAL_RAW=\"192.168.1.40\"
# PROTFLAG += -DADDR_REMOTE_RAW=\"192.168.1.29\"
endif
OSFLAG :=
ifeq ($(OPT_TELEM),TELEM)
OSFLAG += -DTELEM=1
UNAME_R := $(shell uname -r)
ifeq ($(UNAME_R),5.10.160-26-rk356x)
OSFLAG += -DUART=\"/dev/ttyS4\"
endif
else
OSFLAG += -DTELEM=0
endif
TARGET = wfb
#CFLAGS ?= -O2 -g
CFLAGS ?= -Ofast -g
CFLAGS += -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration
CFLAGS += -DCONFIG_LIBNL30 -I/usr/include/libnl3
CFLAGS += $(PROTFLAG) $(ROLEFLAG) $(OSFLAG)
LFLAGS = -g
LFLAGS += -lnl-route-3 -lnl-genl-3 -lnl-3
SRCDIR = src
OBJDIR = obj
BINDIR = bin
SOURCES := $(wildcard $(SRCDIR)/*.c)
INCLUDES := $(wildcard $(SRCDIR)/*.h)
OBJECTS := $(SOURCES:$(SRCDIR)/%.c=$(OBJDIR)/%.o)
$(BINDIR)/$(TARGET): $(OBJECTS)
gcc $(OBJECTS) $(LFLAGS) -o $@
$(OBJECTS): $(OBJDIR)/%.o : $(SRCDIR)/%.c
gcc $(CFLAGS) -c $< -o $@
clean:
rm -f $(OBJECTS) $(BINDIR)/$(TARGET)