mirror of https://github.com/n7tae/tcd.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
50 lines
1021 B
50 lines
1021 B
#Copyright (C) 2021 by Thomas A. Early, N7TAE
|
|
|
|
include configure.mk
|
|
|
|
# If you are going to change this path, you will
|
|
# need to update the systemd service script
|
|
BINDIR = /usr/local/bin
|
|
|
|
GCC = g++
|
|
|
|
ifeq ($(debug), true)
|
|
CFLAGS = -ggdb3 -W -Werror -Icodec2 -MMD -MD -std=c++11
|
|
else
|
|
CFLAGS = -W -Werror -Icodec2 -MMD -MD -std=c++11
|
|
endif
|
|
|
|
LDFLAGS = -lftd2xx -pthread
|
|
|
|
SRCS = $(wildcard *.cpp) $(wildcard codec2/*.cpp)
|
|
OBJS = $(SRCS:.cpp=.o)
|
|
DEPS = $(SRCS:.cpp=.d)
|
|
EXE = tcd
|
|
|
|
$(EXE) : $(OBJS)
|
|
$(GCC) -o $@ $(OBJS) $(LDFLAGS)
|
|
|
|
%.o : %.cpp
|
|
$(GCC) $(CFLAGS) -c $< -o $@
|
|
|
|
clean :
|
|
$(RM) $(EXE) $(OBJS) $(DEPS)
|
|
|
|
-include $(DEPS)
|
|
|
|
# The install and uninstall targets need to be run by root
|
|
install : $(EXE)
|
|
cp $(EXE) $(BINDIR)
|
|
cp systemd/$(EXE).service /etc/systemd/system/
|
|
systemctl enable $(EXE)
|
|
systemctl daemon-reload
|
|
systemctl start $(EXE)
|
|
|
|
uninstall :
|
|
systemctl stop $(EXE)
|
|
systemctl disable $(EXE)
|
|
systemctl daemon-reload
|
|
rm -f /etc/systemd/system/$(EXE).service
|
|
rm -f $(BINDIR)/$(EXE)
|
|
systemctl daemon-reload
|