davical/Makefile
Andrew McMillan 336d24eeb6 Improving the sanity of the build procedures. We can now construct a
tidy .tar.gz release with this change.
2007-05-30 22:36:27 +12:00

37 lines
1019 B
Makefile
Executable File

#!/usr/bin/make -f
#
package=rscds
version=$(shell cat VERSION)
all: inc/always.php built-docs
built-docs: docs/api/phpdoc.ini htdocs/*.php inc/*.php
phpdoc -c docs/api/phpdoc.ini
touch built-docs
#
# Insert the current version number into always.php
#
inc/always.php: VERSION inc/always.php.in
sed -e "/^ *.c->version_string *= *'[^']*' *;/ s/^ *.c->version_string *= *'[^']*' *;/\$$c->version_string = '`head -n1 VERSION`';/" <inc/always.php.in >inc/always.php
#
# Build a release .tar.gz file in the directory above us
#
release: built-docs
-ln -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" )
rm $(package)-$(version)
clean:
rm -f built-docs
-find docs/api/* ! -name "phpdoc.ini" ! -name ".gitignore" -delete
-find . -name "*~" -delete
.PHONY: all clean release