| 1 | ################################################################################ |
| 2 | # definitions |
| 3 | |
| 4 | VERSNUM := $(shell grep VERSION ChangeLog | head -1 | sed -e "s/VERSION //;s/ .*//") |
| 5 | VERSTAG := $(shell grep VERSION ChangeLog | head -1 | grep 'XX' > /dev/null 2> /dev/null && echo 'beta') |
| 6 | VERSION = $(VERSNUM)$(VERSTAG) |
| 7 | |
| 8 | ################################################################################ |
| 9 | # global targets |
| 10 | |
| 11 | all: build |
| 12 | |
| 13 | build: include/version.inc.php |
| 14 | |
| 15 | test: |
| 16 | phpunit pltestsuite classes/pltestsuite.php |
| 17 | |
| 18 | clean: |
| 19 | -rm include/version.inc.php |
| 20 | |
| 21 | q: |
| 22 | @echo -e "Code statistics\n" |
| 23 | @sloccount $(wildcard */) 2> /dev/null | egrep '^[a-z]*:' |
| 24 | |
| 25 | ################################################################################ |
| 26 | # targets |
| 27 | |
| 28 | %: %.in Makefile ChangeLog |
| 29 | sed -e 's,@VERSION@,$(VERSION),g' $< > $@ |
| 30 | |
| 31 | include/version.inc.php: Makefile ChangeLog |
| 32 | echo '<?php define("PLATAL_CORE_VERSION", "${VERSION}"); ?>' > $@ |
| 33 | |
| 34 | .PHONY: build dist clean q test |