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} `find . -name '*~'` 33 -${RM} `find . -name '*.py[co]'` 34 35fullclean: distclean srcclean docsclean 36 37uninstall: 38 -${RM} -r ${HOME}/lib/python/petsc4py 39 -${RM} -r ${HOME}/lib/python/petsc4py-*-py*.egg-info 40 41# ---- 42 43src: src/PETSc.c 44 45srcclean: 46 -${RM} src/petsc4py.PETSc.c 47 -${RM} src/include/petsc4py/petsc4py.PETSc.h 48 -${RM} src/include/petsc4py/petsc4py.PETSc_api.h 49 50CY_SRC_PXD = $(wildcard src/include/petsc4py/*.pxd) 51CY_SRC_PXI = $(wildcard src/PETSc/*.pxi) 52CY_SRC_PYX = $(wildcard src/PETSc/*.pyx) 53src/PETSc.c: src/petsc4py.PETSc.c 54src/petsc4py.PETSc.c: ${CY_SRC_PXD} ${CY_SRC_PXI} ${CY_SRC_PYX} 55 ${PYTHON} ./conf/cythonize.py 56 57cython: 58 ${PYTHON} ./conf/cythonize.py 59 60# ---- 61 62docs: rst2html sphinx epydoc 63 64docsclean: 65 -${RM} docs/*.html docs/*.pdf 66 -${RM} -r docs/usrman docs/apiref 67 68RST2HTML = rst2html 69RST2HTMLOPTS = --no-compact-lists --cloak-email-addresses 70rst2html: 71 ${RST2HTML} ${RST2HTMLOPTS} docs/index.rst > docs/index.html 72 ${RST2HTML} ${RST2HTMLOPTS} LICENSE.txt > docs/LICENSE.html 73 ${RST2HTML} ${RST2HTMLOPTS} HISTORY.txt > docs/HISTORY.html 74 75SPHINXBUILD = sphinx-build 76SPHINXOPTS = 77sphinx: sphinx-html sphinx-pdf 78sphinx-html: 79 ${PYTHON} -c 'import petsc4py.PETSc' 80 mkdir -p build/doctrees docs/usrman 81 ${SPHINXBUILD} -b html -d build/doctrees ${SPHINXOPTS} \ 82 docs/source docs/usrman 83sphinx-pdf: 84 ${PYTHON} -c 'import petsc4py.PETSc' 85 mkdir -p build/doctrees build/latex 86 ${SPHINXBUILD} -b latex -d build/doctrees ${SPHINXOPTS} \ 87 docs/source build/latex 88 ${MAKE} -C build/latex all-pdf > /dev/null 89 mv build/latex/*.pdf docs/ 90 91EPYDOCBUILD = ${PYTHON} ./conf/epydocify.py 92EPYDOCOPTS = 93epydoc: epydoc-html 94epydoc-html: 95 ${PYTHON} -c 'import petsc4py.PETSc' 96 mkdir -p docs/apiref 97 ${EPYDOCBUILD} ${EPYDOCOPTS} -o docs/apiref 98 99# ---- 100