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