2018-11-03 17:12:20 +01:00
|
|
|
|
|
|
|
|
2018-11-11 21:28:45 +01:00
|
|
|
CXXFLAGS=-std=c++17 -O0 -g -no-pie -pipe -MMD -Wall -Wextra
|
2018-11-03 17:12:20 +01:00
|
|
|
RELEASE_CXXFLAGS=-std=c++17 -O3 -pipe -MMD -Wall -Wextra
|
2020-03-29 21:24:31 +02:00
|
|
|
LDFLAGS=-lsqlite3 -lpthread -lcrypto -lstdc++fs -lseccomp
|
2021-04-18 12:41:11 +02:00
|
|
|
INCLUDEFLAGS=-I submodules/sqlitemoderncpp/hdr -I submodules/cpp-httplib -I submodules/qssb.h -I submodules/qsmaddy/include/
|
2018-11-03 17:12:20 +01:00
|
|
|
|
2019-02-21 10:51:07 +01:00
|
|
|
CXX=g++
|
2018-11-03 17:12:20 +01:00
|
|
|
|
|
|
|
|
|
|
|
SOURCES=$(wildcard *.cpp)
|
|
|
|
SOURCES+=$(wildcard gateway/*.cpp)
|
|
|
|
SOURCES+=$(wildcard handlers/*.cpp)
|
|
|
|
SOURCES+=$(wildcard database/*.cpp)
|
2019-10-02 22:06:19 +02:00
|
|
|
SOURCES+=$(wildcard cache/*.cpp)
|
|
|
|
SOURCES+=$(wildcard sandbox/*.cpp)
|
2018-11-03 17:12:20 +01:00
|
|
|
|
|
|
|
HEADERS=$(wildcard *.h)
|
|
|
|
HEADERS+=$(wildcard gateway/*.h)
|
|
|
|
HEADERS+=$(wildcard handlers/*.h)
|
|
|
|
HEADERS+=$(wildcard database/*.h)
|
2019-10-02 22:06:19 +02:00
|
|
|
HEADERS+=$(wildcard cache/*.h)
|
|
|
|
HEADERS+=$(wildcard sandbox/*.h)
|
2018-11-03 17:12:20 +01:00
|
|
|
|
|
|
|
|
|
|
|
OBJECTS=$(patsubst %.cpp, %.o, $(SOURCES))
|
|
|
|
WIKIOBJECTS=$(filter-out test.o, $(OBJECTS))
|
|
|
|
TESTOBJECTS=$(filter-out qswiki.o, $(OBJECTS))
|
2019-10-02 22:06:19 +02:00
|
|
|
DEPENDS = ${WIKIOBJECTS:.o=.d}
|
|
|
|
-include ${DEPENDS}
|
2018-11-03 17:12:20 +01:00
|
|
|
|
|
|
|
# Points to the root of Google Test, relative to where this file is.
|
|
|
|
# Remember to tweak this if you move this file.
|
|
|
|
GTEST_DIR = /home/data/SOURCES/gtest/googletest
|
|
|
|
|
|
|
|
GTESTS_TESTDIR = ./tests/
|
|
|
|
|
|
|
|
GTEST_CXXFLAGS=-std=c++17 -isystem $(GTEST_DIR)/include -I$(GTEST_DIR) -g -O0 -pipe -Wall -Wextra
|
|
|
|
GTEST_LDFLAGS=-lsqlite3 -g -O0 -lpthread -lcrypto -lstdc++fs
|
|
|
|
GTEST_OBJECTS=$(filter-out qswiki.o, $(WIKIOBJECTS))
|
|
|
|
|
|
|
|
.DEFAULT_GOAL := qswiki
|
|
|
|
|
|
|
|
release: CXXFLAGS=$(RELEASE_CXXFLAGS)
|
|
|
|
release: qswiki
|
|
|
|
qswiki: $(WIKIOBJECTS)
|
2020-04-07 21:33:26 +02:00
|
|
|
$(CXX) $(WIKIOBJECTS) ${LDFLAGS} ${INCLUDEFLAGS} -o qswiki
|
2018-11-03 17:12:20 +01:00
|
|
|
|
2019-10-02 21:53:32 +02:00
|
|
|
test: $(TESTOBJECTS)
|
2018-11-03 17:12:20 +01:00
|
|
|
$(CXX) $(TESTOBJECTS) ${LDFLAGS} -o test
|
2019-10-02 21:53:32 +02:00
|
|
|
|
2018-11-03 17:12:20 +01:00
|
|
|
gtest: $(GTESTS_TESTDIR)/*.cpp $(GTEST_OBJECTS)
|
|
|
|
$(CXX) -o gtest $(GTESTS_TESTDIR)/*.cpp $(GTEST_OBJECTS) $(GTEST_CXXFLAGS) $(GTEST_DIR)/src/gtest_main.cc $(GTEST_DIR)/src/gtest-all.cc $(GTEST_LDFLAGS)
|
2019-10-02 22:06:19 +02:00
|
|
|
|
2018-11-03 17:12:20 +01:00
|
|
|
%.o:%.cpp
|
2020-04-07 21:33:26 +02:00
|
|
|
$(CXX) ${CXXFLAGS} ${LDFLAGS} ${INCLUDEFLAGS} -c -o $@ $<
|
2018-11-03 17:12:20 +01:00
|
|
|
|
|
|
|
clean:
|
|
|
|
rm -f $(OBJECTS) $(DEPENDS)
|
|
|
|
|
2019-10-02 22:06:19 +02:00
|
|
|
|