From 294bc32e02936fdad0c1d376c45e40b8bd392bd1 Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Wed, 28 Feb 2018 11:23:24 +0100 Subject: Fix versioning --- Makefile | 12 ++++++++---- src/Makefile | 2 +- src/webbox.cpp | 1 - 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index 9c9840f..1cae15d 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,9 @@ DESTDIR= +DISTROS=debian8 debian9 ubuntu1604lts ubuntu1710 +VERSION=$(shell dpkg-parsechangelog --show-field Version) all: - make -C src + make -C src VERSION=$(VERSION) install: all mkdir -p $(DESTDIR)/var/www/webbox @@ -29,11 +31,13 @@ deb: deb-src: dpkg-source -b . -debs: deb-src - # TODO: build for different OSes +$(DISTROS): deb-src + sudo pbuilder build --basetgz /var/cache/pbuilder/$@.tgz --buildresult result/$@ ../webbox_$(VERSION).dsc ; \ + +debs: $(DISTROS) clean: make -C src clean dh_clean -.PHONY: clean +.PHONY: clean $(DISTROS) diff --git a/src/Makefile b/src/Makefile index 03fbe53..253574f 100644 --- a/src/Makefile +++ b/src/Makefile @@ -2,7 +2,7 @@ ARCH=$(shell dpkg-architecture -qDEB_HOST_MULTIARCH) TARGET=query # gnu++17 since gcc 5 STANDARD=$(shell g++ -std=gnu++17 -E -x c++ - < /dev/null > /dev/null 2>/dev/null && echo "-std=gnu++17" || echo "-std=gnu++14") -CPPFLAGS=-Wall -O2 $(STANDARD) -fPIC -I/usr/include/$(ARCH)/qt5 -I/usr/include/$(ARCH)/qt5/QtCore +CPPFLAGS=-Wall -O2 $(STANDARD) -fPIC -DPROGRAMVERSION=$(VERSION) -I/usr/include/$(ARCH)/qt5 -I/usr/include/$(ARCH)/qt5/QtCore LDFLAGS=-Wall -O2 $(STANDARD) -fPIC LIBS=-lstdc++ -lfcgi -lQt5Core OBJS=webbox.o diff --git a/src/webbox.cpp b/src/webbox.cpp index 4afcb66..46023d9 100644 --- a/src/webbox.cpp +++ b/src/webbox.cpp @@ -13,7 +13,6 @@ #include #include -#define PROGRAMVERSION "1.6" #define BUFSIZE 1000000 // XML special characters: -- cgit v1.2.3