xref: /petsc/makefile (revision 7dd4b89e7493a54ce263f1cc517556d756b198c8)
1.PHONY: default \
2	config build test install sdist \
3	docs rst2html sphinx sphinx-html sphinx-pdf epydoc epydoc-html \
4	clean distclean srcclean docsclean fullclean uninstall
5
6PYTHON = python
7
8default: build
9
10config:
11	${PYTHON} setup.py config ${CONFIGOPT}
12
13build:
14	${PYTHON} setup.py build ${BUILDOPT}
15
16test:
17	${MPIEXEC} ${VALGRIND} ${PYTHON} test/runtests.py < /dev/null
18
19install: build
20	${PYTHON} setup.py install ${INSTALLOPT} --home=${HOME}
21
22sdist: docs
23	${PYTHON} setup.py sdist ${SDISTOPT}
24
25clean:
26	${PYTHON} setup.py clean --all
27
28distclean: clean
29	-${RM} -r build  _configtest.* *.py[co]
30	-${RM} -r MANIFEST dist petsc4py.egg-info
31	-${RM} -r `find . -name '__pycache__'`
32	-${RM} `find . -name '*.py[co]'`
33	-${RM} `find . -name '*~'`
34
35srcclean:
36	-${RM} src/petsc4py.PETSc.c
37	-${RM} src/include/petsc4py/petsc4py.PETSc.h
38	-${RM} src/include/petsc4py/petsc4py.PETSc_api.h
39
40fullclean: distclean srcclean docsclean
41
42uninstall:
43	-${RM} -r ${HOME}/lib/python/petsc4py
44	-${RM} -r ${HOME}/lib/python/petsc4py-*-py*.egg-info
45
46# ----
47
48docs: rst2html sphinx epydoc
49
50docsclean:
51	-${RM} docs/*.html docs/*.pdf
52	-${RM} -r docs/usrman docs/apiref
53
54RST2HTML = rst2html
55RST2HTMLOPTS = --no-compact-lists --cloak-email-addresses
56rst2html:
57	${RST2HTML} ${RST2HTMLOPTS} docs/index.rst > docs/index.html
58	${RST2HTML} ${RST2HTMLOPTS} LICENSE.txt    > docs/LICENSE.html
59	${RST2HTML} ${RST2HTMLOPTS} HISTORY.txt    > docs/HISTORY.html
60
61SPHINXBUILD = sphinx-build
62SPHINXOPTS  =
63sphinx: sphinx-html sphinx-pdf
64sphinx-html:
65	${PYTHON} -c 'import petsc4py.PETSc'
66	mkdir -p build/doctrees docs/usrman
67	${SPHINXBUILD} -b html -d build/doctrees ${SPHINXOPTS} \
68	docs/source docs/usrman
69sphinx-pdf:
70	${PYTHON} -c 'import petsc4py.PETSc'
71	mkdir -p build/doctrees build/latex
72	${SPHINXBUILD} -b latex -d build/doctrees ${SPHINXOPTS} \
73	docs/source build/latex
74	${MAKE} -C build/latex all-pdf > /dev/null
75	mv build/latex/*.pdf docs/
76
77EPYDOCBUILD = ${PYTHON} ./conf/epydocify.py
78EPYDOCOPTS  =
79epydoc: epydoc-html
80epydoc-html:
81	${PYTHON} -c 'import petsc4py.PETSc'
82	mkdir -p docs/apiref
83	${EPYDOCBUILD} ${EPYDOCOPTS} -o docs/apiref
84
85# ----
86