diff options
Diffstat (limited to 'Makefile')
-rwxr-xr-x | Makefile | 62 |
1 files changed, 49 insertions, 13 deletions
@@ -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 |