Fix getctag replacement in this test.
[davical.git] / Makefile
blob56002fc7b8c3dfaaab719126134955591b54c4a6
1 #!/usr/bin/make -f
4 package := davical
5 majorversion := $(shell sed -n 's:\([0-9\.]*\)[-a-f0-9-]*:\1:p' VERSION)
6 gitrev := 0
7 version := $(majorversion)
8 issnapshot := 0
9 snapshot : gitrev = $(shell git rev-parse --short HEAD)
10 snapshot : version = $(majorversion)-git$(gitrev)
11 snapshot : issnapshot = 1
13 .PHONY: nodocs
14 nodocs: htdocs/always.php built-po
16 .PHONY: all
17 all: htdocs/always.php built-docs built-po
19 built-docs: docs/api/phpdoc.ini htdocs/*.php inc/*.php docs/translation.rst
20 phpdoc -c docs/api/phpdoc.ini || echo "NOTICE: Failed to build optional API docs"
21 rst2pdf docs/translation.rst || echo "NOTICE: Failed to build ReST docs"
22 touch $@
24 built-po: htdocs/always.php scripts/po/rebuild-translations.sh po/*.po
25 scripts/po/rebuild-translations.sh
26 touch $@
29 # Insert the current version number into always.php
31 htdocs/always.php: inc/always.php.in scripts/build-always.sh VERSION dba/davical.sql
32 scripts/build-always.sh <$< >$@
35 # Build a release .tar.gz file in the directory above us
37 .PHONY: release
38 release: built-docs VERSION
39 -ln -s . $(package)-$(version)
40 sed 's:@@VERSION@@:$(majorversion):' davical.spec.in | \
41 sed 's:@@ISSNAPSHOT@@:$(issnapshot):' | \
42 sed 's:@@GITREV@@:$(gitrev):' > davical.spec
43 echo "git ls-files |grep -v '.git'|sed -e s:^:$(package)-$(version)/:"
44 tar czf ../$(package)-$(version).tar.gz \
45 --no-recursion --dereference $(package)-$(version) \
46 $(shell git ls-files |grep -v '.git'|sed -e s:^:$(package)-$(version)/:) \
47 $(shell find $(package)-$(version)/docs/api/ ! -name "phpdoc.ini" ) \
48 davical.spec
49 rm $(package)-$(version)
51 .PHONY: snapshot
52 snapshot: release
54 .PHONY: clean
55 clean:
56 rm -f built-docs built-po
57 -find . -name "*~" -delete
58 -rm docs/translation.pdf
59 -rm davical.spec
61 .PHONY: clean-all
62 clean-all: clean
63 -find docs/api/* ! -name "phpdoc.ini" ! -name ".gitignore" -delete