summaryrefslogtreecommitdiffhomepage
path: root/Makefile
diff options
context:
space:
mode:
authorRoland Reichwein <mail@reichwein.it>2025-01-20 21:56:53 +0100
committerRoland Reichwein <mail@reichwein.it>2025-01-20 21:56:53 +0100
commit2c5684482c14764cec4fb32b2ec07dd3f77fd4bf (patch)
tree9ff9c5c04a20c30568f4ce1c466fe55818a0b45b /Makefile
parent5fd637644c7529bfdc5291215f3f8ee1edd304c4 (diff)
Add click-fcgi (WIP)HEADmaster
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile26
1 files changed, 23 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 91ee0c8..6b1121e 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,7 @@
TARGET=click
+FCGI_TARGET=click-fcgi
-default: $(TARGET)
+default: $(TARGET) $(FCGI_TARGET)
SRCS= \
MainLoop.cpp \
@@ -26,6 +27,14 @@ HEADERS=$(SRCS:.cpp=.h)
OBJS=$(SRCS:.cpp=.o)
+FCGI_SRCS=\
+ click-fcgi.cpp \
+ config.cpp \
+ log.cpp \
+ debug.cpp \
+
+FCGI_OBJS=$(FCGI_SRCS:.cpp=.o)
+
CXX=clang++
ifeq ($(CXXFLAGS),)
@@ -37,22 +46,33 @@ CXXFLAGS+=-std=c++20 -Wall -Wpedantic
CXXFLAGS+=-gdwarf-4
CXXFLAGS+=-I/usr/include/libevdev-1.0
-CXXLIBS=$(shell pkg-config --libs alsa) -lreichwein -lfmt -lasound -levdev
+CXXLIBS=$(shell pkg-config --libs alsa) -lreichwein -lfmt -lasound -levdev -lfcgi
$(TARGET): $(OBJS)
$(CXX) $^ -o $@ $(CXXLIBS)
+$(FCGI_TARGET): $(FCGI_OBJS)
+ $(CXX) $^ -o $@ $(CXXLIBS)
+
%.o: %.cpp
$(CXX) $(CXXFLAGS) -o $@ -c $<
+run-fcgi:
+ spawn-fcgi -a 127.0.0.1 -p 9090 -n -- ./click-fcgi
+
install:
mkdir -p $(DESTDIR)/usr/bin
cp $(TARGET) $(DESTDIR)/usr/bin
mkdir -p $(DESTDIR)/usr/lib/click/media
cp media/click.s16le $(DESTDIR)/usr/lib/click/media
+ mkdir -p $(DESTDIR)/usr/lib/click
+ cp $(FCGI_TARGET) $(DESTDIR)/usr/lib/click
+ cp -r html $(DESTDIR)/usr/lib/click
+ mkdir -p $(DESTDIR)/etc/nginx/sites-available
+ cp debian/nginx-sites-available $(DESTDIR)/etc/nginx/sites-available/click
clean:
- rm -f $(TARGET) $(OBJS)
+ rm -f $(TARGET) $(FCGI_TARGET) $(OBJS) $(FCGI_OBJS)
sound:
ffmpeg -i media/click.wav -f s16le media/click.s16le