xref: /petsc/makefile (revision aa0c092eef4d415ca5c1997c2f3094649a005ee0)
111b6ed10SLois Curfman McInnes#
261108934SBarry Smith# This is the makefile for installing PETSc. See
361108934SBarry Smith# http://www.mcs.anl.gov/petsc/petsc-2/documentation/installation.html for directions on installing PETSc.
4cfd69a58SBarry Smith# See also bmake/common for additional commands.
511b6ed10SLois Curfman McInnes#
6716b9c40SSatish BalayALL: all
748b2c0e9SBarry SmithLOCDIR = .
8de21bb36SSatish BalayDIRS   = src include
961523587SBarry Smith
10516d1546SSatish Balayinclude ${PETSC_DIR}/bmake/common/base
11516d1546SSatish Balayinclude ${PETSC_DIR}/bmake/common/test
1261523587SBarry Smith
13ca5c9d59SMatthew Knepley#
143677444aSSatish Balay# Basic targets to build PETSc libraries.
15fa527775SLois Curfman McInnes# all: builds the c, fortran, and f90 libraries
16b5fa40b8SBarry Smithall:
17b5fa40b8SBarry Smith	@${OMAKE}  PETSC_ARCH=${PETSC_ARCH} BOPT=${BOPT} chkpetsc_dir
1829cdbbc8SSatish Balay	-@${OMAKE} all_build 2>&1 | tee make_log_${PETSC_ARCH}_${BOPT}
1975910670SSatish Balayall_build: chk_petsc_dir chk_default_bopt info info_h chklib_dir deletelibs chk_fortranstubs blaslapack mpich build shared
20efd74e9bSBarry Smith#
21fa527775SLois Curfman McInnes# Prints information about the system and version of PETSc being compiled
22efd74e9bSBarry Smith#
23efd74e9bSBarry Smithinfo:
24efd74e9bSBarry Smith	-@echo "=========================================="
2511b6dc0cSBarry Smith	-@echo " "
26d76296fbSBarry Smith	-@echo "See docs/troubleshooting.html and docs/bugreporting.html"
27d76296fbSBarry Smith	-@echo "for help with installation problems. Please send EVERYTHING"
28d76296fbSBarry Smith	-@echo "printed out below when reporting problems"
2911b6dc0cSBarry Smith	-@echo " "
3011b6dc0cSBarry Smith	-@echo "To subscribe to the PETSc users mailing list, send mail to "
3111b6dc0cSBarry Smith	-@echo "majordomo@mcs.anl.gov with the message: "
328b6f49e5SSatish Balay	-@echo "subscribe petsc-announce"
3311b6dc0cSBarry Smith	-@echo " "
34d76296fbSBarry Smith	-@echo "=========================================="
351d91fb6eSBarry Smith	-@echo On `date` on `hostname`
3630fdcc7aSBarry Smith	-@echo Machine characteristics: `uname -a`
37efd74e9bSBarry Smith	-@echo "-----------------------------------------"
38e481929fSSatish Balay	-@echo "Using PETSc directory: ${PETSC_DIR}"
39e481929fSSatish Balay	-@echo "Using PETSc arch: ${PETSC_ARCH}"
4047794344SBarry Smith	-@echo "-----------------------------------------"
41bdd8b494SSatish Balay	-@grep "define PETSC_VERSION" ${PETSC_DIR}/include/petscversion.h | ${SED} "s/........//"
42f265ae5cSBarry Smith	-@echo "-----------------------------------------"
43e0e703c1SSatish Balay	-@echo "Using configuration flags:"
4419552e71SMatthew Knepley	-@grep "\#define " ${PETSC_DIR}/bmake/${PETSC_ARCH}/petscconf.h
4547794344SBarry Smith	-@echo "-----------------------------------------"
46d77bb2e1SSatish Balay	-@echo "Using include paths: ${PETSC_INCLUDE}"
47e481929fSSatish Balay	-@echo "Using PETSc flags: ${PETSCFLAGS} ${PCONF}"
48efd74e9bSBarry Smith	-@echo "------------------------------------------"
49e481929fSSatish Balay	-@echo "Using C/C++ compiler: ${CC} ${COPTFLAGS} ${CCPPFLAGS}"
50e481929fSSatish Balay	-@echo "C/C++ Compiler version: " `${CCV}`
51e481929fSSatish Balay	-@if [ "${FC}" != "" ]; then \
52e481929fSSatish Balay	   echo "Using Fortran compiler: ${FC} ${FOPTFLAGS} ${FCPPFLAGS}";\
53e481929fSSatish Balay	   echo "Fortran Compiler version: " `${FCV}`;\
54e481929fSSatish Balay         fi
55e481929fSSatish Balay	-@echo "-----------------------------------------"
564a44a727SBarry Smith	-@echo "Using C/C++ linker: ${CLINKER}"
57e481929fSSatish Balay	-@if [ "${FC}" != "" ]; then \
58e6ee457dSBarry Smith	   echo "Using Fortran linker: ${FLINKER}";\
59e6ee457dSBarry Smith         fi
60e481929fSSatish Balay	-@echo "-----------------------------------------"
61f2b01315SBarry Smith	-@echo "Using libraries: ${PETSC_LIB}"
62e3353558SSatish Balay	-@echo "------------------------------------------"
63e3353558SSatish Balay	-@echo "Using mpirun: ${MPIRUN}"
64efd74e9bSBarry Smith	-@echo "=========================================="
65b8d81f61SBarry Smith#
66b8d81f61SBarry Smith#
6719552e71SMatthew KnepleyMINFO = ${PETSC_DIR}/bmake/${PETSC_ARCH}/petscmachineinfo.h
68b8d81f61SBarry Smithinfo_h:
69ddbfe947SBarry Smith	-@$(RM) -f MINFO ${MINFO}
702fc52814SBarry Smith	-@echo  "static const char *petscmachineinfo = \"  " >> MINFO
7134a92de5SBarry Smith	-@echo  "Libraries compiled on `date` on `hostname` " >> MINFO
72c5e9c7dfSBarry Smith	-@echo  Machine characteristics: `uname -a` "" >> MINFO
73f6a9982fSBarry Smith	-@echo  "Using PETSc directory: ${PETSC_DIR}" >> MINFO
7419552e71SMatthew Knepley	-@echo  "Using PETSc arch: ${PETSC_ARCH}" >> MINFO
7593520af8SSatish Balay	-@echo  "-----------------------------------------\"; " >> MINFO
762fc52814SBarry Smith	-@echo  "static const char *petsccompilerinfo = \"  " >> MINFO
775323642bSKris Buschelman	-@echo  "Using C compiler: ${C_CC} ${COPTFLAGS} ${CCPPFLAGS} " >> MINFO
78dffd13fbSMatthew Knepley	-@echo  "C Compiler version:"  >> MINFO ; ${C_CCV} >> MINFO 2>&1 ; true
79dffd13fbSMatthew Knepley	-@echo  "C++ Compiler version:"  >> MINFO; ${CXX_CCV} >> MINFO 2>&1 ; true
805323642bSKris Buschelman	-@echo  "Using Fortran compiler: ${C_FC} ${FOPTFLAGS} ${FCPPFLAGS}" >> MINFO
81dffd13fbSMatthew Knepley	-@echo  "Fortran Compiler version:" >> MINFO ; ${C_FCV} >> MINFO 2>&1 ; true
8293520af8SSatish Balay	-@echo  "-----------------------------------------\"; " >> MINFO
832fc52814SBarry Smith	-@echo  "static const char *petsccompilerflagsinfo = \"  " >> MINFO
84c5e9c7dfSBarry Smith	-@echo  "Using PETSc flags: ${PETSCFLAGS} ${PCONF}" >> MINFO
85c5e9c7dfSBarry Smith	-@echo  "-----------------------------------------" >> MINFO
86c5e9c7dfSBarry Smith	-@echo  "Using configuration flags:" >> MINFO
87c5e9c7dfSBarry Smith	-@echo  "-----------------------------------------" >> MINFO
88c5e9c7dfSBarry Smith	-@echo  "Using include paths: ${PETSC_INCLUDE}" >> MINFO
8993520af8SSatish Balay	-@echo  "------------------------------------------\"; " >> MINFO
902fc52814SBarry Smith	-@echo  "static const char *petsclinkerinfo = \"  " >> MINFO
91c5e9c7dfSBarry Smith	-@echo  "Using C linker: ${CLINKER}" >> MINFO
92c5e9c7dfSBarry Smith	-@echo  "Using Fortran linker: ${FLINKER}" >> MINFO
9393520af8SSatish Balay	-@echo  "Using libraries: ${PETSC_LIB} \"; " >> MINFO
94a2d9a622SKris Buschelman	-@cat MINFO | ${SED} -e 's/\^M//g' | ${SED} -e 's/\\/\\\\/g' | ${SED} -e 's/$$/ \\n\\/' | sed -e 's/\;  \\n\\/\;/'> MINFO_
95*aa0c092eSKris Buschelman	-@cat MINFO_ | ${SED} -e 's/\
96*aa0c092eSKris Buschelman//g'  > /dev/null; foobar=$$?; \
97a2d9a622SKris Buschelman          if [ "$$foobar" = "0" ]; then \
98a2d9a622SKris Buschelman	    cat MINFO_ | ${SED} -e 's/\
99a2d9a622SKris Buschelman//g' > ${MINFO}; \
100f194edaeSKris Buschelman          else cat MINFO | ${SED} -e 's/\^M//g' | ${SED} -e 's/\\/\\\\/g' | ${SED} -e 's/$$/ \\n\\/' | sed -e 's/\;  \\n\\/\;/'> ${MINFO}; \
101ce0f4ea0SKris Buschelman          fi
1023677444aSSatish Balay	-@$(RM) MINFO MINFO_
103fa527775SLois Curfman McInnes
104fa527775SLois Curfman McInnes#
105f6a9982fSBarry Smith# Builds the PETSc libraries
1063677444aSSatish Balay# This target also builds fortran77 and f90 interface
107f6a9982fSBarry Smith# files and compiles .F files
108efd74e9bSBarry Smith#
10947794344SBarry Smithbuild:
11044ecba3fSMatthew Knepley	-@echo "BEGINNING TO COMPILE LIBRARIES IN ALL DIRECTORIES"
1115fde6e02SSatish Balay	-@echo "========================================="
1120b3634f8SBarry Smith	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=libfast tree
11347794344SBarry Smith	-@${RANLIB} ${PETSC_LIB_DIR}/*.${LIB_SUFFIX}
11435ca7349SBarry Smith	-@echo "Completed building libraries"
115c8fd01ffSBarry Smith	-@echo "========================================="
116c8fd01ffSBarry Smith#
117f10764d3SBarry Smith#  Compiles the blas and lapack source code if found
118c8fd01ffSBarry Smithblaslapack:
119c8fd01ffSBarry Smith	-@if [ -d packages/f2cblaslapack/${PETSC_ARCH} -a ! -s packages/f2cblaslapack/${PETSC_ARCH}/libf2cblas.a ] ; then cd packages/f2cblaslapack;\
120c8fd01ffSBarry Smith        echo "=========================================";\
121c8fd01ffSBarry Smith        echo "Building C Blas/Lapack libraries";\
12282fb4bcfSBarry Smith        ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ;\
123c8fd01ffSBarry Smith        ${MV} libf2cblas.a libf2clapack.a ${PETSC_ARCH};\
124c8fd01ffSBarry Smith        ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} cleanblaslapack ;\
125f10764d3SBarry Smith        echo "Completed C building Blas/Lapack libraries";\
126c8fd01ffSBarry Smith        echo "========================================="; fi
127c8fd01ffSBarry Smith	-@if [ -d packages/fblaslapack/${PETSC_ARCH} -a ! -s packages/fblaslapack/${PETSC_ARCH}/libfblas.a ] ; then cd packages/fblaslapack;\
128c8fd01ffSBarry Smith        echo "=========================================";\
129c8fd01ffSBarry Smith        echo "Building Fortran Blas/Lapack libraries";\
13082fb4bcfSBarry Smith        ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ;\
131c8fd01ffSBarry Smith        ${MV} libfblas.a libflapack.a ${PETSC_ARCH};\
132c8fd01ffSBarry Smith        ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} cleanblaslapck ;\
133c8fd01ffSBarry Smith        echo "Completed building Fortran Blas/Lapack libraries";\
1346f02d409SBarry Smith        echo "========================================="; fi
1356f02d409SBarry Smith#
136f10764d3SBarry Smith#  Compiles MPICH if found
137f10764d3SBarry Smithmpich:
1386f02d409SBarry Smith	-@releasename=`ls -d packages/mpich* 2> /dev/null`;\
1396f02d409SBarry Smith        if [ -d packages/$${releasename}/${PETSC_ARCH} -a ! -d packages/$${releasename}/${PETSC_ARCH}/lib ] ; then cd packages/$${releasename} ;\
1406f02d409SBarry Smith          echo "=========================================";\
1416f02d409SBarry Smith          echo "Compiling and installing " $${releasename};\
1426f02d409SBarry Smith          make; make install; \
1436f02d409SBarry Smith          echo "=========================================";\
1443677444aSSatish Balay        fi;
1458744090aSBarry Smith#
1460ce59502SBarry Smith# Builds PETSc test examples for a given BOPT and architecture
14704f117c6SBarry Smith#
14804f117c6SBarry Smithtest: chkopts
14904f117c6SBarry Smith	-@echo "Running test examples to verify correct installation"
15004f117c6SBarry Smith	@cd src/snes/examples/tutorials; ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH}  PETSC_DIR=${PETSC_DIR} testex19
1510ce59502SBarry Smith	@if [ "${C_FC}" != "" ]; then cd src/snes/examples/tutorials; ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH}  PETSC_DIR=${PETSC_DIR} testex5f; fi;
1523677444aSSatish Balay	-@echo "Completed test examples"
1533677444aSSatish Balay
1543677444aSSatish Balaytestexamples: info chkopts
1553677444aSSatish Balay	-@echo "BEGINNING TO COMPILE AND RUN TEST EXAMPLES"
1563677444aSSatish Balay	-@echo "Due to different numerical round-off on certain"
15719552e71SMatthew Knepley	-@echo "machines some of the numbers may not match exactly."
1583677444aSSatish Balay	-@echo "========================================="
1593677444aSSatish Balay	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH}  PETSC_DIR=${PETSC_DIR} ACTION=testexamples_1  tree
1603677444aSSatish Balay	-@echo "Completed compiling and running test examples"
1613677444aSSatish Balay	-@echo "========================================="
1623677444aSSatish Balaytestfortran: info chkopts
1633677444aSSatish Balay	-@echo "BEGINNING TO COMPILE AND RUN FORTRAN TEST EXAMPLES"
1643677444aSSatish Balay	-@echo "========================================="
1653677444aSSatish Balay	-@echo "Due to different numerical round-off on certain"
1663677444aSSatish Balay	-@echo "machines or the way Fortran formats numbers"
1674b5d664cSKris Buschelman	-@echo "some of the results may not match exactly."
1684b5d664cSKris Buschelman	-@echo "========================================="
1696d2f2efaSKris Buschelman	-@if [ "${C_FC}" != "" ]; then \
1706d2f2efaSKris Buschelman            ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=testexamples_3 tree; \
1716d2f2efaSKris Buschelman            echo "Completed compiling and running Fortran test examples"; \
1724b5d664cSKris Buschelman          else \
1733677444aSSatish Balay            echo "Error: No FORTRAN compiler available"; \
17401c5c36fSSatish Balay          fi
17501c5c36fSSatish Balay	-@echo "========================================="
17601c5c36fSSatish Balaytestexamples_uni: info chkopts
17701c5c36fSSatish Balay	-@echo "BEGINNING TO COMPILE AND RUN TEST UNI-PROCESSOR EXAMPLES"
17801c5c36fSSatish Balay	-@echo "Due to different numerical round-off on certain"
17919552e71SMatthew Knepley	-@echo "machines some of the numbers may not match exactly."
18001c5c36fSSatish Balay	-@echo "========================================="
18101c5c36fSSatish Balay	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=testexamples_4  tree
1823677444aSSatish Balay	-@echo "Completed compiling and running uniprocessor test examples"
1833677444aSSatish Balay	-@echo "========================================="
1843677444aSSatish Balaytestfortran_uni: info chkopts
1853677444aSSatish Balay	-@echo "BEGINNING TO COMPILE AND RUN TEST UNI-PROCESSOR FORTRAN EXAMPLES"
1863677444aSSatish Balay	-@echo "Due to different numerical round-off on certain"
1874b5d664cSKris Buschelman	-@echo "machines some of the numbers may not match exactly."
1884b5d664cSKris Buschelman	-@echo "========================================="
1896d2f2efaSKris Buschelman	-@if [ "${C_FC}" != "" ]; then \
1906d2f2efaSKris Buschelman            ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=testexamples_9  tree; \
1916d2f2efaSKris Buschelman            echo "Completed compiling and running uniprocessor fortran test examples"; \
1924b5d664cSKris Buschelman          else \
1936d2f2efaSKris Buschelman            echo "Error: No FORTRAN compiler available"; \
1943677444aSSatish Balay          fi
195ad96cc0dSLois Curfman McInnes	-@
196f3eacedaSSatish Balay	-@echo "========================================="
1978c37ef55SBarry Smith
1985fde6e02SSatish Balay# Ranlib on the libraries
19961523587SBarry Smithranlib:
20011b6ed10SLois Curfman McInnes	${RANLIB} ${PETSC_LIB_DIR}/*.${LIB_SUFFIX}
201f3eacedaSSatish Balay
202b87434adSSatish Balay# Deletes PETSc libraries
203d44968ceSBarry Smithdeletelibs: chkopts_basic
204a42cec9dSMatthew Knepley	-${RM} -f ${PETSC_LIB_DIR}/*
205a42cec9dSMatthew Knepley
20619552e71SMatthew Knepley# Cleans up build
207a42cec9dSMatthew Knepleyallclean: deletelibs
2083677444aSSatish Balay	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=clean tree
2094918a6b0SSatish Balay
2104918a6b0SSatish Balay
2114918a6b0SSatish Balay#
2124918a6b0SSatish Balay# Check if PETSC_DIR variable specified is valid
2134918a6b0SSatish Balay#
2141390f061SBarry Smithchk_petsc_dir:
2151390f061SBarry Smith	@if [ ! -f ${PETSC_DIR}/include/petscversion.h ]; then \
2161390f061SBarry Smith	  echo "Incorrect PETSC_DIR specified: ${PETSC_DIR}!"; \
2174918a6b0SSatish Balay	  echo "You need to use / to separate directories, not \\!"; \
21875910670SSatish Balay	  echo "Aborting build"; \
21975910670SSatish Balay	  false; fi
22075910670SSatish Balay#
22175910670SSatish Balay# ${PETSC_DIR}/bmake/common/bopt_ is generated by configure - but if non-configure PETSC_ARCH
22275910670SSatish Balay# is used - create this file manually when libraries are created.
22375910670SSatish Balay#
22475910670SSatish Balaychk_default_bopt:
22575910670SSatish Balay	@if [ ! -f ${PETSC_DIR}/bmake/common/bopt_ ]; then \
2263c94ec11SBarry Smith	  echo "BOPT=$$BOPT" > ${PETSC_DIR}/bmake/common/bopt_ ;\
2273c94ec11SBarry Smith	fi
228fe0e97ccSBarry Smithinstall:
2293c94ec11SBarry Smith	-@if [ "${INSTALL_DIR}" == "${PETSC_DIR}" ]; then \
2303c94ec11SBarry Smith	  echo "Install directory is current directory; nothing needs to be done";\
2313c94ec11SBarry Smith        else \
232de21bb36SSatish Balay	  echo Installing PETSc at ${INSTALL_DIR};\
2333c94ec11SBarry Smith          if [ ! -d `dirname ${INSTALL_DIR}` ]; then \
2343c94ec11SBarry Smith	    ${MKDIR} `dirname ${INSTALL_DIR}` ; \
235de21bb36SSatish Balay          fi;\
2363c94ec11SBarry Smith          if [ ! -d ${INSTALL_DIR} ]; then \
2373c94ec11SBarry Smith	    ${MKDIR} ${INSTALL_DIR} ; \
2383c94ec11SBarry Smith          fi;\
239de21bb36SSatish Balay          cp -fr include ${INSTALL_DIR};\
2403c94ec11SBarry Smith          if [ ! -d ${INSTALL_DIR}/bmake ]; then \
2413c94ec11SBarry Smith	    ${MKDIR} ${INSTALL_DIR}/bmake ; \
2423c94ec11SBarry Smith          fi;\
2433c94ec11SBarry Smith          cp -f bmake/adic* bmake/variables ${INSTALL_DIR}/bmake ; \
2443c94ec11SBarry Smith          cp -fr bmake/common ${INSTALL_DIR}/bmake;\
2453c94ec11SBarry Smith          cp -fr bmake/${PETSC_ARCH} ${INSTALL_DIR}/bmake;\
246de21bb36SSatish Balay          cp -fr bin ${INSTALL_DIR};\
2473c94ec11SBarry Smith          if [ ! -d ${INSTALL_DIR}/lib ]; then \
2483c94ec11SBarry Smith	    ${MKDIR} ${INSTALL_DIR}/lib ; \
2493c94ec11SBarry Smith          fi;\
2503c94ec11SBarry Smith          for i in lib/lib*; do \
251de21bb36SSatish Balay            bopt=`echo $${i} | ${SED} s=lib/lib==g`;\
2523c94ec11SBarry Smith            if [ ! -d ${INSTALL_DIR}/$${i} ]; then \
2533c94ec11SBarry Smith              ${MKDIR} ${INSTALL_DIR}/$${i};\
2543c94ec11SBarry Smith            fi; \
2553c94ec11SBarry Smith            if [ -d $${i}/${PETSC_ARCH} ]; then \
2563c94ec11SBarry Smith              cp -fr $${i}/${PETSC_ARCH} ${INSTALL_DIR}/$${i};\
2573c94ec11SBarry Smith              ${RANLIB}  ${INSTALL_DIR}/$${i}/*.a > /dev/null 2>&1 ;\
2583c94ec11SBarry Smith              ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${INSTALL_DIR} BOPT=$${bopt} shared; \
2593c94ec11SBarry Smith            fi;\
2603c94ec11SBarry Smith          done;\
2613c94ec11SBarry Smith          echo "sh/bash: PETSC_DIR="${INSTALL_DIR}"; export PETSC_DIR";\
2623c94ec11SBarry Smith          echo "csh/tcsh: setenv PETSC_DIR "${INSTALL_DIR} ;\
2633c94ec11SBarry Smith          echo "The do make test to verify correct install";\
2643c94ec11SBarry Smith        fi;
2653c94ec11SBarry Smith
2663c94ec11SBarry Smithinstall_src:
2673c94ec11SBarry Smith	-@if [ "${INSTALL_DIR}" == "${PETSC_DIR}" ]; then \
2683c94ec11SBarry Smith	  echo "You did not set a directory to install to";\
2693c94ec11SBarry Smith        else \
270de21bb36SSatish Balay	  echo Installing PETSc source at ${INSTALL_DIR};\
2713c94ec11SBarry Smith          if [ ! -d `dirname ${INSTALL_DIR}` ]; then \
2723c94ec11SBarry Smith	    ${MKDIR} `dirname ${INSTALL_DIR}` ; \
273de21bb36SSatish Balay          fi;\
2743c94ec11SBarry Smith          if [ ! -d ${INSTALL_DIR} ]; then \
2753c94ec11SBarry Smith	    ${MKDIR} ${INSTALL_DIR} ; \
2763c94ec11SBarry Smith          fi;\
2773c94ec11SBarry Smith          cp -fr src ${INSTALL_DIR};\
2783c94ec11SBarry Smith        fi;
2793c94ec11SBarry Smith
2803c94ec11SBarry Smithinstall_docs:
2813c94ec11SBarry Smith	-@if [ "${INSTALL_DIR}" == "${PETSC_DIR}" ]; then \
2823c94ec11SBarry Smith	  echo "You did not set a directory to install to";\
2833c94ec11SBarry Smith        else \
284de21bb36SSatish Balay	  echo Installing PETSc documentation at ${INSTALL_DIR};\
2853c94ec11SBarry Smith          if [ ! -d `dirname ${INSTALL_DIR}` ]; then \
2863c94ec11SBarry Smith	    ${MKDIR} `dirname ${INSTALL_DIR}` ; \
287de21bb36SSatish Balay          fi;\
2883c94ec11SBarry Smith          if [ ! -d ${INSTALL_DIR} ]; then \
2893c94ec11SBarry Smith	    ${MKDIR} ${INSTALL_DIR} ; \
2903c94ec11SBarry Smith          fi;\
2913c94ec11SBarry Smith          cp -fr docs ${INSTALL_DIR};\
2923677444aSSatish Balay          ${RM} -fr docs/tex;\
2933677444aSSatish Balay        fi;
2943677444aSSatish Balay# ------------------------------------------------------------------
2953677444aSSatish Balay#
2963677444aSSatish Balay# All remaining actions are intended for PETSc developers only.
2973677444aSSatish Balay# PETSc users should not generally need to use these commands.
29865783a8cSBarry Smith#
29965783a8cSBarry Smith
30065783a8cSBarry Smith# To access the tags in EMACS, type M-x visit-tags-table and specify
30165783a8cSBarry Smith# the file petsc/TAGS.
30265783a8cSBarry Smith# 1) To move to where a PETSc function is defined, enter M-. and the
30365783a8cSBarry Smith#     function name.
3047acb7333SLois Curfman McInnes# 2) To search for a string and move to the first occurrence,
30511b6ed10SLois Curfman McInnes#     use M-x tags-search and the string.
30611b6ed10SLois Curfman McInnes#     To locate later occurrences, use M-,
307bcfca60cSBarry Smith# Builds all etags files
308bcfca60cSBarry Smithalletags:
309bcfca60cSBarry Smith	-@${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSDIR=${PETSC_DIR} etags
310bcfca60cSBarry Smith	-@${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSDIR=${PETSC_DIR} etags_noexamples
3114fa9d4e7SBarry Smith	-@${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSDIR=${PETSC_DIR} etags_examples
31220563c6bSBarry Smith	-@${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSDIR=${PETSC_DIR} etags_makefiles
313bcfca60cSBarry Smith# Builds complete etags list
314bcfca60cSBarry Smithetags:
315bcfca60cSBarry Smith	-@${RM} ${TAGSDIR}/TAGS
316bcfca60cSBarry Smith	-@touch ${TAGSDIR}/TAGS
317bcfca60cSBarry Smith	-@${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION="etags_sourcec etags_sourcej etags_sourceh etags_examplesc etags_examplesf etags_examplesch etags_examplesfh etags_makefile etags_docs etags_scripts" alltree
31811b6ed10SLois Curfman McInnes	-@cd src/fortran; ${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_sourcef alltree
319bfce26a3SBarry Smith	-@${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS etags_bmakefiles
320bcfca60cSBarry Smith# Builds the etags file that excludes the examples directories
321bcfca60cSBarry Smithetags_noexamples:
322dd599420SKris Buschelman	-@${RM} ${TAGSDIR}/TAGS_NO_EXAMPLES
323bcfca60cSBarry Smith	-@touch ${TAGSDIR}/TAGS_NO_EXAMPLES
324bcfca60cSBarry Smith	-@${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES ACTION="etags_sourcec etags_sourcej etags_sourceh etags_makefile etags_docs" alltree
32511b6ed10SLois Curfman McInnes	-@cd src/fortran; ${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES ACTION=etags_sourcef alltree
326b16a3bb1SBarry Smith	-@${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES etags_bmakefiles
327bcfca60cSBarry Smith# Builds the etags file for makefiles
328bcfca60cSBarry Smithetags_makefiles:
329bcfca60cSBarry Smith	-@${RM} ${TAGSDIR}/TAGS_MAKEFILES
330bcfca60cSBarry Smith	-@touch ${TAGSDIR}/TAGS_MAKEFILES
331dc80aa23SSatish Balay	-@${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_MAKEFILES ACTION=etags_makefile alltree
332dc80aa23SSatish Balay	-@${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_MAKEFILES etags_bmakefiles
333bcfca60cSBarry Smith# Builds the etags file for examples
334bcfca60cSBarry Smithetags_examples:
335dd599420SKris Buschelman	-@${RM} ${TAGSDIR}/TAGS_EXAMPLES
3362176044fSSatish Balay	-@touch ${TAGSDIR}/TAGS_EXAMPLES
337bcfca60cSBarry Smith	-@${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_EXAMPLES ACTION="etags_examplesc etags_examplesch etags_examplesf etags_examplesfh" alltree
338bcfca60cSBarry Smithetags_fexamples:
339dd599420SKris Buschelman	-@${RM} ${TAGSDIR}/TAGS_FEXAMPLES
340b38bb785SSatish Balay	-@touch ${TAGSDIR}/TAGS_FEXAMPLES
341f20f7ba3SSatish Balay	-@${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_FEXAMPLES ACTION="etags_examplesf etags_examplesfh" alltree
3423677444aSSatish Balay#
343b38bb785SSatish Balay# These are here for the target allci and allco, and etags
34423bef294SSatish Balay#
3459f3502c4SBarry Smith
3469f3502c4SBarry SmithBMAKEFILES = bmake/common/base bmake/common/test \
3472905d4d4SKris Buschelman	     bmake/common/bopt* bmake/predefined/*/rules bmake/predefined/*/variables bmake/predefined/*/packages \
34837dc49f7SBarry Smith	     bmake/predefined/*/petscconf.h bmake/predefined/*/petscfix.h bmake/config/packages.in \
3492f1ebae6SLois Curfman McInnes	     bmake/config/petscfix.h.in  bmake/config/rules.in  \
350f587520bSBarry Smith	     bmake/config/variables.in bmake/adic.init bmake/adicmf.init
351f587520bSBarry SmithDOCS	   = bmake/readme bmake/petscconf.defs
352f587520bSBarry SmithSCRIPTS    = maint/builddist  maint/wwwman maint/xclude maint/bugReport.py maint/buildconfigtest maint/builddistlite \
3532e111b49SBarry Smith             maint/buildtest maint/checkBuilds.py maint/copylognightly maint/copylognightly.tao maint/countfiles maint/findbadfiles \
354f587520bSBarry Smith             maint/fixinclude maint/getexlist maint/getpdflabels.py maint/helpindex.py maint/hosts.local maint/hosts.solaris killnightly \
355f587520bSBarry Smith             maint/lex.py  maint/mapnameslatex.py maint/startnightly maint/startnightly.tao maint/submitPatch.py \
356d56c4d9fSBarry Smith             maint/update-docs.py maint/updatetestbk maint/wwwindex.py maint/xcludebackup maint/xcludecblas maint/zap maint/zapall \
357d56c4d9fSBarry Smith             python/PETSc/Configure.py python/PETSc/Options.py \
358d56c4d9fSBarry Smith             python/PETSc/packages/ADIC.py python/PETSc/packages/MPE.py python/PETSc/packages/Mathematica.py \
359d56c4d9fSBarry Smith             python/PETSc/packages/PLAPACK.py python/PETSc/packages/Triangle.py python/PETSc/packages/Matlab.py \
360e9f3bb17SBarry Smith             python/PETSc/packages/PVODE.py python/PETSc/packages/BlasLapack.py python/PETSc/packages/MPI.py \
361d56c4d9fSBarry Smith             python/PETSc/packages/BlockSolve.py python/PETSc/packages/NetCDF.py python/PETSc/packages/ParMetis.py \
362ad56a76cSSatish Balay             python/PETSc/packages/update.py maint/confignightly/* config/*.py
363ad56a76cSSatish Balay
364ad56a76cSSatish Balaychk_loc:
365ad56a76cSSatish Balay	@if [ ${LOC}foo = foo ] ; then \
366ad56a76cSSatish Balay	  echo "*********************** ERROR ************************" ; \
367de21bb36SSatish Balay	  echo " Please specify LOC variable for eg: make allmanualpages LOC=/sandbox/petsc"; \
3682496ca06SSatish Balay	  echo "******************************************************";  false; fi
369a2fc510eSBarry Smith	@${MKDIR} ${LOC}/docs/manualpages
370f1d13e97SSatish Balay
371f1d13e97SSatish Balay# Builds all the documentation - should be done every night
372f1d13e97SSatish Balayalldoc: alldoc1 alldoc2
373f1d13e97SSatish Balay
374130c9832SBarry Smith# Build everything that goes into 'doc' dir except html sources
375ae6175c4SSatish Balayalldoc1: chk_loc deletemanualpages chk_concepts_dir
376130c9832SBarry Smith	-${OMAKE} ACTION=manualpages_buildcite tree_basic LOC=${LOC}
37748b2c0e9SBarry Smith	cd src/docs/tex/manual; ${OMAKE} build_manual.pdf LOC=${LOC}
378130c9832SBarry Smith	-${OMAKE} ACTION=manualpages tree_basic LOC=${LOC}
379130c9832SBarry Smith	-maint/wwwindex.py ${PETSC_DIR} ${LOC}
38048b2c0e9SBarry Smith	-${OMAKE} ACTION=manexamples tree LOC=${LOC}
38148b2c0e9SBarry Smith	-${OMAKE} manconcepts LOC=${LOC}
38248b2c0e9SBarry Smith	-${OMAKE} ACTION=getexlist tree LOC=${LOC}
383e01137a2SSatish Balay	-${OMAKE} ACTION=exampleconcepts tree LOC=${LOC}
384435da068SBarry Smith	-maint/helpindex.py ${PETSC_DIR} ${LOC}
385062da8f7SSatish Balay
386f1d13e97SSatish Balay# Builds .html versions of the source
3873a2060ecSSatish Balay# html overwrites some stuff created by update-docs - hence this is done later.
388f95977b4SBarry Smithalldoc2: chk_loc
389435da068SBarry Smith	-${OMAKE} ACTION=html PETSC_DIR=${PETSC_DIR} alltree LOC=${LOC}
390efaa7783SSatish Balay	-maint/update-docs.py ${PETSC_DIR} ${LOC}
391efaa7783SSatish Balay
392efaa7783SSatish Balayalldocclean: deletemanualpages allcleanhtml
393efaa7783SSatish Balay
3941c2a3de1SBarry Smith# Deletes man pages (HTML version)
3951c2a3de1SBarry Smithdeletemanualpages: chk_loc
396f587520bSBarry Smith	-@if [ -d ${LOC} -a -d ${LOC}/docs/manualpages ]; then \
397f587520bSBarry Smith          find ${LOC}/docs/manualpages -type f -name "*.html" -exec ${RM} {} \; ;\
3981c2a3de1SBarry Smith          ${RM} ${LOC}/docs/exampleconcepts ;\
399f95977b4SBarry Smith          ${RM} ${LOC}/docs/manconcepts ;\
4001c2a3de1SBarry Smith          ${RM} ${LOC}/docs/manualpages/manualpages.cit ;\
401efaa7783SSatish Balay          maint/update-docs.py ${PETSC_DIR} ${LOC} clean;\
402115a300dSBarry Smith        fi
4032d156eb4SBarry Smith
404cc4dcc40SBarry Smithallcleanhtml:
405395565bcSBarry Smith	-${RM} include/adic/*.h.html
406ad56a76cSSatish Balay	-${OMAKE} ACTION=cleanhtml PETSC_DIR=${PETSC_DIR} alltree
407fe742e3dSSatish Balay
408bfe54af3SSatish Balaychk_concepts_dir: chk_loc
409bdde29a3SBarry Smith	@if [ ! -d "${LOC}/docs/manualpages/concepts" ]; then \
410bdde29a3SBarry Smith	  echo Making directory ${LOC}/docs/manualpages/concepts for library; ${MKDIR} ${LOC}/docs/manualpages/concepts; fi
411bdde29a3SBarry Smith#
412da77a087SBarry Smith#  checks if should build Fortran stubs
413bdde29a3SBarry Smithchk_fortranstubs:
414bdde29a3SBarry Smith	-@if [ ! -f "${PETSC_DIR}/src/fortran/auto/makefile.src" -a "${C_FC}" != "" ]; then \
415bdde29a3SBarry Smith          ${OMAKE} PETSC_DIR=${PETSC_DIR} allfortranstubs ;\
41611b6ed10SLois Curfman McInnes        fi
41711b6ed10SLois Curfman McInnes
41809d4790eSSatish Balay# Builds Fortran stub files
4199c0ff1f6SBarry Smithallfortranstubs:
4209c0ff1f6SBarry Smith	-@which ${BFORT} > /dev/null 2>&1;  \
4219c0ff1f6SBarry Smith        if [ "$$?" != "0" ]; then \
4229c0ff1f6SBarry Smith          echo "No bfort available, skipping building Fortran stubs";\
4239c0ff1f6SBarry Smith        else \
4249c0ff1f6SBarry Smith          ${RM} -f ${PETSC_DIR}/src/fortran/auto/*.c ;\
4259c0ff1f6SBarry Smith	  touch ${PETSC_DIR}/src/fortran/auto/makefile.src ;\
4269c0ff1f6SBarry Smith	  ${OMAKE} ACTION=fortranstubs tree_basic ;\
4279c0ff1f6SBarry Smith	  cd ${PETSC_DIR}/src/fortran/auto; ${RM} makefile.src; echo SOURCEC = ` ls *.c | tr -s '\n' ' '` > makefile.src ;\
428f6ff2982SSatish Balay	  cd ${PETSC_DIR}/src/fortran/auto; ${OMAKE} fixfortran ;\
429d55938c2SBarry Smith        fi
43019552e71SMatthew Knepley
431b951964fSBarry Smithallci:
432d55938c2SBarry Smith	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=ci  alltree
43319552e71SMatthew Knepley
434d55938c2SBarry Smithallco:
435791d64f4SSatish Balay	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=co  alltree
436791d64f4SSatish Balay
43719552e71SMatthew Knepley# usage make allrcslabel NEW_RCS_LABEL=v_2_0_28
438b334301eSBarry Smithallrcslabel:
439b334301eSBarry Smith	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} NEW_RCS_LABEL=${NEW_RCS_LABEL} ACTION=rcslabel  alltree
440b334301eSBarry Smith#
441b334301eSBarry Smith#   The commands below are for generating ADIC versions of the code;
4425eea60f9SBarry Smith# they are not currently used.
443b87434adSSatish Balay#
44419552e71SMatthew Knepleyalladicignore:
4455eea60f9SBarry Smith	-@${RM} ${INSTALL_LIB_DIR}/adicignore
4465eea60f9SBarry Smith	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adicignore  tree
447d18b0ea7SBarry Smith
44867b024f7SSatish Balayalladic:
449d18b0ea7SBarry Smith	-@echo "Beginning to compile ADIC source code in all directories"
45047794344SBarry Smith	-@echo "Using ADIC compiler: ${ADIC_CC} ${CCPPFLAGS}"
45167b024f7SSatish Balay	-@echo "========================================="
45219552e71SMatthew Knepley	-@cd include ; \
45347794344SBarry Smith           ${ADIC_CC} -s -f 1 ${CCPPFLAGS} petsc.h
45419552e71SMatthew Knepley	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adic  tree
45577ed5343SBarry Smith	-@cd src/inline ; \
45619552e71SMatthew Knepley            ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} adic
4576e81b665SBarry Smith	-@cd src/blaslapack ; \
45847794344SBarry Smith            ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adic  tree
459d18b0ea7SBarry Smith
460d77bb2e1SSatish Balayalladiclib:
461d18b0ea7SBarry Smith	-@echo "Beginning to compile ADIC libraries in all directories"
462d77bb2e1SSatish Balay	-@echo "Using compiler: ${CC} ${COPTFLAGS}"
463d18b0ea7SBarry Smith	-@echo "-----------------------------------------"
464e0e703c1SSatish Balay	-@echo "Using PETSc flags: ${PETSCFLAGS} ${PCONF}"
465ba1077baSMatthew Knepley	-@echo "-----------------------------------------"
466d18b0ea7SBarry Smith	-@echo "Using configuration flags:"
467d77bb2e1SSatish Balay	-@grep "define " bmake/${INLUDE_ARCH}/petscconf.h
468d18b0ea7SBarry Smith	-@echo "-----------------------------------------"
469d77bb2e1SSatish Balay	-@echo "Using include paths: ${PETSC_INCLUDE}"
47019552e71SMatthew Knepley	-@echo "-----------------------------------------"
471d18b0ea7SBarry Smith	-@echo "Using PETSc directory: ${PETSC_DIR}"
4725fde6e02SSatish Balay	-@echo "Using PETSc arch: ${PETSC_ARCH}"
47319552e71SMatthew Knepley	-@echo "========================================="
47477ed5343SBarry Smith	-@${RM} -f  ${INSTALL_LIB_DIR}/*adic.${LIB_SUFFIX}
47519552e71SMatthew Knepley	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adiclib  tree
4767e351921SBarry Smith	-@cd src/blaslapack ; \
47719552e71SMatthew Knepley            ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adiclib  tree
4785eea60f9SBarry Smith	-@cd src/adic/src ; \
4799e417c50SSatish Balay            ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} lib
4809e417c50SSatish Balay
4819e417c50SSatish Balay# -------------------------------------------------------------------------------
4829e417c50SSatish Balay#
4839e417c50SSatish Balay# Some macros to check if the fortran interface is up-to-date.
484d77bb2e1SSatish Balay#
48585c7cd6cSSatish Balaycountfortranfunctions:
4869e417c50SSatish Balay	-@cd ${PETSC_DIR}/src/fortran; egrep '^void' custom/*.c auto/*.c | \
487b334301eSBarry Smith	cut -d'(' -f1 | tr -s  ' ' | cut -d' ' -f2 | uniq | egrep -v "(^$$|Petsc)" | \
4889e417c50SSatish Balay	sed "s/_$$//" | sort > /tmp/countfortranfunctions
48985c7cd6cSSatish Balay
49085c7cd6cSSatish Balaycountcfunctions:
4919e417c50SSatish Balay	-@ grep extern ${PETSC_DIR}/include/*.h *.h | grep "(" | tr -s ' ' | \
4929e417c50SSatish Balay	cut -d'(' -f1 | cut -d' ' -f3 | grep -v "\*" | tr -s '\012' |  \
4939e417c50SSatish Balay	tr 'A-Z' 'a-z' |  sort > /tmp/countcfunctions
4949e417c50SSatish Balay
4959700b7f8SSatish Balaydifffortranfunctions: countfortranfunctions countcfunctions
4969e417c50SSatish Balay	-@echo -------------- Functions missing in the fortran interface ---------------------
4979700b7f8SSatish Balay	-@${DIFF} /tmp/countcfunctions /tmp/countfortranfunctions | grep "^<" | cut -d' ' -f2
498d77bb2e1SSatish Balay	-@echo ----------------- Functions missing in the C interface ------------------------
499b334301eSBarry Smith	-@${DIFF} /tmp/countcfunctions /tmp/countfortranfunctions | grep "^>" | cut -d' ' -f2
5003f4c9a3aSSatish Balay	-@${RM}  /tmp/countcfunctions /tmp/countfortranfunctions
5013f4c9a3aSSatish Balay
5023f4c9a3aSSatish Balaycheckbadfortranstubs:
5033f4c9a3aSSatish Balay	-@echo "========================================="
504d77bb2e1SSatish Balay	-@echo "Functions with MPI_Comm as an Argument"
50585c7cd6cSSatish Balay	-@echo "========================================="
5063f4c9a3aSSatish Balay	-@cd ${PETSC_DIR}/src/fortran/auto; grep '^void' *.c | grep 'MPI_Comm' | \
5073f4c9a3aSSatish Balay	tr -s ' ' | tr -s ':' ' ' |cut -d'(' -f1 | cut -d' ' -f1,3
5083f4c9a3aSSatish Balay	-@echo "========================================="
509d77bb2e1SSatish Balay	-@echo "Functions with a String as an Argument"
51085c7cd6cSSatish Balay	-@echo "========================================="
5113f4c9a3aSSatish Balay	-@cd ${PETSC_DIR}/src/fortran/auto; grep '^void' *.c | grep 'char \*' | \
5123f4c9a3aSSatish Balay	tr -s ' ' | tr -s ':' ' ' |cut -d'(' -f1 | cut -d' ' -f1,3
5133f4c9a3aSSatish Balay	-@echo "========================================="
514d77bb2e1SSatish Balay	-@echo "Functions with Pointers to PETSc Objects as Argument"
51585c7cd6cSSatish Balay	-@echo "========================================="
51685c7cd6cSSatish Balay	-@cd ${PETSC_DIR}/src/fortran/auto; \
5173f4c9a3aSSatish Balay	_p_OBJ=`grep _p_ ${PETSC_DIR}/include/*.h | tr -s ' ' | \
5183f4c9a3aSSatish Balay	cut -d' ' -f 3 | tr -s '\012' | grep -v '{' | cut -d'*' -f1 | \
51985c7cd6cSSatish Balay	sed "s/_p_//g" | tr -s '\012 ' ' *|' ` ; \
5203f4c9a3aSSatish Balay	for OBJ in $$_p_OBJ; do \
5213f4c9a3aSSatish Balay	grep "$$OBJ \*" *.c | tr -s ' ' | tr -s ':' ' ' | \
5224556b810SBarry Smith	cut -d'(' -f1 | cut -d' ' -f1,3; \
5234556b810SBarry Smith	done
524b6ea66eeSBarry Smith#
52575df30afSSatish Balay# Automatically generates PETSc exercises in html from the tutorial examples.
526b6ea66eeSBarry Smith#
527b6ea66eeSBarry Smith# The introduction for each section is obtained from docs/manualpages/header_${MANSEC} is under RCS and may be edited
528b6ea66eeSBarry Smith#  (used also in introductions to the manual pages)
529b6ea66eeSBarry Smith# The overall introduction is in docs/exercises/introduction.html and is under RCS and may be edited
5304556b810SBarry Smith# The list of exercises is from TUTORIALS in each directory's makefile
5314556b810SBarry Smith#
5324556b810SBarry Smith# DO NOT EDIT the pageform.txt or *.htm files generated since they will be automatically replaced.
533843ae28eSBarry Smith# The pagemaker rule is in the file bmake/common (at the bottom)
53497e8d271SBarry Smith#
535843ae28eSBarry Smith# Eventually the line below will replace the two cd in the rule below, it is just this way now for speed
53697e8d271SBarry Smith#	-@${OMAKE} PETSC_DIR=${PETSC_DIR} pagemaker
53797e8d271SBarry Smith#
53897e8d271SBarry Smithexercises:
539467fbd6dSBarry Smith	-@echo "========================================="
54097e8d271SBarry Smith	-@echo "Generating HTML tutorial exercises"
54197e8d271SBarry Smith	-@${RM} docs/pageform.txt
542beb1b3a5SBarry Smith	-@echo "title=\"PETSc Exercises\""                >  docs/pageform.txt
54397e8d271SBarry Smith	-@echo "access_title=Exercise Sections"              >>  docs/pageform.txt
54497e8d271SBarry Smith	-@echo "access_format=short"                        >> docs/pageform.txt
54597e8d271SBarry Smith	-@echo "startpage=../exercises/introduction.htm"  >> docs/pageform.txt
54697e8d271SBarry Smith	-@echo "NONE title=\"Introduction\" command=link src=../exercises/introduction.htm" >> docs/pageform.txt
547beb1b3a5SBarry Smith	-@echo "Generating HTML for individual directories"
54897e8d271SBarry Smith	-@echo "========================================="
54997e8d271SBarry Smith	-@${OMAKE} PETSC_DIR=${PETSC_DIR} ACTION=pagemaker tree
55097e8d271SBarry Smith	-@echo "Completed HTML for individual directories"
55197e8d271SBarry Smith	-@echo "NONE title=\"<HR>\" " >> docs/pageform.txt;
55297e8d271SBarry Smith	-@echo "NONE title=\"PETSc Documentation\" command=link src=../index.html target=replace" >> docs/pageform.txt
55397e8d271SBarry Smith	/home/MPI/class/mpiexmpl/maint/makepage.new -pageform=docs/pageform.txt -access_extra=/dev/null -outdir=docs/exercises
554b4b3a923SMatthew Knepley	-@echo "========================================="
555b4b3a923SMatthew Knepley
556b4b3a923SMatthew Knepley# Make a tarball of all the Python code
557b4b3a923SMatthew Knepley#   This is currently used to release to the Teragrid
558b4b3a923SMatthew KnepleypetscPython.tgz:
559b4b3a923SMatthew Knepley	@tar cvzf $@ --exclude SCCS --exclude BitKeeper --dereference python/
5608852b4e5SMatthew Knepley	-@scp $@ tg-login2.uc.teragrid.org:./
561de21bb36SSatish Balay
562a42cec9dSMatthew Knepley.PHONY: info info_h all all_build build testexamples testfortran testexamples_uni testfortran_uni ranlib deletelibs allclean update chk_petsc_dir \
563b4b3a923SMatthew Knepley        alletags etags etags_complete etags_noexamples etags_makefiles etags_examples etags_fexamples alldoc allmanualpages \
564f7819401SBarry Smith        allhtml allcleanhtml allfortranstubs allci allco allrcslabel alladicignore alladic alladiclib countfortranfunctions \
565        start_configure configure_petsc configure_clean petscPython.tgz
566
567