/
Makefile
39 lines (32 loc) · 1.06 KB
/
Makefile
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
NAME=Pylogeny
PKG=pylogeny
DOCS=docs
FILES=$(shell find ${PKG} -type f -iname "*.py")
VER=$(shell python -c "from ${PKG}.__version__ import VERSION; print VERSION")
DIST=sdist upload
SDOC=sphinx-apidoc
PY=python
.PHONY: check_environment build tests install dist docs clean
build: ${FILES} setup.py
${PY} setup.py build
install: build
-pip uninstall ${PKG}
${PY} setup.py install
dist: build
${PY} setup.py ${DIST}
docs: ${FILES} check_environment install
${SDOC} -F -e -H ${NAME} -A "Alex Safatli" -V ${VER} -R ${VER} -o ${DOCS} ${PKG}
@cd ${DOCS} && cat conf >> conf.py && make html && make latex && make latexpdf
cp -r ${DOCS}/_build/html/* $(GH_DOC_REPO)
cp ${DOCS}/_build/latex/*.pdf docs/api.pdf
@cd $(GH_DOC_REPO) && git add * && git commit -m "Version ${VER} documentation." && git push origin gh-pages
tests:
${PY} tests/allTests.py
clean:
-find ${DOCS} -type f -not -name api.pdf -not -name conf -delete
-find . -type f -name *.pyc -delete
-rm -r build dist ${PKG}.egg-info
check_environment:
ifndef GH_DOC_REPO
$(error GH_DOC_REPO is undefined)
endif