summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorRoland Reichwein <mail@reichwein.it>2020-05-30 22:56:23 +0200
committerRoland Reichwein <mail@reichwein.it>2020-05-30 22:56:23 +0200
commit9ca1bd5cdaeb199c99faa892fe4911a85e9fbe29 (patch)
tree4335bae6ea1b9a5e585ecb7742f319b1b11a7fa2
parente6738712c230927b2edd88c3a6ba66adcb156746 (diff)
Adjust Makefile and debian/control
-rwxr-xr-xMakefile62
-rw-r--r--debian/control2
2 files changed, 50 insertions, 14 deletions
diff --git a/Makefile b/Makefile
index 657afe5..704dc44 100755
--- a/Makefile
+++ b/Makefile
@@ -4,20 +4,45 @@
# Environment: Debian
#
-#CC=gcc-9
-#CXX=g++-9
-CC=clang-10
+DISTROS=debian10 ubuntu1910 ubuntu2004
+VERSION=$(shell dpkg-parsechangelog --show-field Version)
+
CXX=clang++-10
-LIBS=-lfcgi
+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.
-CFLAGS=-Wall -g -O2 -fPIC
-CPPFLAGS=-Wall -g -O2 -fPIC -std=c++17 -Wpedantic
+CXXFLAGS=-Wall -g -O2 -fPIC -std=c++17 -Wpedantic
HEADERS=file.h
SOURCES=$(HEADERS:.h=.cpp)
OBJECTS=$(HEADERS:.h=.o)
TARGETS=downtube.fcgi
+ifeq ($(CXX),clang++-10)
+LIBS+= \
+-fuse-ld=lld-10 \
+-lstdc++
+#-lc++ \
+#-lc++abi
+#-lc++fs
+#-lstdc++fs
+else
+LIBS+= \
+-lstdc++ \
+-lstdc++fs
+endif
+
build: $(TARGETS)
all: build
@@ -28,27 +53,38 @@ install:
cp downtube.fcgi $(DESTDIR)/usr/lib/downtube/
mkdir -p $(DESTDIR)/usr/lib/downtube/html
- cp -r html/* $(DESTDIR)/usr/lib/downtube/html/
+ cp -r html/* $(DESTDIR)/usr/lib/downtube/html/
- uglifyjs html/downtube.js -m -c > $(DESTDIR)/usr/lib/downtube/html/downtube.js
- htmlmin html/index.html $(DESTDIR)/usr/lib/downtube/html/index.html
- cleancss -o $(DESTDIR)/usr/lib/downtube/html/downtube.css html/downtube.css
+ uglifyjs html/downtube.js -m -c > $(DESTDIR)/usr/lib/downtube/html/downtube.js
+ htmlmin html/index.html $(DESTDIR)/usr/lib/downtube/html/index.html
+ cleancss -o $(DESTDIR)/usr/lib/downtube/html/downtube.css html/downtube.css
downtube.fcgi: $(OBJECTS)
# link
%.fcgi: %.o
- $(CXX) $(CPPFLAGS) $(LIBS) -o $@ $^
+ $(CXX) $(LDFLAGS) $^ $(LDLIBS) $(LIBS) -o $@
# .cpp -> .o
%.o: %.cpp
- $(CXX) $(CPPFLAGS) $(INCLUDES) -c $< -o $@
+ $(CXX) $(CXXFLAGS) $(INCLUDES) -c $< -o $@
clean:
- rm -f *.o *.fcgi
+ -rm -f *.o *.fcgi
deb:
dpkg-buildpackage
+deb-src: clean
+ dh_clean
+ dh_auto_clean
+ dpkg-source -b -I.git -Iresult .
+
+$(DISTROS): deb-src
+ sudo pbuilder build --basetgz /var/cache/pbuilder/$@.tgz --buildresult result/$@ ../downtube_$(VERSION).dsc
+ debsign result/$@/downtube_$(VERSION)_amd64.changes
+
+debs: $(DISTROS)
+
.PHONY: clean
diff --git a/debian/control b/debian/control
index 09493df..854fb77 100644
--- a/debian/control
+++ b/debian/control
@@ -2,7 +2,7 @@ Source: downtube
Section: web
Priority: optional
Maintainer: Roland Reichwein <mail@reichwein.it>
-Build-Depends: debhelper (>= 12), libboost-all-dev | libboost1.71-all-dev, clang | g++-9, node-uglify, python3-pkg-resources, htmlmin, cleancss
+Build-Depends: debhelper (>= 12), libboost-all-dev | libboost1.71-all-dev, clang | g++-9, node-uglify, python3-pkg-resources, htmlmin, cleancss, libfcgi-dev
Standards-Version: 4.5.0
Homepage: http://www.reichwein.it/downtube/