DMRGateway/Makefile

47 lines
1 KiB
Makefile
Raw Normal View History

CC = cc
CXX = c++
# Use the following CFLAGS and LIBS if you don't want to use gpsd.
2026-03-11 18:25:22 +01:00
CFLAGS = -g -O3 -Wall -std=c++0x -MMD -MD -pthread
LIBS = -lpthread -lmosquitto
# Use the following CFLAGS and LIBS if you do want to use gpsd.
2026-03-11 18:25:22 +01:00
#CFLAGS = -g -O3 -Wall -DUSE_GPSD -std=c++0x -MMD -MD -pthread
#LIBS = -lpthread -lgps -lmosquitto
2017-04-20 21:51:30 +02:00
LDFLAGS = -g
2026-03-11 18:25:22 +01:00
SRCS = $(wildcard *.cpp)
OBJS = $(SRCS:.cpp=.o)
DEPS = $(SRCS:.cpp=.d)
2017-04-20 21:51:30 +02:00
all: DMRGateway
2026-03-11 18:25:22 +01:00
DMRGateway: GitVersion.h $(OBJS)
$(CXX) $(OBJS) $(CFLAGS) $(LIBS) -o DMRGateway
2017-04-20 21:51:30 +02:00
%.o: %.cpp
$(CXX) $(CFLAGS) -c -o $@ $<
2026-03-11 18:25:22 +01:00
-include $(DEPS)
2017-04-20 21:51:30 +02:00
DMRGateway.o: GitVersion.h FORCE
2017-05-23 15:20:06 +02:00
.PHONY: GitVersion.h
FORCE:
2017-04-20 21:51:30 +02:00
clean:
$(RM) DMRGateway *.o *.d *.bak *~ GitVersion.h
2020-06-25 11:00:57 +02:00
install:
install -m 755 DMRGateway /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