xref: /petsc/makefile (revision bcfca60cb45ae89bd2142fe078fd31098aba107e)
173f4d377SMatthew Knepley# $Id: makefile,v 1.353 2001/08/28 19:43:38 balay Exp $
211b6ed10SLois Curfman McInnes#
3cfd69a58SBarry Smith# This is the makefile for installing PETSc. See the file
4ba3fcebfSBarry Smith# docs/website/documentation/installation.html for directions on installing PETSc.
5cfd69a58SBarry Smith# See also bmake/common for additional commands.
611b6ed10SLois Curfman McInnes#
7716b9c40SSatish BalayALL: all
848b2c0e9SBarry SmithLOCDIR = .
9b16a3bb1SBarry SmithDIRS   = src include docs
1061523587SBarry Smith
11516d1546SSatish Balayinclude ${PETSC_DIR}/bmake/common/base
12516d1546SSatish Balayinclude ${PETSC_DIR}/bmake/common/test
1361523587SBarry Smith
14ca5c9d59SMatthew Knepley#
153677444aSSatish Balay# Basic targets to build PETSc libraries.
16fa527775SLois Curfman McInnes# all: builds the c, fortran, and f90 libraries
17b5fa40b8SBarry Smithall:
18b5fa40b8SBarry Smith	@${OMAKE}  PETSC_ARCH=${PETSC_ARCH} BOPT=${BOPT} chkpetsc_dir
1944ecba3fSMatthew Knepley	-@${MAKE} all_build 2>&1 | tee make_log_${PETSC_ARCH}_${BOPT}
20bdde29a3SBarry Smithall_build: chk_petsc_dir info info_h chklib_dir deletelibs chk_fortranstubs blaslapack mpich build shared
21efd74e9bSBarry Smith#
22fa527775SLois Curfman McInnes# Prints information about the system and version of PETSc being compiled
23efd74e9bSBarry Smith#
24efd74e9bSBarry Smithinfo:
25efd74e9bSBarry Smith	-@echo "=========================================="
2611b6dc0cSBarry Smith	-@echo " "
27d76296fbSBarry Smith	-@echo "See docs/troubleshooting.html and docs/bugreporting.html"
28d76296fbSBarry Smith	-@echo "for help with installation problems. Please send EVERYTHING"
29d76296fbSBarry Smith	-@echo "printed out below when reporting problems"
3011b6dc0cSBarry Smith	-@echo " "
3111b6dc0cSBarry Smith	-@echo "To subscribe to the PETSc users mailing list, send mail to "
3211b6dc0cSBarry Smith	-@echo "majordomo@mcs.anl.gov with the message: "
338b6f49e5SSatish Balay	-@echo "subscribe petsc-announce"
3411b6dc0cSBarry Smith	-@echo " "
35d76296fbSBarry Smith	-@echo "=========================================="
361d91fb6eSBarry Smith	-@echo On `date` on `hostname`
3730fdcc7aSBarry Smith	-@echo Machine characteristics: `uname -a`
38efd74e9bSBarry Smith	-@echo "-----------------------------------------"
394a44a727SBarry Smith	-@echo "Using C/C++ compiler: ${C_CC} ${COPTFLAGS} ${CCPPFLAGS}"
404a44a727SBarry Smith	-@echo "C/C++ Compiler version: " `${C_CCV}`
414a44a727SBarry Smith	-@if [ "${C_FC}" != "" ]; then \
42e6ee457dSBarry Smith	   echo "Using Fortran compiler: ${C_FC} ${FOPTFLAGS} ${FCPPFLAGS}";\
43e6ee457dSBarry Smith	   echo "Fortran Compiler version: " `${C_FCV}`;\
44e6ee457dSBarry Smith         fi
4547794344SBarry Smith	-@echo "-----------------------------------------"
46bdd8b494SSatish Balay	-@grep "define PETSC_VERSION" ${PETSC_DIR}/include/petscversion.h | ${SED} "s/........//"
47f265ae5cSBarry Smith	-@echo "-----------------------------------------"
48d77bb2e1SSatish Balay	-@echo "Using PETSc flags: ${PETSCFLAGS} ${PCONF}"
4947794344SBarry Smith	-@echo "-----------------------------------------"
50e0e703c1SSatish Balay	-@echo "Using configuration flags:"
5119552e71SMatthew Knepley	-@grep "\#define " ${PETSC_DIR}/bmake/${PETSC_ARCH}/petscconf.h
5247794344SBarry Smith	-@echo "-----------------------------------------"
53d77bb2e1SSatish Balay	-@echo "Using include paths: ${PETSC_INCLUDE}"
5447794344SBarry Smith	-@echo "-----------------------------------------"
55d77bb2e1SSatish Balay	-@echo "Using PETSc directory: ${PETSC_DIR}"
5619552e71SMatthew Knepley	-@echo "Using PETSc arch: ${PETSC_ARCH}"
57efd74e9bSBarry Smith	-@echo "------------------------------------------"
584a44a727SBarry Smith	-@echo "Using C/C++ linker: ${CLINKER}"
594a44a727SBarry Smith	-@if [ "${C_FC}" != "" ]; then \
60e6ee457dSBarry Smith	   echo "Using Fortran linker: ${FLINKER}";\
61e6ee457dSBarry Smith         fi
62f2b01315SBarry Smith	-@echo "Using libraries: ${PETSC_LIB}"
63e3353558SSatish Balay	-@echo "------------------------------------------"
64e3353558SSatish Balay	-@echo "Using mpirun: ${MPIRUN}"
65efd74e9bSBarry Smith	-@echo "=========================================="
66b8d81f61SBarry Smith#
67b8d81f61SBarry Smith#
6819552e71SMatthew KnepleyMINFO = ${PETSC_DIR}/bmake/${PETSC_ARCH}/petscmachineinfo.h
69b8d81f61SBarry Smithinfo_h:
70ddbfe947SBarry Smith	-@$(RM) -f MINFO ${MINFO}
712fc52814SBarry Smith	-@echo  "static const char *petscmachineinfo = \"  " >> MINFO
7234a92de5SBarry Smith	-@echo  "Libraries compiled on `date` on `hostname` " >> MINFO
73c5e9c7dfSBarry Smith	-@echo  Machine characteristics: `uname -a` "" >> MINFO
74f6a9982fSBarry Smith	-@echo  "Using PETSc directory: ${PETSC_DIR}" >> MINFO
7519552e71SMatthew Knepley	-@echo  "Using PETSc arch: ${PETSC_ARCH}" >> MINFO
7693520af8SSatish Balay	-@echo  "-----------------------------------------\"; " >> MINFO
772fc52814SBarry Smith	-@echo  "static const char *petsccompilerinfo = \"  " >> MINFO
785323642bSKris Buschelman	-@echo  "Using C compiler: ${C_CC} ${COPTFLAGS} ${CCPPFLAGS} " >> MINFO
79dffd13fbSMatthew Knepley	-@echo  "C Compiler version:"  >> MINFO ; ${C_CCV} >> MINFO 2>&1 ; true
80dffd13fbSMatthew Knepley	-@echo  "C++ Compiler version:"  >> MINFO; ${CXX_CCV} >> MINFO 2>&1 ; true
815323642bSKris Buschelman	-@echo  "Using Fortran compiler: ${C_FC} ${FOPTFLAGS} ${FCPPFLAGS}" >> MINFO
82dffd13fbSMatthew Knepley	-@echo  "Fortran Compiler version:" >> MINFO ; ${C_FCV} >> MINFO 2>&1 ; true
8393520af8SSatish Balay	-@echo  "-----------------------------------------\"; " >> MINFO
842fc52814SBarry Smith	-@echo  "static const char *petsccompilerflagsinfo = \"  " >> MINFO
85c5e9c7dfSBarry Smith	-@echo  "Using PETSc flags: ${PETSCFLAGS} ${PCONF}" >> MINFO
86c5e9c7dfSBarry Smith	-@echo  "-----------------------------------------" >> MINFO
87c5e9c7dfSBarry Smith	-@echo  "Using configuration flags:" >> MINFO
88c5e9c7dfSBarry Smith	-@echo  "-----------------------------------------" >> MINFO
89c5e9c7dfSBarry Smith	-@echo  "Using include paths: ${PETSC_INCLUDE}" >> MINFO
9093520af8SSatish Balay	-@echo  "------------------------------------------\"; " >> MINFO
912fc52814SBarry Smith	-@echo  "static const char *petsclinkerinfo = \"  " >> MINFO
92c5e9c7dfSBarry Smith	-@echo  "Using C linker: ${CLINKER}" >> MINFO
93c5e9c7dfSBarry Smith	-@echo  "Using Fortran linker: ${FLINKER}" >> MINFO
9493520af8SSatish Balay	-@echo  "Using libraries: ${PETSC_LIB} \"; " >> MINFO
959f5e290dSSYSTEM	-@cat MINFO | ${SED} -e 's/\
969c0905fcSSatish Balay//g'  | ${SED} -e 's/\^M//g' | ${SED} -e 's/\\/\\\\/g' | ${SED} -e 's/$$/ \\n\\/' | sed -e 's/\;  \\n\\/\;/'> ${MINFO}
97ce0f4ea0SKris Buschelman	-@$(RM) MINFO
983677444aSSatish Balay
99fa527775SLois Curfman McInnes#
100fa527775SLois Curfman McInnes# Builds the PETSc libraries
101f6a9982fSBarry Smith# This target also builds fortran77 and f90 interface
1023677444aSSatish Balay# files and compiles .F files
103f6a9982fSBarry Smith#
104efd74e9bSBarry Smithbuild:
10547794344SBarry Smith	-@echo "BEGINNING TO COMPILE LIBRARIES IN ALL DIRECTORIES"
10644ecba3fSMatthew Knepley	-@echo "========================================="
1075fde6e02SSatish Balay	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=libfast tree
1080b3634f8SBarry Smith	-@${RANLIB} ${PETSC_LIB_DIR}/*.${LIB_SUFFIX}
10947794344SBarry Smith	-@echo "Completed building libraries"
11035ca7349SBarry Smith	-@echo "========================================="
111c8fd01ffSBarry Smith#
112c8fd01ffSBarry Smith#  Compiles the blas and lapack source code if found
113c8fd01ffSBarry Smithblaslapack:
114c8fd01ffSBarry Smith	-@if [ -d f2cblaslapack/${PETSC_ARCH} -a ! -s f2cblaslapack/${PETSC_ARCH}/libf2cblas.a ] ; then cd f2cblaslapack;\
115c8fd01ffSBarry Smith        echo "=========================================";\
116c8fd01ffSBarry Smith        echo "Building C Blas/Lapack libraries";\
117c8fd01ffSBarry Smith        ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ;\
11882fb4bcfSBarry Smith        ${MV} libf2cblas.a libf2clapack.a ${PETSC_ARCH};\
119c8fd01ffSBarry Smith        ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} cleanblaslapack ;\
120c8fd01ffSBarry Smith        echo "Completed C building Blas/Lapack libraries";\
121c8fd01ffSBarry Smith        echo "========================================="; fi
122c8fd01ffSBarry Smith	-@if [ -d fblaslapack/${PETSC_ARCH} -a ! -s fblaslapack/${PETSC_ARCH}/libfblas.a ] ; then cd fblaslapack;\
123c8fd01ffSBarry Smith        echo "=========================================";\
124c8fd01ffSBarry Smith        echo "Building Fortran Blas/Lapack libraries";\
125c8fd01ffSBarry Smith        ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ;\
12682fb4bcfSBarry Smith        ${MV} libfblas.a libflapack.a ${PETSC_ARCH};\
127c8fd01ffSBarry Smith        ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} cleanblaslapck ;\
128c8fd01ffSBarry Smith        echo "Completed building Fortran Blas/Lapack libraries";\
129c8fd01ffSBarry Smith        echo "========================================="; fi
1306f02d409SBarry Smith#
1316f02d409SBarry Smith#  Compiles MPICH if found
13215876681SBarry Smithmpich:
1336f02d409SBarry Smith	-@releasename=`ls -d mpich* 2> /dev/null`;\
1346f02d409SBarry Smith        if [ -d $${releasename}/${PETSC_ARCH} -a ! -d $${releasename}/${PETSC_ARCH}/lib ] ; then cd $${releasename} ;\
1356f02d409SBarry Smith          echo "=========================================";\
1366f02d409SBarry Smith          echo "Compiling and installing " $${releasename};\
1376f02d409SBarry Smith          make; make install; \
1386f02d409SBarry Smith          echo "=========================================";\
1396f02d409SBarry Smith        fi;
1403677444aSSatish Balay#
1418744090aSBarry Smith# Builds PETSc test examples for a given BOPT and architecture
1420ce59502SBarry Smith#
14304f117c6SBarry Smithtest: chkopts
14404f117c6SBarry Smith	-@echo "Running test examples to verify correct installation"
14504f117c6SBarry Smith	@cd src/snes/examples/tutorials; ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH}  PETSC_DIR=${PETSC_DIR} testex19
14604f117c6SBarry Smith	@if [ "${C_FC}" != "" ]; then cd src/snes/examples/tutorials; ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH}  PETSC_DIR=${PETSC_DIR} testex5f; fi;
1470ce59502SBarry Smith	-@echo "Completed test examples"
1483677444aSSatish Balay
1493677444aSSatish Balaytestexamples: info chkopts
1503677444aSSatish Balay	-@echo "BEGINNING TO COMPILE AND RUN TEST EXAMPLES"
1513677444aSSatish Balay	-@echo "Due to different numerical round-off on certain"
1523677444aSSatish Balay	-@echo "machines some of the numbers may not match exactly."
15319552e71SMatthew Knepley	-@echo "========================================="
1543677444aSSatish Balay	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH}  PETSC_DIR=${PETSC_DIR} ACTION=testexamples_1  tree
1553677444aSSatish Balay	-@echo "Completed compiling and running test examples"
1563677444aSSatish Balay	-@echo "========================================="
1573677444aSSatish Balaytestfortran: info chkopts
1583677444aSSatish Balay	-@echo "BEGINNING TO COMPILE AND RUN FORTRAN TEST EXAMPLES"
1593677444aSSatish Balay	-@echo "========================================="
1603677444aSSatish Balay	-@echo "Due to different numerical round-off on certain"
1613677444aSSatish Balay	-@echo "machines or the way Fortran formats numbers"
1623677444aSSatish Balay	-@echo "some of the results may not match exactly."
1634b5d664cSKris Buschelman	-@echo "========================================="
1644b5d664cSKris Buschelman	-@if [ "${C_FC}" != "" ]; then \
1656d2f2efaSKris Buschelman            ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=testexamples_3 tree; \
1666d2f2efaSKris Buschelman            echo "Completed compiling and running Fortran test examples"; \
1676d2f2efaSKris Buschelman          else \
1684b5d664cSKris Buschelman            echo "Error: No FORTRAN compiler available"; \
1693677444aSSatish Balay          fi
17001c5c36fSSatish Balay	-@echo "========================================="
17101c5c36fSSatish Balaytestexamples_uni: info chkopts
17201c5c36fSSatish Balay	-@echo "BEGINNING TO COMPILE AND RUN TEST UNI-PROCESSOR EXAMPLES"
17301c5c36fSSatish Balay	-@echo "Due to different numerical round-off on certain"
17401c5c36fSSatish Balay	-@echo "machines some of the numbers may not match exactly."
17519552e71SMatthew Knepley	-@echo "========================================="
17601c5c36fSSatish Balay	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=testexamples_4  tree
17701c5c36fSSatish Balay	-@echo "Completed compiling and running uniprocessor test examples"
1783677444aSSatish Balay	-@echo "========================================="
1793677444aSSatish Balaytestfortran_uni: info chkopts
1803677444aSSatish Balay	-@echo "BEGINNING TO COMPILE AND RUN TEST UNI-PROCESSOR FORTRAN EXAMPLES"
1813677444aSSatish Balay	-@echo "Due to different numerical round-off on certain"
1823677444aSSatish Balay	-@echo "machines some of the numbers may not match exactly."
1834b5d664cSKris Buschelman	-@echo "========================================="
1844b5d664cSKris Buschelman	-@if [ "${C_FC}" != "" ]; then \
1856d2f2efaSKris Buschelman            ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=testexamples_9  tree; \
1866d2f2efaSKris Buschelman            echo "Completed compiling and running uniprocessor fortran test examples"; \
1876d2f2efaSKris Buschelman          else \
1884b5d664cSKris Buschelman            echo "Error: No FORTRAN compiler available"; \
1896d2f2efaSKris Buschelman          fi
1903677444aSSatish Balay	-@
191ad96cc0dSLois Curfman McInnes	-@echo "========================================="
192f3eacedaSSatish Balay
1938c37ef55SBarry Smith# Ranlib on the libraries
1945fde6e02SSatish Balayranlib:
19561523587SBarry Smith	${RANLIB} ${PETSC_LIB_DIR}/*.${LIB_SUFFIX}
19611b6ed10SLois Curfman McInnes
197f3eacedaSSatish Balay# Deletes PETSc libraries
198b87434adSSatish Balaydeletelibs: chkopts_basic
199d44968ceSBarry Smith	-${RM} -f ${PETSC_LIB_DIR}/*
200a42cec9dSMatthew Knepley
201a42cec9dSMatthew Knepley# Cleans up build
20219552e71SMatthew Knepleyallclean: deletelibs
203a42cec9dSMatthew Knepley	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=clean tree
2043677444aSSatish Balay
2054918a6b0SSatish Balay
2064918a6b0SSatish Balay#
2074918a6b0SSatish Balay# Check if PETSC_DIR variable specified is valid
2084918a6b0SSatish Balay#
2094918a6b0SSatish Balaychk_petsc_dir:
2101390f061SBarry Smith	@if [ ! -f ${PETSC_DIR}/include/petscversion.h ]; then \
2111390f061SBarry Smith	  echo "Incorrect PETSC_DIR specified: ${PETSC_DIR}!"; \
2121390f061SBarry Smith	  echo "You need to use / to separate directories, not \\!"; \
2134918a6b0SSatish Balay	  echo "Aborting build"; \
2144918a6b0SSatish Balay	  false; fi
2153c94ec11SBarry Smith
2163c94ec11SBarry Smithinstall:
217fe0e97ccSBarry Smith	-@if [ "${INSTALL_DIR}" == "${PETSC_DIR}" ]; then \
2183c94ec11SBarry Smith	  echo "Install directory is current directory; nothing needs to be done";\
2193c94ec11SBarry Smith        else \
2203c94ec11SBarry Smith	  echo Installing PETSc at ${INSTALL_DIR};\
2213c94ec11SBarry Smith          if [ ! -d `dirname ${INSTALL_DIR}` ]; then \
2223c94ec11SBarry Smith	    mkdir `dirname ${INSTALL_DIR}` ; \
2233c94ec11SBarry Smith          fi;\
2243c94ec11SBarry Smith          if [ ! -d ${INSTALL_DIR} ]; then \
2253c94ec11SBarry Smith	    mkdir ${INSTALL_DIR} ; \
2263c94ec11SBarry Smith          fi;\
2273c94ec11SBarry Smith          cp -fr include ${INSTALL_DIR};\
2283c94ec11SBarry Smith          if [ ! -d ${INSTALL_DIR}/bmake ]; then \
2293c94ec11SBarry Smith	    mkdir ${INSTALL_DIR}/bmake ; \
2303c94ec11SBarry Smith          fi;\
2313c94ec11SBarry Smith          cp -f bmake/adic* bmake/variables ${INSTALL_DIR}/bmake ; \
2323c94ec11SBarry Smith          cp -fr bmake/common ${INSTALL_DIR}/bmake;\
2333c94ec11SBarry Smith          cp -fr bmake/${PETSC_ARCH} ${INSTALL_DIR}/bmake;\
2343c94ec11SBarry Smith          cp -fr bin ${INSTALL_DIR};\
2353c94ec11SBarry Smith          if [ ! -d ${INSTALL_DIR}/lib ]; then \
2363c94ec11SBarry Smith	    mkdir ${INSTALL_DIR}/lib ; \
2373c94ec11SBarry Smith          fi;\
2383c94ec11SBarry Smith          for i in lib/lib*; do \
2393c94ec11SBarry Smith            bopt=`echo $${i} | ${SED} s=lib/lib==g`;\
2403c94ec11SBarry Smith            if [ ! -d ${INSTALL_DIR}/$${i} ]; then \
2413c94ec11SBarry Smith              mkdir ${INSTALL_DIR}/$${i};\
2423c94ec11SBarry Smith            fi; \
2433c94ec11SBarry Smith            if [ -d $${i}/${PETSC_ARCH} ]; then \
2443c94ec11SBarry Smith              cp -fr $${i}/${PETSC_ARCH} ${INSTALL_DIR}/$${i};\
2453c94ec11SBarry Smith              ${RANLIB}  ${INSTALL_DIR}/$${i}/*.a > /dev/null 2>&1 ;\
2463c94ec11SBarry Smith              ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${INSTALL_DIR} BOPT=$${bopt} shared; \
2473c94ec11SBarry Smith            fi;\
2483c94ec11SBarry Smith          done;\
2493c94ec11SBarry Smith          echo "sh/bash: PETSC_DIR="${INSTALL_DIR}"; export PETSC_DIR";\
2503c94ec11SBarry Smith          echo "csh/tcsh: setenv PETSC_DIR "${INSTALL_DIR} ;\
2513c94ec11SBarry Smith          echo "The do make test to verify correct install";\
2523c94ec11SBarry Smith        fi;
2533c94ec11SBarry Smith
2543c94ec11SBarry Smithinstall_src:
2553c94ec11SBarry Smith	-@if [ "${INSTALL_DIR}" == "${PETSC_DIR}" ]; then \
2563c94ec11SBarry Smith	  echo "You did not set a directory to install to";\
2573c94ec11SBarry Smith        else \
2583c94ec11SBarry Smith	  echo Installing PETSc source at ${INSTALL_DIR};\
2593c94ec11SBarry Smith          if [ ! -d `dirname ${INSTALL_DIR}` ]; then \
2603c94ec11SBarry Smith	    mkdir `dirname ${INSTALL_DIR}` ; \
2613c94ec11SBarry Smith          fi;\
2623c94ec11SBarry Smith          if [ ! -d ${INSTALL_DIR} ]; then \
2633c94ec11SBarry Smith	    mkdir ${INSTALL_DIR} ; \
2643c94ec11SBarry Smith          fi;\
2653c94ec11SBarry Smith          cp -fr src ${INSTALL_DIR};\
2663c94ec11SBarry Smith        fi;
2673c94ec11SBarry Smith
2683c94ec11SBarry Smithinstall_docs:
2693c94ec11SBarry Smith	-@if [ "${INSTALL_DIR}" == "${PETSC_DIR}" ]; then \
2703c94ec11SBarry Smith	  echo "You did not set a directory to install to";\
2713c94ec11SBarry Smith        else \
2723c94ec11SBarry Smith	  echo Installing PETSc documentation at ${INSTALL_DIR};\
2733c94ec11SBarry Smith          if [ ! -d `dirname ${INSTALL_DIR}` ]; then \
2743c94ec11SBarry Smith	    mkdir `dirname ${INSTALL_DIR}` ; \
2753c94ec11SBarry Smith          fi;\
2763c94ec11SBarry Smith          if [ ! -d ${INSTALL_DIR} ]; then \
2773c94ec11SBarry Smith	    mkdir ${INSTALL_DIR} ; \
2783c94ec11SBarry Smith          fi;\
2793c94ec11SBarry Smith          cp -fr docs ${INSTALL_DIR};\
2803c94ec11SBarry Smith          ${RM} -fr docs/tex;\
2813677444aSSatish Balay        fi;
2823677444aSSatish Balay# ------------------------------------------------------------------
2833677444aSSatish Balay#
2843677444aSSatish Balay# All remaining actions are intended for PETSc developers only.
2853677444aSSatish Balay# PETSc users should not generally need to use these commands.
2863677444aSSatish Balay#
28765783a8cSBarry Smith
28865783a8cSBarry Smith# To access the tags in EMACS, type M-x visit-tags-table and specify
28965783a8cSBarry Smith# the file petsc/TAGS.
29065783a8cSBarry Smith# 1) To move to where a PETSc function is defined, enter M-. and the
29165783a8cSBarry Smith#     function name.
29265783a8cSBarry Smith# 2) To search for a string and move to the first occurrence,
2937acb7333SLois Curfman McInnes#     use M-x tags-search and the string.
29411b6ed10SLois Curfman McInnes#     To locate later occurrences, use M-,
29511b6ed10SLois Curfman McInnes# Builds all etags files
296*bcfca60cSBarry Smithalletags:
297*bcfca60cSBarry Smith	-@${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSDIR=${PETSC_DIR} etags
298*bcfca60cSBarry Smith	-@${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSDIR=${PETSC_DIR} etags_noexamples
299*bcfca60cSBarry Smith	-@${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSDIR=${PETSC_DIR} etags_examples
3004fa9d4e7SBarry Smith	-@${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSDIR=${PETSC_DIR} etags_makefiles
30120563c6bSBarry Smith# Builds complete etags list
302*bcfca60cSBarry Smithetags:
303*bcfca60cSBarry Smith	-@${RM} ${TAGSDIR}/TAGS
304*bcfca60cSBarry Smith	-@touch ${TAGSDIR}/TAGS
305*bcfca60cSBarry 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
306*bcfca60cSBarry Smith	-@cd src/fortran; ${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_sourcef alltree
30711b6ed10SLois Curfman McInnes	-@${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS etags_bmakefiles
308bfce26a3SBarry Smith# Builds the etags file that excludes the examples directories
309*bcfca60cSBarry Smithetags_noexamples:
310*bcfca60cSBarry Smith	-@${RM} ${TAGSDIR}/TAGS_NO_EXAMPLES
311*bcfca60cSBarry Smith	-@touch ${TAGSDIR}/TAGS_NO_EXAMPLES
312*bcfca60cSBarry Smith	-@${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES ACTION=etags_sourcec alltree
313*bcfca60cSBarry Smith	-@${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES ACTION=etags_sourcej alltree
314*bcfca60cSBarry Smith	-@${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES ACTION=etags_sourceh alltree
315*bcfca60cSBarry Smith	-@cd src/fortran; ${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES ACTION=etags_sourcef alltree
316*bcfca60cSBarry Smith	-@${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES ACTION=etags_makefile alltree
317*bcfca60cSBarry Smith	-@${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES etags_bmakefiles
31811b6ed10SLois Curfman McInnes	-@${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES ACTION=etags_docs alltree
319b16a3bb1SBarry Smith# Builds the etags file for makefiles
320*bcfca60cSBarry Smithetags_makefiles:
321*bcfca60cSBarry Smith	-@${RM} ${TAGSDIR}/TAGS_MAKEFILES
322*bcfca60cSBarry Smith	-@touch ${TAGSDIR}/TAGS_MAKEFILES
323*bcfca60cSBarry Smith	-@${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_MAKEFILES ACTION=etags_makefile alltree
324dc80aa23SSatish Balay	-@${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_MAKEFILES etags_bmakefiles
325dc80aa23SSatish Balay# Builds the etags file for examples
326*bcfca60cSBarry Smithetags_examples:
327*bcfca60cSBarry Smith	-@${RM} ${TAGSDIR}/TAGS_EXAMPLES
328*bcfca60cSBarry Smith	-@touch ${TAGSDIR}/TAGS_EXAMPLES
329*bcfca60cSBarry Smith	-@${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_EXAMPLES ACTION=etags_examplesc alltree
330*bcfca60cSBarry Smith	-@${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_EXAMPLES ACTION=etags_examplesch alltree
331*bcfca60cSBarry Smith	-@${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_EXAMPLES ACTION=etags_examplesf alltree
3322176044fSSatish Balay	-@${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_EXAMPLES ACTION=etags_examplesfh alltree
333*bcfca60cSBarry Smithetags_fexamples:
334*bcfca60cSBarry Smith	-@${RM} ${TAGSDIR}/TAGS_FEXAMPLES
335*bcfca60cSBarry Smith	-@touch ${TAGSDIR}/TAGS_FEXAMPLES
336*bcfca60cSBarry Smith	-@${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_FEXAMPLES ACTION=etags_examplesf alltree
337b38bb785SSatish Balay	-@${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_EXAMPLES ACTION=etags_examplesfh alltree
338f20f7ba3SSatish Balay#
3393677444aSSatish Balay# These are here for the target allci and allco, and etags
340b38bb785SSatish Balay#
34123bef294SSatish Balay
342516d1546SSatish BalayBMAKEFILES = bmake/common/base bmake/common/test \
3432bda9e70SSatish Balay	     bmake/common/bopt* bmake/*/rules bmake/*/variables bmake/*/packages \
3442905d4d4SKris Buschelman	     bmake/*/petscconf.h bmake/*/petscfix.h bmake/config/packages.in \
34537dc49f7SBarry Smith	     bmake/config/petscfix.h.in  bmake/config/rules.in  \
3462f1ebae6SLois Curfman McInnes	     bmake/config/variables.in bmake/adic.init bmake/adicmf.init
347d56c4d9fSBarry SmithDOCS	   = bmake/readme bmake/petscconf.defs
348d56c4d9fSBarry SmithSCRIPTS    = maint/builddist  maint/wwwman maint/xclude maint/crontab python/PETSc/Configure.py python/PETSc/Options.py \
349d56c4d9fSBarry Smith             python/PETSc/packages/ADIC.py python/PETSc/packages/MPE.py python/PETSc/packages/Mathematica.py \
350d56c4d9fSBarry Smith             python/PETSc/packages/PLAPACK.py python/PETSc/packages/Triangle.py python/PETSc/packages/Matlab.py \
351d56c4d9fSBarry Smith             python/PETSc/packages/PVODE.py python/PETSc/packages/BlasLapack.py python/PETSc/packages/MPI.py \
352e9f3bb17SBarry Smith             python/PETSc/packages/BlockSolve.py python/PETSc/packages/NetCDF.py python/PETSc/packages/ParMetis.py \
353d56c4d9fSBarry Smith             python/PETSc/packages/update.py maint/confignightly/* config/*.py
35411b6ed10SLois Curfman McInnes
3556b91f8d1SSatish Balay
3566b91f8d1SSatish Balayupdatewebdocs:
3576b91f8d1SSatish Balay	-chmod -R ug+w /mcs/tmp/petsc-tmp
3586b91f8d1SSatish Balay	-chgrp -R petsc /mcs/tmp/petsc-tmp
3596b91f8d1SSatish Balay	-/bin/rm -rf /mcs/tmp/petscdocs
3606b91f8d1SSatish Balay	-/bin/cp -r /mcs/tmp/petsc-tmp/docs /mcs/tmp/petscdocs
3616b91f8d1SSatish Balay	-maint/update-docs.py /mcs/tmp/petscdocs
3626b91f8d1SSatish Balay	-find /mcs/tmp/petscdocs -type d -name "*" -exec chmod g+w {} \;
3636b91f8d1SSatish Balay	-/bin/cp -r /mcs/tmp/petscdocs/* ${PETSC_DIR}/docs
3646b91f8d1SSatish Balay	-/bin/rm -rf /mcs/tmp/petscdocs
365ad56a76cSSatish Balay
366ad56a76cSSatish Balaychk_loc:
367ad56a76cSSatish Balay	@if [ ${LOC}foo = foo ] ; then \
368ad56a76cSSatish Balay	  echo "*********************** ERROR ************************" ; \
369ad56a76cSSatish Balay	  echo " Please specify LOC variable for eg: make allmanualpages LOC=/sandbox/petsc"; \
3702496ca06SSatish Balay	  echo "******************************************************";  false; fi
371a2fc510eSBarry Smith
372f1d13e97SSatish Balay# Builds all the documentation - should be done every night
373f1d13e97SSatish Balayalldoc: alldoc1 alldoc2
374f1d13e97SSatish Balay
375f1d13e97SSatish Balay# Build everything that goes into 'doc' dir except html sources
376130c9832SBarry Smithalldoc1: chk_loc deletemanualpages chk_concepts_dir
377fe742e3dSSatish Balay	-${OMAKE} ACTION=manualpages_buildcite tree_basic LOC=${LOC}
378130c9832SBarry Smith	cd docs/tex/manual; ${OMAKE} manual.pdf LOC=${LOC}
37948b2c0e9SBarry Smith	-${OMAKE} ACTION=manualpages tree_basic LOC=${LOC}
380130c9832SBarry Smith	-maint/wwwindex.py ${PETSC_DIR} ${LOC}
381130c9832SBarry Smith	-${OMAKE} ACTION=manexamples tree LOC=${LOC}
38248b2c0e9SBarry Smith	-${OMAKE} manconcepts LOC=${LOC}
38348b2c0e9SBarry Smith	-${OMAKE} ACTION=getexlist tree LOC=${LOC}
38448b2c0e9SBarry Smith	-${OMAKE} ACTION=exampleconcepts tree LOC=${LOC}
385e01137a2SSatish Balay	-maint/helpindex.py ${PETSC_DIR} ${LOC}
386435da068SBarry Smith
387062da8f7SSatish Balay# Builds .html versions of the source
388f1d13e97SSatish Balay# html overwrites some stuff created by update-docs - hence this is done later.
3893a2060ecSSatish Balayalldoc2: chk_loc
390062da8f7SSatish Balay	-${OMAKE} ACTION=html PETSC_DIR=${PETSC_DIR} alltree LOC=${LOC}
391435da068SBarry Smith	-maint/update-docs.py ${LOC}
392efaa7783SSatish Balay
393efaa7783SSatish Balayalldocclean: deletemanualpages allcleanhtml
394efaa7783SSatish Balay
395efaa7783SSatish Balay# Deletes man pages (HTML version)
396efaa7783SSatish Balaydeletemanualpages: chk_loc
397efaa7783SSatish Balay	find ${LOC}/docs/manualpages -type f -name "*.html" -exec ${RM} {} \;
398efaa7783SSatish Balay	${RM} ${LOC}/docs/tex/exampleconcepts
399efaa7783SSatish Balay	${RM} ${LOC}/docs/tex/manconcepts
400efaa7783SSatish Balay	${RM} ${LOC}/docs/manualpages/manualpages.cit
401efaa7783SSatish Balay	-maint/update-docs.py ${LOC} clean
402115a300dSBarry Smith
403efaa7783SSatish Balayallcleanhtml:
404cc4dcc40SBarry Smith	-${RM} include/adic/*.h.html include/esi/petsc/*.h.html
405395565bcSBarry Smith	-${OMAKE} ACTION=cleanhtml PETSC_DIR=${PETSC_DIR} alltree
406ad56a76cSSatish Balay
407fe742e3dSSatish Balaychk_concepts_dir: chk_loc
408bfe54af3SSatish Balay	@if [ ! -d "${LOC}/docs/manualpages/concepts" ]; then \
409bdde29a3SBarry Smith	  echo Making directory ${LOC}/docs/manualpages/concepts for library; ${MKDIR} ${LOC}/docs/manualpages/concepts; fi
410bdde29a3SBarry Smith#
411bdde29a3SBarry Smith#  checks if should build Fortran stubs
412da77a087SBarry Smithchk_fortranstubs:
413bdde29a3SBarry Smith	-@if [ ! -f "${PETSC_DIR}/src/fortran/auto/makefile.src" -a "${C_FC}" != "" ]; then \
414bdde29a3SBarry Smith          ${OMAKE} PETSC_DIR=${PETSC_DIR} allfortranstubs ;\
415bdde29a3SBarry Smith        fi
41611b6ed10SLois Curfman McInnes
41711b6ed10SLois Curfman McInnes# Builds Fortran stub files
41809d4790eSSatish Balayallfortranstubs:
4199c0ff1f6SBarry Smith	-@which ${BFORT} > /dev/null 2>&1;  \
4209c0ff1f6SBarry Smith        if [ "$$?" != "0" ]; then \
4219c0ff1f6SBarry Smith          echo "No bfort available, skipping building Fortran stubs";\
4229c0ff1f6SBarry Smith        else \
4239c0ff1f6SBarry Smith          ${RM} -f ${PETSC_DIR}/src/fortran/auto/*.c ;\
4249c0ff1f6SBarry Smith	  touch ${PETSC_DIR}/src/fortran/auto/makefile.src ;\
4259c0ff1f6SBarry Smith	  ${OMAKE} ACTION=fortranstubs tree_basic ;\
4269c0ff1f6SBarry Smith	  cd ${PETSC_DIR}/src/fortran/auto; ${RM} makefile.src; echo SOURCEC = ` ls *.c | tr -s '\n' ' '` > makefile.src ;\
4279c0ff1f6SBarry Smith	  cd ${PETSC_DIR}/src/fortran/auto; ${OMAKE} fixfortran ;\
428f6ff2982SSatish Balay        fi
429d55938c2SBarry Smith
43019552e71SMatthew Knepleyallci:
431b951964fSBarry Smith	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=ci  alltree
432d55938c2SBarry Smith
43319552e71SMatthew Knepleyallco:
434d55938c2SBarry Smith	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=co  alltree
435791d64f4SSatish Balay
436791d64f4SSatish Balay# usage make allrcslabel NEW_RCS_LABEL=v_2_0_28
43719552e71SMatthew Knepleyallrcslabel:
438b334301eSBarry Smith	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} NEW_RCS_LABEL=${NEW_RCS_LABEL} ACTION=rcslabel  alltree
439b334301eSBarry Smith#
440b334301eSBarry Smith#   The commands below are for generating ADIC versions of the code;
441b334301eSBarry Smith# they are not currently used.
4425eea60f9SBarry Smith#
443b87434adSSatish Balayalladicignore:
44419552e71SMatthew Knepley	-@${RM} ${INSTALL_LIB_DIR}/adicignore
4455eea60f9SBarry Smith	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adicignore  tree
4465eea60f9SBarry Smith
447d18b0ea7SBarry Smithalladic:
44867b024f7SSatish Balay	-@echo "Beginning to compile ADIC source code in all directories"
449d18b0ea7SBarry Smith	-@echo "Using ADIC compiler: ${ADIC_CC} ${CCPPFLAGS}"
45047794344SBarry Smith	-@echo "========================================="
45167b024f7SSatish Balay	-@cd include ; \
45219552e71SMatthew Knepley           ${ADIC_CC} -s -f 1 ${CCPPFLAGS} petsc.h
45347794344SBarry Smith	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adic  tree
45419552e71SMatthew Knepley	-@cd src/inline ; \
45577ed5343SBarry Smith            ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} adic
45619552e71SMatthew Knepley	-@cd src/blaslapack ; \
4576e81b665SBarry Smith            ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adic  tree
45847794344SBarry Smith
459d18b0ea7SBarry Smithalladiclib:
460d77bb2e1SSatish Balay	-@echo "Beginning to compile ADIC libraries in all directories"
461d18b0ea7SBarry Smith	-@echo "Using compiler: ${CC} ${COPTFLAGS}"
462d77bb2e1SSatish Balay	-@echo "-----------------------------------------"
463d18b0ea7SBarry Smith	-@echo "Using PETSc flags: ${PETSCFLAGS} ${PCONF}"
464e0e703c1SSatish Balay	-@echo "-----------------------------------------"
465ba1077baSMatthew Knepley	-@echo "Using configuration flags:"
466d18b0ea7SBarry Smith	-@grep "define " bmake/${INLUDE_ARCH}/petscconf.h
467d77bb2e1SSatish Balay	-@echo "-----------------------------------------"
468d18b0ea7SBarry Smith	-@echo "Using include paths: ${PETSC_INCLUDE}"
469d77bb2e1SSatish Balay	-@echo "-----------------------------------------"
47019552e71SMatthew Knepley	-@echo "Using PETSc directory: ${PETSC_DIR}"
471d18b0ea7SBarry Smith	-@echo "Using PETSc arch: ${PETSC_ARCH}"
4725fde6e02SSatish Balay	-@echo "========================================="
47319552e71SMatthew Knepley	-@${RM} -f  ${INSTALL_LIB_DIR}/*adic.${LIB_SUFFIX}
47477ed5343SBarry Smith	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adiclib  tree
47519552e71SMatthew Knepley	-@cd src/blaslapack ; \
4767e351921SBarry Smith            ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adiclib  tree
47719552e71SMatthew Knepley	-@cd src/adic/src ; \
4785eea60f9SBarry Smith            ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} lib
4799e417c50SSatish Balay
4809e417c50SSatish Balay# -------------------------------------------------------------------------------
4819e417c50SSatish Balay#
4829e417c50SSatish Balay# Some macros to check if the fortran interface is up-to-date.
4839e417c50SSatish Balay#
484d77bb2e1SSatish Balaycountfortranfunctions:
48585c7cd6cSSatish Balay	-@cd ${PETSC_DIR}/src/fortran; egrep '^void' custom/*.c auto/*.c | \
4869e417c50SSatish Balay	cut -d'(' -f1 | tr -s  ' ' | cut -d' ' -f2 | uniq | egrep -v "(^$$|Petsc)" | \
487b334301eSBarry Smith	sed "s/_$$//" | sort > /tmp/countfortranfunctions
4889e417c50SSatish Balay
48985c7cd6cSSatish Balaycountcfunctions:
49085c7cd6cSSatish Balay	-@ grep extern ${PETSC_DIR}/include/*.h *.h | grep "(" | tr -s ' ' | \
4919e417c50SSatish Balay	cut -d'(' -f1 | cut -d' ' -f3 | grep -v "\*" | tr -s '\012' |  \
4929e417c50SSatish Balay	tr 'A-Z' 'a-z' |  sort > /tmp/countcfunctions
4939e417c50SSatish Balay
4949e417c50SSatish Balaydifffortranfunctions: countfortranfunctions countcfunctions
4959700b7f8SSatish Balay	-@echo -------------- Functions missing in the fortran interface ---------------------
4969e417c50SSatish Balay	-@${DIFF} /tmp/countcfunctions /tmp/countfortranfunctions | grep "^<" | cut -d' ' -f2
4979700b7f8SSatish Balay	-@echo ----------------- Functions missing in the C interface ------------------------
498d77bb2e1SSatish Balay	-@${DIFF} /tmp/countcfunctions /tmp/countfortranfunctions | grep "^>" | cut -d' ' -f2
499b334301eSBarry Smith	-@${RM}  /tmp/countcfunctions /tmp/countfortranfunctions
5003f4c9a3aSSatish Balay
5013f4c9a3aSSatish Balaycheckbadfortranstubs:
5023f4c9a3aSSatish Balay	-@echo "========================================="
5033f4c9a3aSSatish Balay	-@echo "Functions with MPI_Comm as an Argument"
504d77bb2e1SSatish Balay	-@echo "========================================="
50585c7cd6cSSatish Balay	-@cd ${PETSC_DIR}/src/fortran/auto; grep '^void' *.c | grep 'MPI_Comm' | \
5063f4c9a3aSSatish Balay	tr -s ' ' | tr -s ':' ' ' |cut -d'(' -f1 | cut -d' ' -f1,3
5073f4c9a3aSSatish Balay	-@echo "========================================="
5083f4c9a3aSSatish Balay	-@echo "Functions with a String as an Argument"
509d77bb2e1SSatish Balay	-@echo "========================================="
51085c7cd6cSSatish Balay	-@cd ${PETSC_DIR}/src/fortran/auto; grep '^void' *.c | grep 'char \*' | \
5113f4c9a3aSSatish Balay	tr -s ' ' | tr -s ':' ' ' |cut -d'(' -f1 | cut -d' ' -f1,3
5123f4c9a3aSSatish Balay	-@echo "========================================="
5133f4c9a3aSSatish Balay	-@echo "Functions with Pointers to PETSc Objects as Argument"
514d77bb2e1SSatish Balay	-@echo "========================================="
51585c7cd6cSSatish Balay	-@cd ${PETSC_DIR}/src/fortran/auto; \
51685c7cd6cSSatish Balay	_p_OBJ=`grep _p_ ${PETSC_DIR}/include/*.h | tr -s ' ' | \
5173f4c9a3aSSatish Balay	cut -d' ' -f 3 | tr -s '\012' | grep -v '{' | cut -d'*' -f1 | \
5183f4c9a3aSSatish Balay	sed "s/_p_//g" | tr -s '\012 ' ' *|' ` ; \
51985c7cd6cSSatish Balay	for OBJ in $$_p_OBJ; do \
5203f4c9a3aSSatish Balay	grep "$$OBJ \*" *.c | tr -s ' ' | tr -s ':' ' ' | \
5213f4c9a3aSSatish Balay	cut -d'(' -f1 | cut -d' ' -f1,3; \
5224556b810SBarry Smith	done
5234556b810SBarry Smith#
524b6ea66eeSBarry Smith# Automatically generates PETSc exercises in html from the tutorial examples.
52575df30afSSatish Balay#
526b6ea66eeSBarry Smith# The introduction for each section is obtained from docs/manualpages/header_${MANSEC} is under RCS and may be edited
527b6ea66eeSBarry Smith#  (used also in introductions to the manual pages)
528b6ea66eeSBarry Smith# The overall introduction is in docs/exercises/introduction.html and is under RCS and may be edited
529b6ea66eeSBarry Smith# The list of exercises is from TUTORIALS in each directory's makefile
5304556b810SBarry Smith#
5314556b810SBarry Smith# DO NOT EDIT the pageform.txt or *.htm files generated since they will be automatically replaced.
5324556b810SBarry Smith# The pagemaker rule is in the file bmake/common (at the bottom)
533843ae28eSBarry Smith#
53497e8d271SBarry Smith# Eventually the line below will replace the two cd in the rule below, it is just this way now for speed
535843ae28eSBarry Smith#	-@${OMAKE} PETSC_DIR=${PETSC_DIR} pagemaker
53697e8d271SBarry Smith#
53797e8d271SBarry Smithexercises:
53897e8d271SBarry Smith	-@echo "========================================="
539467fbd6dSBarry Smith	-@echo "Generating HTML tutorial exercises"
54097e8d271SBarry Smith	-@${RM} docs/pageform.txt
54197e8d271SBarry Smith	-@echo "title=\"PETSc Exercises\""                >  docs/pageform.txt
542beb1b3a5SBarry Smith	-@echo "access_title=Exercise Sections"              >>  docs/pageform.txt
54397e8d271SBarry Smith	-@echo "access_format=short"                        >> docs/pageform.txt
54497e8d271SBarry Smith	-@echo "startpage=../exercises/introduction.htm"  >> docs/pageform.txt
54597e8d271SBarry Smith	-@echo "NONE title=\"Introduction\" command=link src=../exercises/introduction.htm" >> docs/pageform.txt
54697e8d271SBarry Smith	-@echo "Generating HTML for individual directories"
547beb1b3a5SBarry Smith	-@echo "========================================="
54897e8d271SBarry Smith	-@${OMAKE} PETSC_DIR=${PETSC_DIR} ACTION=pagemaker tree
54997e8d271SBarry Smith	-@echo "Completed HTML for individual directories"
55097e8d271SBarry Smith	-@echo "NONE title=\"<HR>\" " >> docs/pageform.txt;
55197e8d271SBarry Smith	-@echo "NONE title=\"PETSc Documentation\" command=link src=../index.html target=replace" >> docs/pageform.txt
55297e8d271SBarry Smith	/home/MPI/class/mpiexmpl/maint/makepage.new -pageform=docs/pageform.txt -access_extra=/dev/null -outdir=docs/exercises
55397e8d271SBarry Smith	-@echo "========================================="
554b4b3a923SMatthew Knepley
555b4b3a923SMatthew Knepley# Make a tarball of all the Python code
556b4b3a923SMatthew Knepley#   This is currently used to release to the Teragrid
557b4b3a923SMatthew KnepleypetscPython.tgz:
558b4b3a923SMatthew Knepley	@tar cvzf $@ --exclude SCCS --exclude BitKeeper --dereference python/
559b4b3a923SMatthew Knepley	-@scp $@ tg-login2.uc.teragrid.org:./
5608852b4e5SMatthew Knepley
561a42cec9dSMatthew Knepley.PHONY: info info_h all all_build build testexamples testfortran testexamples_uni testfortran_uni ranlib deletelibs allclean update chk_petsc_dir \
562a42cec9dSMatthew Knepley        alletags etags etags_complete etags_noexamples etags_makefiles etags_examples etags_fexamples updatewebdocs alldoc allmanualpages \
563b4b3a923SMatthew Knepley        allhtml allcleanhtml allfortranstubs allci allco allrcslabel alladicignore alladic alladiclib countfortranfunctions \
564f7819401SBarry Smith        start_configure configure_petsc configure_clean petscPython.tgz
565
566