-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathMakefile
36 lines (25 loc) · 855 Bytes
/
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
CC = gcc
CXX = g++
CFLAGS = -g -O3 -Wall -std=c++0x -pthread -DHAVE_LOG_H
LIBS = -lpthread
LDFLAGS = -g
OBJECTS = APRSGateway.o APRSWriterThread.o Conf.o Log.o StopWatch.o TCPSocket.o Thread.o Timer.o UDPSocket.o Utils.o
all: APRSGateway
APRSGateway: GitVersion.h $(OBJECTS)
$(CXX) $(OBJECTS) $(CFLAGS) $(LIBS) -o APRSGateway
%.o: %.cpp
$(CXX) $(CFLAGS) -c -o $@ $<
APRSGateway.o: GitVersion.h FORCE
.PHONY: GitVersion.h
FORCE:
install:
install -m 755 APRSGateway /usr/local/bin/
clean:
$(RM) APRSGateway *.o *.d *.bak *~ GitVersion.h
# 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