# This Makefile is used to build documentation in the gh-pages branch. .PHONY: all gh-pages eunit edoc all: @echo "Do 'make gh-pages' to commit in the gh-pages branch containing" @echo "the generated EDoc and the EUnit coverage report." edoc: rebar doc eunit: rebar eunit | tee .eunit/output # Build eunit.html containing the coverage report and the eunit output. doc/eunit.html: eunit (echo '' ; \ cat .eunit/index.html | sed 's!!!' ; \ echo '

Output

' ; \
	 sed 's/&/\&/g; s//\>/g;' .eunit/output ; \
	 echo '
' ; \ echo '

Generated using EUnit,' ; \ date -u '+%d %h %Y %H:%M:%S UTC.' ; \ echo '

' ; \ echo '') > doc/eunit.html # Update the local 'gh-pages' branch with pregenerated output files # (trick from https://groups.google.com/forum/#!topic/github/XYxkdzxpgCo) gh-pages: doc/eunit.html edoc @if [ $$(git name-rev --name-only HEAD) != master ] ; then \ echo "Not on master. Aborting." ; \ false ; \ fi cp .eunit/*.COVER.html doc/ git update-ref refs/heads/gh-pages origin/gh-pages '' 2>/dev/null || true GIT_INDEX_FILE=gitindex.tmp; export GIT_INDEX_FILE; \ rm -f $${GIT_INDEX_FILE} && \ git add -f doc/*.html doc/stylesheet.css doc/erlang.png && \ git update-ref refs/heads/gh-pages \ $$(echo "Autogenerated html pages for $$(git describe)" \ | git commit-tree $$(git write-tree --prefix=doc) \ -p refs/heads/gh-pages) rm gitindex.tmp @echo "=== Done ===" # Credits: #