forked from g4klx/M17Gateway
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
43 lines (30 loc) · 1.11 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
CC = cc
CXX = c++
# Use the following CFLAGS and LIBS if you don't want to use gpsd.
CFLAGS = -g -O3 -Wall -DHAVE_LOG_H -std=c++0x -pthread
LIBS = -lpthread
# Use the following CFLAGS and LIBS if you do want to use gpsd.
#CFLAGS = -g -O3 -Wall -DHAVE_LOG_H -DUSE_GPSD -std=c++0x -pthread
#LIBS = -lpthread -lgps
LDFLAGS = -g
OBJECTS = APRSWriter.o Conf.o Echo.o GPSHandler.o Log.o M17LSF.o M17Network.o M17Gateway.o M17Utils.o Reflectors.o \
RptNetwork.o StopWatch.o Thread.o Timer.o UDPSocket.o Utils.o Voice.o
all: M17Gateway
M17Gateway: $(OBJECTS)
$(CXX) $(OBJECTS) $(CFLAGS) $(LIBS) -o M17Gateway
%.o: %.cpp
$(CXX) $(CFLAGS) -c -o $@ $<
M17Gateway.o: GitVersion.h FORCE
.PHONY: GitVersion.h
FORCE:
clean:
$(RM) M17Gateway *.o *.d *.bak *~ GitVersion.h
install:
install -m 755 M17Gateway /usr/local/bin/
# Export the current git version if the index file exists, else 000...
GitVersion.h:
ifneq ("$(wildcard .git/index)","")
echo "const char *gitversion = \"$(shell git rev-parse HEAD)\";" > $@
else
echo "const char *gitversion = \"0000000000000000000000000000000000000000\";" > $@
endif