File: Makefile

package info (click to toggle)
davical 1.1.12-2.3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 10,020 kB
  • sloc: php: 19,361; sql: 4,514; perl: 3,524; sh: 554; javascript: 162; makefile: 85
file content (88 lines) | stat: -rwxr-xr-x 2,625 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#!/usr/bin/make -f
#

package := davical
majorversion := $(shell sed -n 's:\([0-9\.]*\)[-a-f0-9-]*:\1:p' VERSION)
gitrev := 0
version := $(majorversion)
issnapshot := 0
snapshot : gitrev = $(shell git rev-parse --short HEAD)
snapshot : version = $(majorversion)-git$(gitrev)
snapshot : issnapshot = 1

.PHONY: nodocs
nodocs: htdocs/always.php built-locale

.PHONY: all
all: htdocs/always.php built-docs built-locale

built-docs: docs/phpdoc.ini docs/Doxyfile inc/*.php docs/translation.rst
	doxygen docs/Doxyfile || apigen generate --quiet --title=DAViCal --todo --tree --deprecated -s inc --exclude caldav-client.php -d docs/api || phpdoc -c docs/phpdoc.ini || echo "NOTICE: Failed to build API docs"
	rst2pdf docs/translation.rst || echo "NOTICE: Failed to build ReST docs"
	touch $@

built-locale: po/*.po
	for LOCALE in `ls po/*.po | cut -f2 -d/ | cut -f1 -d.` ; do \
	    [ "$${LOCALE}" = "en" ] && continue; \
	    mkdir -p locale/$${LOCALE}/LC_MESSAGES; \
	    msgfmt po/$${LOCALE}.po -o locale/$${LOCALE}/LC_MESSAGES/davical.mo; \
	done
	touch $@

#
# Insert the current version number into always.php
#
htdocs/always.php: inc/always.php.in scripts/build-always.sh VERSION dba/davical.sql
	scripts/build-always.sh <$< >$@

#
# recreate translations
#
.PHONY: translations
translations:
	scripts/po/rebuild-translations.sh

#
# Build a release .tar.gz file in the directory above us
#
.PHONY: release
release: built-docs VERSION
	-ln -s . $(package)-$(version)
	sed 's:@@VERSION@@:$(majorversion):' davical.spec.in | \
	sed 's:@@ISSNAPSHOT@@:$(issnapshot):' | \
	sed 's:@@GITREV@@:$(gitrev):' > davical.spec
	echo "git ls-files |grep -v '.git'|sed -e s:^:$(package)-$(version)/:"
	tar czf ../$(package)-$(version).tar.gz \
	    --no-recursion --dereference $(package)-$(version) \
	    $(shell git ls-files |grep -v '.git'|sed -e s:^:$(package)-$(version)/:) \
	    $(shell find $(package)-$(version)/docs/api/ ! -name "phpdoc.ini" ) \
	    davical.spec
	rm $(package)-$(version)

.PHONY: snapshot
snapshot: release

.PHONY: test
test:
	@for PHP in htdocs/*.php inc/*.php; do php -l $${PHP} | grep -v 'No syntax errors detected' >> test-syntax; done; \
	    if [ -s test-syntax ]; then \
	    	cat test-syntax >&2; \
		rm test-syntax; \
		exit 1; \
	    else \
		rm test-syntax; \
		echo "OK (Syntax checked)"; \
		exit 0; \
	   fi
	# run phpunit tests
	phpunit testing/phpunit


.PHONY: clean
clean:
	rm -f built-docs built-locale
	rm -rf docs/api locale
	-rm -rf testing/tests/*/diffs testing/tests/*/results testing/tests/*/initial.dbdump
	-find . -name "*~" -delete
	rm -f docs/translation.pdf
	rm -f davical.spec