include common.mk PROJECTNAME=weblog DISTROS=debian11 TGZNAME=$(PROJECTNAME)-$(VERSION).tar.xz LDLIBS=\ -lfcgi \ -lreichwein \ -lfmt \ -lboost_context \ -lboost_coroutine \ -lboost_program_options \ -lboost_system \ -lboost_thread \ -lboost_filesystem \ -lboost_regex \ -lpthread \ -ldl SRC=\ weblog.cpp config.cpp main.cpp default: $(PROJECTNAME) all: default webapp-runner ::1:9019 ./$(PROJECTNAME) -c $(PROJECTNAME).conf $(PROJECTNAME): $(SRC:.cpp=.o) $(CXX) $(LDFLAGS) $^ $(LDLIBS) $(LIBS) -o $@ %.d: %.cpp $(CXX) $(CXXFLAGS) -MM -MP -MF $@ -c $< %.o: %.cpp %.d $(CXX) $(CXXFLAGS) -c $< -o $@ # dependencies ADD_DEP=Makefile install: mkdir -p $(DESTDIR)/usr/bin cp $(PROJECTNAME) $(DESTDIR)/usr/bin/ mkdir -p $(DESTDIR)/etc cp weblog.conf $(DESTDIR)/etc deb: dpkg-buildpackage debs: $(DISTROS) 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/$@ ../$(PROJECTNAME)_$(VERSION).dsc debsign result/$@/$(PROJECTNAME)_$(VERSION)_amd64.changes DISTFILES=$(shell git ls-files 2>/dev/null) dist: clean rm -rf $(PROJECTNAME)-$(VERSION) mkdir $(PROJECTNAME)-$(VERSION) cp --parents -r $(DISTFILES) $(PROJECTNAME)-$(VERSION) tar cfJ ../$(PROJECTNAME)-$(VERSION).tar.xz $(PROJECTNAME)-$(VERSION) rm -rf $(PROJECTNAME)-$(VERSION) ls -l ../$(PROJECTNAME)-$(VERSION).tar.xz upload: dist scp ../$(TGZNAME) antcom.de:/var/www/reichwein.it-download/ scp -r result antcom.de: scp -r remote-install.sh antcom.de: ssh antcom.de ./remote-install.sh $(PROJECTNAME) $(VERSION) ssh antcom.de rm -rf remote-install.sh result # misc --------------------------------------------------- clean: -rm -f *.o *.d $(PROJECTNAME) .PHONY: clean install all -include $(wildcard $(SRC:.cpp=.d))