summaryrefslogtreecommitdiffhomepage
path: root/plugins/weblog
diff options
context:
space:
mode:
authorRoland Reichwein <mail@reichwein.it>2020-06-06 13:58:22 +0200
committerRoland Reichwein <mail@reichwein.it>2020-06-06 13:58:22 +0200
commitd0db131a73933d0a6c65bab59d1e0e4f6a185338 (patch)
tree06edad4d845c8ba4102843fc3b306d7b5cc485d6 /plugins/weblog
parent343922258d57261021daca42eb488c1205ae491c (diff)
Code cleanup, use gcc 8 on debian 10
Diffstat (limited to 'plugins/weblog')
-rw-r--r--plugins/weblog/Makefile76
1 files changed, 10 insertions, 66 deletions
diff --git a/plugins/weblog/Makefile b/plugins/weblog/Makefile
index a21b464..ca62ce8 100644
--- a/plugins/weblog/Makefile
+++ b/plugins/weblog/Makefile
@@ -1,34 +1,12 @@
-DISTROS=debian10
-VERSION=$(shell dpkg-parsechangelog --show-field Version)
-PROJECTNAME=weblog
-
-CXX=clang++-10
-
-ifeq ($(shell which $(CXX)),)
-CXX=clang++
-endif
-
-ifeq ($(shell which $(CXX)),)
-CXX=g++-9
-endif
+include ../../common.mk
-ifeq ($(CXXFLAGS),)
-#CXXFLAGS=-O2 -DNDEBUG
-CXXFLAGS=-O0 -g -D_DEBUG
-endif
-# -fprofile-instr-generate -fcoverage-mapping
-# gcc:--coverage
+PROJECTNAME=weblog
-CXXFLAGS+= -Wall -I. -I../..
+CXXFLAGS+= -fvisibility=hidden -fPIC
-CXXFLAGS+= -pthread -fvisibility=hidden -fPIC
-ifeq ($(CXX),clang++-10)
-CXXFLAGS+=-std=c++20 #-stdlib=libc++
-else
-CXXFLAGS+=-std=c++17
-endif
+CXXFLAGS+= -I../..
-LIBS=\
+LDLIBS=\
-lcommon \
-lboost_context \
-lboost_coroutine \
@@ -41,20 +19,6 @@ LIBS=\
-lssl -lcrypto \
-ldl
-ifeq ($(CXX),clang++-10)
-LIBS+= \
--fuse-ld=lld-10 \
--lstdc++
-#-lc++ \
-#-lc++abi
-#-lc++fs
-#-lstdc++fs
-else
-LIBS+= \
--lstdc++ \
--lstdc++fs
-endif
-
LDFLAGS=-L../../libcommon
PROGSRC=\
@@ -67,15 +31,15 @@ all: $(PROJECTNAME).so
$(PROJECTNAME).so: ../../libcommon/libcommon.a $(SRC:.cpp=.o)
$(CXX) $(LDFLAGS) $^ -shared $(LDLIBS) $(LIBS) -o $@
+../../libcommon/libcommon.a:
+ cd ../.. && $(MAKE) libcommon/libcommon.a
+
%.d: %.cpp
$(CXX) $(CXXFLAGS) -MM -MP -MF $@ -c $<
%.o: %.cpp %.d
$(CXX) $(CXXFLAGS) -c $< -o $@
-googletest/src/%.o: googletest/src/%.cc
- $(CXX) $(CXXFLAGS) -c $< -o $@
-
# dependencies
ADD_DEP=Makefile
@@ -85,29 +49,9 @@ install:
cp $(PROJECTNAME).so $(DESTDIR)/usr/lib/webserver/plugins
# misc ---------------------------------------------------
-deb:
- # build binary deb package
- dpkg-buildpackage -us -uc -rfakeroot
-
-deb-src:
- dpkg-source -b .
-
-$(DISTROS): deb-src
- sudo pbuilder build --basetgz /var/cache/pbuilder/$@.tgz --buildresult result/$@ ../webserver_$(VERSION).dsc ; \
-
-debs: $(DISTROS)
-
clean:
- -rm -f test-$(PROJECTNAME) $(PROJECTNAME)
- -find . -name '*.o' -o -name '*.so' -o -name '*.d' -o -name '*.gcno' -o -name '*.gcda' | xargs rm -f
-
-zip: clean
- -rm -f ../$(PROJECTNAME).zip
- zip -r ../$(PROJECTNAME).zip *
- ls -l ../$(PROJECTNAME).zip
-
-
+ -rm -f *.o *.so *.d
-.PHONY: clean all zip install deb deb-src debs all $(DISTROS)
+.PHONY: clean install all
-include $(wildcard $(SRC:.cpp=.d))