summaryrefslogtreecommitdiffhomepage
path: root/Makefile
diff options
context:
space:
mode:
authorRoland Reichwein <mail@reichwein.it>2020-04-03 12:39:00 +0200
committerRoland Reichwein <mail@reichwein.it>2020-04-03 12:39:00 +0200
commite60bb89a6d1392c0007a1fbc03faf007faf76167 (patch)
tree05820683872664bf644a41f8b34f18173f11b6db /Makefile
parentf27702d3cf183f7fbaf88e584bae63a6514d9e65 (diff)
Added Debian systemd service file
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile30
1 files changed, 27 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index 736387a..7794af6 100644
--- a/Makefile
+++ b/Makefile
@@ -1,7 +1,16 @@
+DISTROS=debian10
+VERSION=$(shell dpkg-parsechangelog --show-field Version)
PROJECTNAME=webserver
CXX=clang++-10
-#CXX=g++-9
+
+ifeq ($(shell which $(CXX)),)
+CXX=clang++
+endif
+
+ifeq ($(shell which $(CXX)),)
+CXX=g++-9
+endif
ifeq ($(CXXFLAGS),)
#CXXFLAGS=-O2 -DNDEBUG
@@ -47,7 +56,8 @@ LIBS+= \
endif
PROGSRC=\
- http.cpp
+ http.cpp \
+ http_debian10.cpp
TESTSRC=\
test-webserver.cpp \
@@ -87,6 +97,18 @@ install:
cp webserver $(DESTDIR)/usr/bin
# 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 '*.d' -o -name '*.gcno' -o -name '*.gcda' | xargs rm -f
@@ -96,6 +118,8 @@ zip: clean
zip -r ../$(PROJECTNAME).zip *
ls -l ../$(PROJECTNAME).zip
-.PHONY: clean all zip
+
+
+.PHONY: clean all zip install deb deb-src debs all $(DISTROS)
-include $(wildcard $(SRC:.cpp=.d))