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