xref: /petsc/makefile (revision f251bdbd1d9e8529587f82c093daf4686cd196a5)
1#
2# This is the makefile for compiling PETSc. See
3# http://www.mcs.anl.gov/petsc/petsc-as/documentation/installation.html for directions on installing PETSc.
4# See also bmake/common for additional commands.
5#
6ALL: all
7LOCDIR = .
8DIRS   = src include
9
10include ${PETSC_DIR}/bmake/common/base
11include ${PETSC_DIR}/bmake/common/test
12
13#
14# Basic targets to build PETSc libraries.
15# all: builds the c, fortran, and f90 libraries
16all:
17	@${OMAKE}  PETSC_ARCH=${PETSC_ARCH}  chkpetsc_dir
18	-@${OMAKE} all_build 2>&1 | tee make_log_${PETSC_ARCH}
19	-@egrep -i "( error | error:)" make_log_${PETSC_ARCH} > /dev/null; if [ "$$?" = "0" ]; then \
20           echo "********************************************************************"; \
21           echo "  Error during compile, check make_log_${PETSC_ARCH}"; \
22           echo "  Send it and configure.log to petsc-maint@mcs.anl.gov";\
23           echo "********************************************************************"; \
24           exit 1; fi
25
26all_build: chk_petsc_dir chklib_dir info info_h deletelibs  build shared
27#
28# Prints information about the system and version of PETSc being compiled
29#
30info:
31	-@echo "=========================================="
32	-@echo " "
33	-@echo "See docs/faq.html and docs/bugreporting.html"
34	-@echo "for help with installation problems. Please send EVERYTHING"
35	-@echo "printed out below when reporting problems"
36	-@echo " "
37	-@echo "To subscribe to the PETSc users mailing list, send mail to "
38	-@echo "majordomo@mcs.anl.gov with the message: "
39	-@echo "subscribe petsc-announce"
40	-@echo " "
41	-@echo "=========================================="
42	-@echo On `date` on `hostname`
43	-@echo Machine characteristics: `uname -a`
44	-@echo "-----------------------------------------"
45	-@echo "Using PETSc directory: ${PETSC_DIR}"
46	-@echo "Using PETSc arch: ${PETSC_ARCH}"
47	-@echo "-----------------------------------------"
48	-@grep "define PETSC_VERSION" ${PETSC_DIR}/include/petscversion.h | ${SED} "s/........//"
49	-@echo "-----------------------------------------"
50	-@echo "Using configuration flags:"
51	-@grep "\#define " ${PETSC_DIR}/bmake/${PETSC_ARCH}/petscconf.h
52	-@echo "-----------------------------------------"
53	-@echo "Using include paths: ${PETSC_INCLUDE}"
54	-@echo "------------------------------------------"
55	-@echo "Using C/C++ compiler: ${CC} ${CC_FLAGS} ${COPTFLAGS} ${CFLAGS}"
56	-@echo "C/C++ Compiler version: " `${CCV}`
57	-@if [ "${FC}" != "" ]; then \
58	   echo "Using Fortran compiler: ${FC} ${FC_FLAGS} ${FFLAGS} ${FPP_FLAGS}";\
59	   echo "Fortran Compiler version: " `${FCV}`;\
60         fi
61	-@echo "-----------------------------------------"
62	-@echo "Using C/C++ linker: ${CC_LINKER}"
63	-@if [ "${FC}" != "" ]; then \
64	   echo "Using Fortran linker: ${FC_LINKER}";\
65         fi
66	-@echo "-----------------------------------------"
67	-@echo "Using libraries: ${PETSC_LIB}"
68	-@echo "------------------------------------------"
69	-@echo "Using mpirun: ${MPIRUN}"
70	-@echo "=========================================="
71#
72#
73MINFO = ${PETSC_DIR}/bmake/${PETSC_ARCH}/petscmachineinfo.h
74info_h:
75	-@$(RM) -f MINFO ${MINFO}
76	-@echo  "static const char *petscmachineinfo = \"  " >> MINFO
77	-@echo  "Libraries compiled on `date` on `hostname` " >> MINFO
78	-@echo  Machine characteristics: `uname -a` "" >> MINFO
79	-@echo  "Using PETSc directory: ${PETSC_DIR}" >> MINFO
80	-@echo  "Using PETSc arch: ${PETSC_ARCH}" >> MINFO
81	-@echo  "-----------------------------------------\"; " >> MINFO
82	-@echo  "static const char *petsccompilerinfo = \"  " >> MINFO
83	-@echo  "Using C compiler: ${CC} ${CC_FLAGS} ${COPTFLAGS} ${CFLAGS} " >> MINFO
84	-@echo  "C Compiler version:"  >> MINFO ; ${C_CCV} >> MINFO 2>&1 ; true
85	-@echo  "C++ Compiler version:"  >> MINFO; ${CXX_CCV} >> MINFO 2>&1 ; true
86	-@echo  "Using Fortran compiler: ${FC} ${FC_FLAGS} ${FFLAGS} ${FPP_FLAGS}" >> MINFO
87	-@echo  "Fortran Compiler version:" >> MINFO ; ${FCV} >> MINFO 2>&1 ; true
88	-@echo  "-----------------------------------------\"; " >> MINFO
89	-@echo  "static const char *petsccompilerflagsinfo = \"  " >> MINFO
90	-@echo  "Using include paths: ${PETSC_INCLUDE}" >> MINFO
91	-@echo  "------------------------------------------\"; " >> MINFO
92	-@echo  "static const char *petsclinkerinfo = \"  " >> MINFO
93	-@echo  "Using C linker: ${CLINKER}" >> MINFO
94	-@echo  "Using Fortran linker: ${FLINKER}" >> MINFO
95	-@echo  "Using libraries: ${PETSC_LIB} \"; " >> MINFO
96	-@cat MINFO | ${SED} -e 's/\^M//g' | ${SED} -e 's/\\/\\\\/g' | ${SED} -e 's/$$/ \\n\\/' | sed -e 's/\;  \\n\\/\;/'> MINFO_
97	-@cat MINFO_ | ${SED} -e 's/\
98//g'  > /dev/null; foobar=$$?; \
99          if [ "$$foobar" = "0" ]; then \
100	    cat MINFO_ | ${SED} -e 's/\
101//g' > ${MINFO}; \
102          else cat MINFO | ${SED} -e 's/\^M//g' | ${SED} -e 's/\\/\\\\/g' | ${SED} -e 's/$$/ \\n\\/' | sed -e 's/\;  \\n\\/\;/'> ${MINFO}; \
103          fi
104	-@$(RM) MINFO MINFO_
105
106#
107# Builds the PETSc libraries
108# This target also builds fortran77 and f90 interface
109# files and compiles .F files
110#
111build:
112	-@echo "BEGINNING TO COMPILE LIBRARIES IN ALL DIRECTORIES"
113	-@echo "========================================="
114	-@${OMAKE}  PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=libfast tree
115	-@${RANLIB} ${PETSC_LIB_DIR}/*.${AR_LIB_SUFFIX}
116	-@echo "Completed building libraries"
117	-@echo "========================================="
118#
119# Builds the Python wrappers
120python:
121	-@if [ -d "${PETSC_DIR}/src/python/PETSc" ]; then \
122	  echo "COMPILING PYTHON WRAPPERS"; \
123	  echo "========================================="; \
124	  PYTHONPATH=${PETSC_DIR}/python:${PETSC_DIR}/python/BuildSystem ./make.py ${CONFIGURE_OPTIONS} --with-fc=0 --with-cxx=0 --with-petsc-arch=${PETSC_ARCH} --with-petsc-shared=0 --ignoreCompileOutput=1; \
125	  echo "Completed building Python wrappers"; \
126	  echo "========================================="; \
127	fi
128#
129# Builds PETSc test examples for a given architecture
130#
131test:
132	-@echo "Running test examples to verify correct installation"
133	@cd src/snes/examples/tutorials; ${OMAKE} PETSC_ARCH=${PETSC_ARCH}  PETSC_DIR=${PETSC_DIR} testex19
134	@if [ "${FC}" != "" ]; then cd src/snes/examples/tutorials; ${OMAKE} PETSC_ARCH=${PETSC_ARCH}  PETSC_DIR=${PETSC_DIR} testex5f; fi;
135	-@echo "Completed test examples"
136
137testexamples: info
138	-@echo "BEGINNING TO COMPILE AND RUN TEST EXAMPLES"
139	-@echo "Due to different numerical round-off on certain"
140	-@echo "machines some of the numbers may not match exactly."
141	-@echo "========================================="
142	-@${OMAKE} PETSC_ARCH=${PETSC_ARCH}  PETSC_DIR=${PETSC_DIR} ACTION=testexamples_C  tree
143	-@echo "Completed compiling and running test examples"
144	-@echo "========================================="
145testfortran: info
146	-@echo "BEGINNING TO COMPILE AND RUN FORTRAN TEST EXAMPLES"
147	-@echo "========================================="
148	-@echo "Due to different numerical round-off on certain"
149	-@echo "machines or the way Fortran formats numbers"
150	-@echo "some of the results may not match exactly."
151	-@echo "========================================="
152	-@if [ "${FC}" != "" ]; then \
153            ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=testexamples_Fortran tree; \
154            echo "Completed compiling and running Fortran test examples"; \
155          else \
156            echo "Error: No FORTRAN compiler available"; \
157          fi
158	-@echo "========================================="
159testexamples_uni: info
160	-@echo "BEGINNING TO COMPILE AND RUN TEST UNI-PROCESSOR EXAMPLES"
161	-@echo "Due to different numerical round-off on certain"
162	-@echo "machines some of the numbers may not match exactly."
163	-@echo "========================================="
164	-@${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=testexamples_C_X11_MPIUni  tree
165	-@echo "Completed compiling and running uniprocessor test examples"
166	-@echo "========================================="
167testfortran_uni: info
168	-@echo "BEGINNING TO COMPILE AND RUN TEST UNI-PROCESSOR FORTRAN EXAMPLES"
169	-@echo "Due to different numerical round-off on certain"
170	-@echo "machines some of the numbers may not match exactly."
171	-@echo "========================================="
172	-@if [ "${FC}" != "" ]; then \
173            ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=testexamples_Fortran_MPIUni  tree; \
174            echo "Completed compiling and running uniprocessor fortran test examples"; \
175          else \
176            echo "Error: No FORTRAN compiler available"; \
177          fi
178	-@
179	-@echo "========================================="
180
181# Ranlib on the libraries
182ranlib:
183	${RANLIB} ${PETSC_LIB_DIR}/*.${AR_LIB_SUFFIX}
184
185# Deletes PETSc libraries
186deletelibs:
187	-${RM} -f ${PETSC_LIB_DIR}/lib*.*
188
189# Cleans up build
190allclean: deletelibs
191	-@${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=clean tree
192
193
194#
195# Check if PETSC_DIR variable specified is valid
196#
197chk_petsc_dir:
198	@if [ ! -f ${PETSC_DIR}/include/petscversion.h ]; then \
199	  echo "Incorrect PETSC_DIR specified: ${PETSC_DIR}!"; \
200	  echo "You need to use / to separate directories, not \\!"; \
201	  echo "Aborting build"; \
202	  false; fi
203#
204#
205install:
206	-@if [ "${INSTALL_DIR}" = "${PETSC_DIR}" ]; then \
207	  echo "Install directory is current directory; nothing needs to be done";\
208        else \
209	  echo Installing PETSc at ${INSTALL_DIR};\
210          if [ ! -d `dirname ${INSTALL_DIR}` ]; then \
211	    ${MKDIR} `dirname ${INSTALL_DIR}` ; \
212          fi;\
213          if [ ! -d ${INSTALL_DIR} ]; then \
214	    ${MKDIR} ${INSTALL_DIR} ; \
215          fi;\
216          cp -fr include ${INSTALL_DIR};\
217          if [ ! -d ${INSTALL_DIR}/bmake ]; then \
218	    ${MKDIR} ${INSTALL_DIR}/bmake ; \
219          fi;\
220          cp -f bmake/adic* bmake/variables ${INSTALL_DIR}/bmake ; \
221          cp -fr bmake/common ${INSTALL_DIR}/bmake;\
222          cp -fr bmake/${PETSC_ARCH} ${INSTALL_DIR}/bmake;\
223          cp -fr bin ${INSTALL_DIR};\
224          if [ ! -d ${INSTALL_DIR}/lib ]; then \
225	    ${MKDIR} ${INSTALL_DIR}/lib ; \
226          fi;\
227          for i in lib/lib*; do \
228            if [ ! -d ${INSTALL_DIR}/$${i} ]; then \
229              ${MKDIR} ${INSTALL_DIR}/$${i};\
230            fi; \
231            if [ -d $${i}/${PETSC_ARCH} ]; then \
232              cp -fr $${i}/${PETSC_ARCH} ${INSTALL_DIR}/$${i};\
233              ${RANLIB}  ${INSTALL_DIR}/$${i}/*.a > /dev/null 2>&1 ;\
234              ${OMAKE} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${INSTALL_DIR} shared; \
235            fi;\
236          done;\
237          echo "sh/bash: PETSC_DIR="${INSTALL_DIR}"; export PETSC_DIR";\
238          echo "csh/tcsh: setenv PETSC_DIR "${INSTALL_DIR} ;\
239          echo "Then do make test to verify correct install";\
240        fi;
241
242install_src:
243	-@if [ "${INSTALL_DIR}" = "${PETSC_DIR}" ]; then \
244	  echo "You did not set a directory to install to";\
245        else \
246	  echo Installing PETSc source at ${INSTALL_DIR};\
247          if [ ! -d `dirname ${INSTALL_DIR}` ]; then \
248	    ${MKDIR} `dirname ${INSTALL_DIR}` ; \
249          fi;\
250          if [ ! -d ${INSTALL_DIR} ]; then \
251	    ${MKDIR} ${INSTALL_DIR} ; \
252          fi;\
253          cp -fr src ${INSTALL_DIR};\
254        fi;
255
256install_docs:
257	-@if [ "${INSTALL_DIR}" = "${PETSC_DIR}" ]; then \
258	  echo "You did not set a directory to install to";\
259        else \
260	  echo Installing PETSc documentation at ${INSTALL_DIR};\
261          if [ ! -d `dirname ${INSTALL_DIR}` ]; then \
262	    ${MKDIR} `dirname ${INSTALL_DIR}` ; \
263          fi;\
264          if [ ! -d ${INSTALL_DIR} ]; then \
265	    ${MKDIR} ${INSTALL_DIR} ; \
266          fi;\
267          cp -fr docs ${INSTALL_DIR};\
268          ${RM} -fr docs/tex;\
269        fi;
270# ------------------------------------------------------------------
271#
272# All remaining actions are intended for PETSc developers only.
273# PETSc users should not generally need to use these commands.
274#
275
276# To access the tags in EMACS, type M-x visit-tags-table and specify
277# the file petsc/TAGS.
278# 1) To move to where a PETSc function is defined, enter M-. and the
279#     function name.
280# 2) To search for a string and move to the first occurrence,
281#     use M-x tags-search and the string.
282#     To locate later occurrences, use M-,
283# Builds all etags files
284alletags:
285	-@maint/generateetags.py
286	-@find python -type f -name "*.py" |grep -v SCCS | xargs etags -o TAGS_PYTHON
287
288allfortranstubs:
289	-@maint/generatefortranstubs.py ${BFORT}
290#
291# These are here for the target allci and allco, and etags
292#
293
294BMAKEFILES = bmake/common/base bmake/common/test bmake/adic.init bmake/adicmf.init
295DOCS	   = bmake/readme
296SCRIPTS    = maint/builddist  maint/wwwman maint/xclude maint/bugReport.py maint/buildconfigtest maint/builddistlite \
297             maint/buildtest maint/checkBuilds.py maint/copylognightly maint/copylognightly.tao maint/countfiles maint/findbadfiles \
298             maint/fixinclude maint/getexlist maint/getpdflabels.py maint/helpindex.py maint/hosts.local maint/hosts.solaris  \
299             maint/lex.py  maint/mapnameslatex.py maint/startnightly maint/startnightly.tao maint/submitPatch.py \
300             maint/update-docs.py  maint/wwwindex.py maint/xcludebackup maint/xcludecblas maint/zap maint/zapall \
301             python/PETSc/Configure.py python/PETSc/Options.py \
302             python/PETSc/packages/*.py python/PETSc/utilities/*.py
303
304chk_loc:
305	@if [ ${LOC}foo = foo ] ; then \
306	  echo "*********************** ERROR ************************" ; \
307	  echo " Please specify LOC variable for eg: make allmanualpages LOC=/sandbox/petsc"; \
308	  echo "******************************************************";  false; fi
309	@${MKDIR} ${LOC}/docs/manualpages
310
311# Builds all the documentation - should be done every night
312alldoc: alldoc1 alldoc2
313
314# Build everything that goes into 'doc' dir except html sources
315alldoc1: chk_loc deletemanualpages chk_concepts_dir
316	-${OMAKE} ACTION=manualpages_buildcite tree_basic LOC=${LOC}
317	-@sed -e s%man+../%man+manualpages/% ${LOC}/docs/manualpages/manualpages.cit > ${LOC}/docs/manualpages/htmlmap
318	-@cat ${PETSC_DIR}/src/docs/mpi.www.index >> ${LOC}/docs/manualpages/htmlmap
319	cd src/docs/tex/manual; ${OMAKE} manual.pdf LOC=${LOC}
320	-${OMAKE} ACTION=manualpages tree_basic LOC=${LOC}
321	-maint/wwwindex.py ${PETSC_DIR} ${LOC}
322	-${OMAKE} ACTION=manexamples tree_basic LOC=${LOC}
323	-${OMAKE} manconcepts LOC=${LOC}
324	-${OMAKE} ACTION=getexlist tree_basic LOC=${LOC}
325	-${OMAKE} ACTION=exampleconcepts tree_basic LOC=${LOC}
326	-maint/helpindex.py ${PETSC_DIR} ${LOC}
327	-grep -h Polymorphic include/*.h | grep -v '#define ' | sed "s?PetscPolymorphic[a-zA-Z]*(??g" | cut -f1 -d"{" > tmppoly
328	-maint/processpoly.py ${PETSC_DIR} ${LOC}
329	-${RM} tmppoly
330
331# Builds .html versions of the source
332# html overwrites some stuff created by update-docs - hence this is done later.
333alldoc2: chk_loc
334	-${OMAKE} ACTION=html PETSC_DIR=${PETSC_DIR} alltree LOC=${LOC}
335	-maint/update-docs.py ${PETSC_DIR} ${LOC}
336
337alldocclean: deletemanualpages allcleanhtml
338
339# Deletes man pages (HTML version)
340deletemanualpages: chk_loc
341	-@if [ -d ${LOC} -a -d ${LOC}/docs/manualpages ]; then \
342          find ${LOC}/docs/manualpages -type f -name "*.html" -exec ${RM} {} \; ;\
343          ${RM} ${LOC}/docs/exampleconcepts ;\
344          ${RM} ${LOC}/docs/manconcepts ;\
345          ${RM} ${LOC}/docs/manualpages/manualpages.cit ;\
346          maint/update-docs.py ${PETSC_DIR} ${LOC} clean;\
347        fi
348
349allcleanhtml:
350	-${RM} include/adic/*.h.html
351	-${OMAKE} ACTION=cleanhtml PETSC_DIR=${PETSC_DIR} alltree
352
353chk_concepts_dir: chk_loc
354	@if [ ! -d "${LOC}/docs/manualpages/concepts" ]; then \
355	  echo Making directory ${LOC}/docs/manualpages/concepts for library; ${MKDIR} ${LOC}/docs/manualpages/concepts; fi
356#
357#  makes .lines files for all source code
358#
359allgcov:
360	-@${RM} -rf /tmp/gcov
361	-@mkdir /tmp/gcov
362	-${OMAKE} ACTION=gcov PETSC_DIR=${PETSC_DIR} tree
363
364# usage make allrcslabel NEW_RCS_LABEL=v_2_0_28
365allrcslabel:
366	-@${OMAKE} PETSC_ARCH=${PETSC_ARCH} NEW_RCS_LABEL=${NEW_RCS_LABEL} ACTION=rcslabel  alltree
367#
368#   The commands below are for generating ADIC versions of the code;
369# they are not currently used.
370#
371alladicignore:
372	-@${RM} ${INSTALL_LIB_DIR}/adicignore
373	-@${OMAKE}  PETSC_ARCH=${PETSC_ARCH} ACTION=adicignore  tree
374
375alladic:
376	-@echo "Beginning to compile ADIC source code in all directories"
377	-@echo "Using ADIC compiler: ${ADIC_CC} ${CCPPFLAGS}"
378	-@echo "========================================="
379	-@cd include ; \
380           ${ADIC_CC} -s -f 1 ${CCPPFLAGS} petsc.h
381	-@${OMAKE}  PETSC_ARCH=${PETSC_ARCH} ACTION=adic  tree
382	-@cd src/inline ; \
383            ${OMAKE} PETSC_ARCH=${PETSC_ARCH} adic
384
385alladiclib:
386	-@echo "Beginning to compile ADIC libraries in all directories"
387	-@echo "Using compiler: ${CC} ${COPTFLAGS}"
388	-@echo "-----------------------------------------"
389	-@echo "Using PETSc flags: ${PETSCFLAGS} ${PCONF}"
390	-@echo "-----------------------------------------"
391	-@echo "Using configuration flags:"
392	-@grep "define " bmake/${INLUDE_ARCH}/petscconf.h
393	-@echo "-----------------------------------------"
394	-@echo "Using include paths: ${PETSC_INCLUDE}"
395	-@echo "-----------------------------------------"
396	-@echo "Using PETSc directory: ${PETSC_DIR}"
397	-@echo "Using PETSc arch: ${PETSC_ARCH}"
398	-@echo "========================================="
399	-@${RM} -f  ${INSTALL_LIB_DIR}/*adic.${AR_LIB_SUFFIX}
400	-@${OMAKE} PETSC_ARCH=${PETSC_ARCH} ACTION=adiclib  tree
401	-@cd src/adic/src ; \
402            ${OMAKE} PETSC_ARCH=${PETSC_ARCH} lib
403
404# -------------------------------------------------------------------------------
405#
406# Some macros to check if the fortran interface is up-to-date.
407#
408countfortranfunctions:
409	-@cd ${PETSC_DIR}/src/fortran; egrep '^void' custom/*.c auto/*.c | \
410	cut -d'(' -f1 | tr -s  ' ' | cut -d' ' -f2 | uniq | egrep -v "(^$$|Petsc)" | \
411	sed "s/_$$//" | sort > /tmp/countfortranfunctions
412
413countcfunctions:
414	-@ grep extern ${PETSC_DIR}/include/*.h *.h | grep "(" | tr -s ' ' | \
415	cut -d'(' -f1 | cut -d' ' -f3 | grep -v "\*" | tr -s '\012' |  \
416	tr 'A-Z' 'a-z' |  sort > /tmp/countcfunctions
417
418difffortranfunctions: countfortranfunctions countcfunctions
419	-@echo -------------- Functions missing in the fortran interface ---------------------
420	-@${DIFF} /tmp/countcfunctions /tmp/countfortranfunctions | grep "^<" | cut -d' ' -f2
421	-@echo ----------------- Functions missing in the C interface ------------------------
422	-@${DIFF} /tmp/countcfunctions /tmp/countfortranfunctions | grep "^>" | cut -d' ' -f2
423	-@${RM}  /tmp/countcfunctions /tmp/countfortranfunctions
424
425checkbadfortranstubs:
426	-@echo "========================================="
427	-@echo "Functions with MPI_Comm as an Argument"
428	-@echo "========================================="
429	-@cd ${PETSC_DIR}/src/fortran/auto; grep '^void' *.c | grep 'MPI_Comm' | \
430	tr -s ' ' | tr -s ':' ' ' |cut -d'(' -f1 | cut -d' ' -f1,3
431	-@echo "========================================="
432	-@echo "Functions with a String as an Argument"
433	-@echo "========================================="
434	-@cd ${PETSC_DIR}/src/fortran/auto; grep '^void' *.c | grep 'char \*' | \
435	tr -s ' ' | tr -s ':' ' ' |cut -d'(' -f1 | cut -d' ' -f1,3
436	-@echo "========================================="
437	-@echo "Functions with Pointers to PETSc Objects as Argument"
438	-@echo "========================================="
439	-@cd ${PETSC_DIR}/src/fortran/auto; \
440	_p_OBJ=`grep _p_ ${PETSC_DIR}/include/*.h | tr -s ' ' | \
441	cut -d' ' -f 3 | tr -s '\012' | grep -v '{' | cut -d'*' -f1 | \
442	sed "s/_p_//g" | tr -s '\012 ' ' *|' ` ; \
443	for OBJ in $$_p_OBJ; do \
444	grep "$$OBJ \*" *.c | tr -s ' ' | tr -s ':' ' ' | \
445	cut -d'(' -f1 | cut -d' ' -f1,3; \
446	done
447#
448# Automatically generates PETSc exercises in html from the tutorial examples.
449#
450# The introduction for each section is obtained from docs/manualpages/header_${MANSEC} is under RCS and may be edited
451#  (used also in introductions to the manual pages)
452# The overall introduction is in docs/exercises/introduction.html and is under RCS and may be edited
453# The list of exercises is from TUTORIALS in each directory's makefile
454#
455# DO NOT EDIT the pageform.txt or *.htm files generated since they will be automatically replaced.
456# The pagemaker rule is in the file bmake/common (at the bottom)
457#
458# Eventually the line below will replace the two cd in the rule below, it is just this way now for speed
459#	-@${OMAKE} PETSC_DIR=${PETSC_DIR} pagemaker
460#
461exercises:
462	-@echo "========================================="
463	-@echo "Generating HTML tutorial exercises"
464	-@${RM} docs/pageform.txt
465	-@echo "title=\"PETSc Exercises\""                >  docs/pageform.txt
466	-@echo "access_title=Exercise Sections"              >>  docs/pageform.txt
467	-@echo "access_format=short"                        >> docs/pageform.txt
468	-@echo "startpage=../exercises/introduction.htm"  >> docs/pageform.txt
469	-@echo "NONE title=\"Introduction\" command=link src=../exercises/introduction.htm" >> docs/pageform.txt
470	-@echo "Generating HTML for individual directories"
471	-@echo "========================================="
472	-@${OMAKE} PETSC_DIR=${PETSC_DIR} ACTION=pagemaker tree
473	-@echo "Completed HTML for individual directories"
474	-@echo "NONE title=\"<HR>\" " >> docs/pageform.txt;
475	-@echo "NONE title=\"PETSc Documentation\" command=link src=../index.html target=replace" >> docs/pageform.txt
476	/home/MPI/class/mpiexmpl/maint/makepage.new -pageform=docs/pageform.txt -access_extra=/dev/null -outdir=docs/exercises
477	-@echo "========================================="
478
479# Make a tarball of all the Python code
480#   This is currently used to release to the Teragrid
481petscPython.tgz:
482	@tar cvzf $@ --exclude SCCS --exclude BitKeeper --dereference python/
483	-@scp $@ tg-login2.uc.teragrid.org:./
484
485.PHONY: info info_h all all_build build testexamples testfortran testexamples_uni testfortran_uni ranlib deletelibs allclean update chk_petsc_dir \
486        alletags etags etags_complete etags_noexamples etags_makefiles etags_examples etags_fexamples alldoc allmanualpages \
487        allhtml allcleanhtml  allci allco allrcslabel alladicignore alladic alladiclib countfortranfunctions \
488        start_configure configure_petsc configure_clean python
489
490