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