Mention Weather plugin.
[supybook.git] / Makefile
blobc777dd397476e34e024f6c49d025cb4851bf522c
1 PARAMS=-a toc -a toclevels=3 -a date=$(shell date +%Y-%m-%d) -a numbered -d book
2 ifdef VERSION
3 REVISION=$(VERSION)
4 endif
5 ifdef REVISION
6 PARAMS+=-a revision=$(REVISION)
7 else
8 PARAMS+=-a revision=$(shell git describe)$(shell git diff-index HEAD |grep '' > /dev/null && echo '+dirty')
9 endif
11 # local optional makefile for deploying
12 # WEBDIR=/path/to/supybook.fealdia.org/
13 WEBDIR=
14 -include Makefile.local
16 DISTFILES=index.txt index.html Makefile index.pdf
18 all: html deploy
20 html: index.html
22 pdf: index.pdf
24 have-version:
25 ifndef VERSION
26 @echo "Usage: make release VERSION=x"
27 @false
28 else
29 @echo "Version: $(VERSION)"
30 endif
32 have-webdir:
33 ifeq ($(WEBDIR),)
34 @echo "No Makefile.local, skipping deploy"
35 @false
36 else
37 @echo "Using WEBDIR $(WEBDIR)"
38 endif
40 release: have-version clean html pdf
41 tar --owner=0 --group=0 --transform 's!^!supybook-$(VERSION)/!' -zcf supybook-$(VERSION).tar.gz $(DISTFILES)
43 %.html: %.txt
44 asciidoc $(PARAMS) $<
46 %.pdf: %.txt
47 a2x $(PARAMS) -f pdf $<
49 clean:
50 @$(RM) index.html index.pdf
52 deploy: have-webdir html
53 @echo "Deploying to $(WEBDIR)"
54 cp index.html $(WEBDIR)/devel/index.html
56 deploy-release: have-webdir release
57 mkdir $(WEBDIR)/$(VERSION)
58 cp -t $(WEBDIR)/$(VERSION)/ $(DISTFILES)
59 cp supybook-$(VERSION).tar.gz $(WEBDIR)/download/
60 @echo "Remember to modify $(WEBDIR)/index.html manually"
62 .PHONY: all deploy have-version have-webdir pdf release release-tar