-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathMakefile
More file actions
80 lines (64 loc) · 2.13 KB
/
Copy pathMakefile
File metadata and controls
80 lines (64 loc) · 2.13 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
################################################################
# #
# mspot - An M17-only Hotspot/Repeater #
# #
# Copyright (c) 2025 by Thomas A. Early N7TAE #
# #
# See the LICENSE file for details about the software license. #
# #
################################################################
include mspot.mk
ifeq ($(DEBUG), true)
CPPFLAGS = -ggdb -std=c++17 -Wall -Wextra -Werror -Isrcs
else
CPPFLAGS = -std=c++17 -Wall -Wextra -Werror -Isrcs
endif
ifeq ($(USE_TS), false)
CPPFLAGS += -DNO_TS
endif
LIBS = -pthread -lm -lgpiod -lsqlite3
SRCS = $(wildcard srcs/*.cpp)
OBJS = $(SRCS:.cpp=.o)
DEPS = $(SRCS:.cpp=.d)
EXES = mspot inicheck cc1200-reset
all : $(EXES)
mspot : $(OBJS)
$(CXX) $(CPPFLAGS) $(OBJS) /usr/local/lib/libm17.a $(LIBS) -o $@
inicheck : srcs/Configure.h srcs/Configure.cpp srcs/JsonKeys.h
$(CXX) $(CPPFLAGS) -DINICHECK srcs/Configure.cpp srcs/LineTools.o -o $@
cc1200-reset : tools/cc1200-reset.c
gcc -o $@ tools/cc1200-reset.c -lgpiod
-include $(DEPS)
%.o: %.cpp
$(CXX) $(CPPFLAGS) -MMD -MP -c -o $@ $<
.PHONY : clean
clean :
$(RM) $(EXES) srcs/*.o srcs/*.d
.PHONY : install
install : mspot.service mspot
### Installing mspot ###
cp -f mspot $(BINDIR)
cp -f mspot.service /etc/systemd/system/
systemctl enable mspot
systemctl daemon-reload
systemctl start mspot
installdash : index.php
mkdir -p $(WWWDIR)
/bin/ln -f -s $(shell pwd)/index.php $(WWWDIR)
/bin/cp -f mdash.service /etc/systemd/system/
systemctl enable mdash.service
systemctl daemon-reload
systemctl start mdash.service
.PHONY : uninstall
uninstall :
systemctl stop mspot
systemctl disable mspot
$(RM) /etc/systemd/system/mspot.service
systemctl daemon-reload
$(RM) $(BINDIR)/mspot
uninstalldash :
systemctl stop mdash.service
systemctl disable mdash.service
/bin/rm -f /etc/systemd/system/mdash.service
systemctl daemon-reload
/bin/rm -f $(WWWDIR)/index.php