X-Git-Url: https://git.rrq.au/?a=blobdiff_plain;f=Makefile;h=b5bcebdb7b92c27f0287e463189021aadd52e815;hb=7b4838575da113a564a1cd8fe386121de7400563;hp=17745a12e6a065dfeee5c2846c80737d4f357fe7;hpb=71a0489975b6126f6a3129d1837b63912c4c427a;p=rrq%2Fhourglass.git diff --git a/Makefile b/Makefile index 17745a1..b5bcebd 100644 --- a/Makefile +++ b/Makefile @@ -1,29 +1,72 @@ MAIN = command.lsp LSP = $(filter-out $(MAIN),$(wildcard *.lsp)) -BIN = hourglass hourglass-web +BIN = hourglass hourglass-web hourglass-site DOCS = hourglass-guide.html hourglass-guide.pdf +MANPGS = hourglass.8 hourglass-site.8 hourglass-web.8 +IMGS = $(wildcard *.png) OTHER = setup.sh hourglass.conf VERSION = 0.1 +GENERATED = $(BIN) $(DOCS) $(MANPGS) -dist: hourglass-$(VERSION).tgz +default: dist hourglass: $(MAIN) $(LSP) packnl -w $@ $^ -hourglass-web: +hourglass-web: manager siteconfig.lsp $(MAKE) -C manager mv manager/$@ $@ -hourglass-$(VERSION).tgz: $(BIN) $(OTHER) $(DOCS) - tar czf $@ $^ +hourglass-site: sitetool + $(MAKE) -C sitetool + mv sitetool/sitetool $@ %.html: %.adoc - asciidoctor $< > $@ + asciidoctor -a 'webfonts!' $< > $@ -hourglass-guide.pdf: $(wildcard *.png) - -%.pdf: %.adoc +%.pdf: %.adoc | $(IMGS) asciidoctor-pdf $< > $@ +%.8: %.8.adoc + a2x -d manpage -f manpage $^ + +############################################################ clean: - rm -f $(BIN) hourglass-$(VERSION).tgz + $(MAKE) -C manager clean + $(MAKE) -C sitetool clean + rm -f $(GENERATED) + +############################################################ +hourglass-$(VERSION).tgz: $(BIN) $(OTHER) $(DOCS) $(MANPGS) $(IMGS) + tar czf $@ $^ + +dist: hourglass-$(VERSION).tgz + +######################################################## +BINDIR = $(DESTDIR)/usr/bin +MANDIR = $(DESTDIR)/usr/share/man/man8 +RUNDIR = $(DESTDIR)/var/lib/hourglass +DOCDIR = $(DESTDIR)/usr/share/hourglass + +INSTALLTARGETS = $(addprefix $(BINDIR)/,$(BIN)) +INSTALLTARGETS += $(addprefix $(MANDIR)/,$(MANPGS)) +INSTALLTARGETS += $(addprefix $(DOCDIR)/,$(DOCS)) +INSTALLTARGETS += $(addprefix $(RUNDIR)/,$(OTHER)) + +$(RUNDIR)/%.conf: %.conf + install -D -T $< $@ + chmod a-x $@ + +$(MANDIR)/% $(DOCDIR)/%:% + install -D -T $< $@ + chmod a-x $@ + +$(BINDIR)/% $(RUNDIR)/%: % + install -D -T $< $@ + +install: $(INSTALLTARGETS) + +BUILDPACKAGE = -us -uc --build=full + +deb: + PREFIX= INCLUDE_PREFIX=/usr dpkg-buildpackage $(BUILDPACKAGE)