summaryrefslogtreecommitdiffhomepage
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rwxr-xr-xMakefile57
1 files changed, 7 insertions, 50 deletions
diff --git a/Makefile b/Makefile
index 5a1b1d2..a35cb9d 100755
--- a/Makefile
+++ b/Makefile
@@ -4,64 +4,17 @@
# Environment: Debian
#
+include common.mk
+
DISTROS=base debian11 ubuntu2204
VERSION=$(shell dpkg-parsechangelog --show-field Version)
-CXX=clang++-13
-
-ifeq ($(shell which $(CXX)),)
-CXX=clang++-10
-endif
-
-ifeq ($(shell which $(CXX)),)
-CXX=clang++
-endif
-
-ifeq ($(shell which $(CXX)),)
-CXX=g++-9
-endif
-
-ifeq ($(shell which $(CXX)),)
-CXX=g++
-endif
-
-LIBS=-lfcgi -lboost_filesystem
INCLUDES=-I.
-HEADERS=file.h config.h qrcode.h
+HEADERS=file.h config.h qrcode.h storage.h
SOURCES=$(HEADERS:.h=.cpp)
OBJECTS=$(HEADERS:.h=.o)
TARGETS=whiteboard.fcgi
-ifeq ($(CXXFLAGS),)
-CXXFLAGS=-g -O2
-endif
-
-CXXFLAGS+=-Wall -fPIE -Wpedantic -gdwarf-4
-LDFLAGS+=-pie
-
-ifeq ($(CXX),g++-9)
-CXXFLAGS+=-std=c++17
-else
-CXXFLAGS+=-std=c++20
-endif
-
-ifeq ($(CXX),clang++-10)
-LIBS+= \
--fuse-ld=lld-10 \
--lstdc++
-#-lc++ \
-#-lc++abi
-#-lc++fs
-#-lstdc++fs
-else
-LIBS+= \
--lstdc++ \
--lstdc++fs
-endif
-
-CXXFLAGS+=$(shell pkg-config --cflags qrcodegencpp Magick++ fmt)
-LIBS+=$(shell pkg-config --libs qrcodegencpp Magick++ fmt)
-
build: $(TARGETS)
all: build
@@ -97,8 +50,12 @@ whiteboard.fcgi: $(OBJECTS)
%.o: %.cpp
$(CXX) $(CXXFLAGS) $(INCLUDES) -c $< -o $@
+test:
+ $(MAKE) -C tests
+
clean:
-rm -f *.o *.fcgi
+ $(MAKE) -C tests clean
deb:
dpkg-buildpackage