2016-06-12 20:13:58 +00:00
|
|
|
.DEFAULT_GOAL := peppermint
|
|
|
|
|
2016-06-15 18:21:45 +00:00
|
|
|
.PHONY: setupApiDoc peppermint docs gh-pages
|
2016-06-12 20:13:58 +00:00
|
|
|
|
2016-06-13 05:41:29 +00:00
|
|
|
ApiDocPresent := $(shell sh -c apidoc --help 1\>/dev/null && rm -rf doc/)
|
2016-06-12 20:13:58 +00:00
|
|
|
|
|
|
|
peppermint:
|
|
|
|
@echo [peppermint/build] Rebuilding Pepperminty Wiki
|
|
|
|
php build.php
|
|
|
|
|
|
|
|
docs: setupApiDoc
|
|
|
|
@echo [peppermint/docs] Building docs
|
2016-10-19 19:51:53 +00:00
|
|
|
apidoc -o './RestApiDocs/' --config apidoc.json -f '.*\.php' -e index.php
|
2016-06-12 20:15:09 +00:00
|
|
|
rm -rf doc/
|
2016-06-12 20:13:58 +00:00
|
|
|
|
|
|
|
setupApiDoc:
|
|
|
|
@echo [peppermint] Checking for apiDoc
|
|
|
|
ifndef ApiDocPresent
|
|
|
|
@echo [peppermint] Attempting to install ApiDoc, since it wasn't detected in your PATH
|
|
|
|
@echo [peppermint] Note that you may need to be root, and you'll need npm installed.
|
|
|
|
npm install apidoc --global
|
|
|
|
endif
|
|
|
|
@echo [peppermint] Check complete
|
2016-06-15 18:21:45 +00:00
|
|
|
|
|
|
|
gh-pages:
|
2016-06-15 18:29:48 +00:00
|
|
|
@echo [peppermint/gh-pages] Syncing master branch with gh-pages branch.
|
|
|
|
@echo [peppermint/gh-pages] Making sure the working directory is clean.
|
|
|
|
# From http://unix.stackexchange.com/a/155077/64687
|
|
|
|
git diff --exit-code
|
2016-06-15 18:32:54 +00:00
|
|
|
git diff --cached --exit-code
|
2016-06-15 18:29:48 +00:00
|
|
|
|
2016-06-15 18:21:45 +00:00
|
|
|
git checkout gh-pages
|
|
|
|
git rebase master
|
|
|
|
git push origin gh-pages
|
|
|
|
git checkout master
|
|
|
|
@echo '[peppermint/gh-pages] Sync complete.'
|