xref: /petsc/makefile (revision c90053fb2fc89e2c41b2ceb6ded7c6d6353cc320)
1
2#
3# This is the makefile for compiling PETSc. See
4# http://www.mcs.anl.gov/petsc/petsc-as/documentation/installation.html for directions on installing PETSc.
5# See also conf for additional commands.
6#
7ALL: all
8LOCDIR	 = ./
9DIRS	 = src include tutorials
10CFLAGS	 =
11FFLAGS	 =
12
13include ${PETSC_DIR}/conf/base
14include ${PETSC_DIR}/conf/test
15
16#
17# Basic targets to build PETSc libraries.
18# all: builds the c, fortran, and f90 libraries
19all:
20	@${OMAKE}  PETSC_ARCH=${PETSC_ARCH}  chkpetsc_dir
21	-@${OMAKE} all_build 2>&1 | tee ${PETSC_ARCH}/conf/make.log
22	-@if [ -L make.log ]; then ${RM} make.log; fi; ln -s ${PETSC_ARCH}/conf/make.log make.log
23	-@egrep -i "( error | error:)" ${PETSC_ARCH}/conf/make.log > /dev/null; if [ "$$?" = "0" ]; then \
24           echo "********************************************************************"; \
25           echo "  Error during compile, check ${PETSC_ARCH}/conf/make.log"; \
26           echo "  Send it and ${PETSC_ARCH}/conf/configure.log to petsc-maint@mcs.anl.gov";\
27           echo "********************************************************************"; \
28           exit 1; fi
29
30all_build: chk_petsc_dir chklib_dir info info_h deletelibs  build shared_nomesg petsc4pyinstall
31#
32# Prints information about the system and version of PETSc being compiled
33#
34info:
35	-@echo "=========================================="
36	-@echo " "
37	-@echo "See documentation/faq.html and documentation/bugreporting.html"
38	-@echo "for help with installation problems. Please send EVERYTHING"
39	-@echo "printed out below when reporting problems"
40	-@echo " "
41	-@echo "To subscribe to the PETSc announcement list, send mail to "
42	-@echo "majordomo@mcs.anl.gov with the message: "
43	-@echo "subscribe petsc-announce"
44	-@echo " "
45	-@echo "To subscribe to the PETSc users mailing list, send mail to "
46	-@echo "majordomo@mcs.anl.gov with the message: "
47	-@echo "subscribe petsc-users"
48	-@echo " "
49	-@echo "=========================================="
50	-@echo On `date` on `hostname`
51	-@echo Machine characteristics: `uname -a`
52	-@echo "-----------------------------------------"
53	-@echo "Using PETSc directory: ${PETSC_DIR}"
54	-@echo "Using PETSc arch: ${PETSC_ARCH}"
55	-@echo "-----------------------------------------"
56	-@grep "define PETSC_VERSION" ${PETSC_DIR}/include/petscversion.h | ${SED} "s/........//"
57	-@echo "-----------------------------------------"
58	-@echo "Using configure Options: ${CONFIGURE_OPTIONS}"
59	-@echo "Using configuration flags:"
60	-@grep "\#define " ${PETSC_DIR}/${PETSC_ARCH}/include/petscconf.h
61	-@echo "-----------------------------------------"
62	-@echo "Using include paths: ${PETSC_INCLUDE}"
63	-@echo "------------------------------------------"
64	-@echo "Using C/C++ compiler: ${PCC} ${PCC_FLAGS} ${COPTFLAGS} ${CFLAGS}"
65	-@echo "C/C++ Compiler version: " `${CCV}`
66	-@if [ "${FC}" != "" ]; then \
67	   echo "Using Fortran compiler: ${FC} ${FC_FLAGS} ${FFLAGS} ${FPP_FLAGS}";\
68	   echo "Fortran Compiler version: " `${FCV}`;\
69         fi
70	-@echo "-----------------------------------------"
71	-@echo "Using C/C++ linker: ${PCC_LINKER}"
72	-@if [ "${FC}" != "" ]; then \
73	   echo "Using Fortran linker: ${FC_LINKER}";\
74         fi
75	-@echo "-----------------------------------------"
76	-@echo "Using libraries: ${PETSC_LIB}"
77	-@echo "------------------------------------------"
78	-@echo "Using mpiexec: ${MPIEXEC}"
79	-@echo "=========================================="
80#
81#
82MINFO = ${PETSC_DIR}/${PETSC_ARCH}/include/petscmachineinfo.h
83info_h:
84	-@$(RM) -f ${MINFO} MINFO
85	-@echo  "static const char *petscmachineinfo = \"\__n__\"" >> MINFO
86	-@echo  "\"-----------------------------------------\__n__\"" >> MINFO
87	-@if [ -f /usr/bin/cygcheck.exe ]; then \
88	  echo  "\"Libraries compiled on `date` on `hostname|/usr/bin/dos2unix` \__n__\"" >> MINFO; \
89          else \
90	  echo  "\"Libraries compiled on `date` on `hostname` \__n__\"" >> MINFO; \
91          fi
92	-@echo  "\"Machine characteristics: `uname -a` \__n__\"" >> MINFO
93	-@echo  "\"Using PETSc directory: ${PETSC_DIR}\__n__\"" >> MINFO
94	-@echo  "\"Using PETSc arch: ${PETSC_ARCH}\__n__\"" >> MINFO
95	-@echo  "\"-----------------------------------------\"; " >> MINFO
96	-@echo  "static const char *petsccompilerinfo = \"\__n__\"" >> MINFO
97	-@echo  "\"Using C compiler: ${PCC} ${PCC_FLAGS} ${COPTFLAGS} ${CFLAGS}\__n__\"" >> MINFO
98	-@echo  "\"Using Fortran compiler: ${FC} ${FC_FLAGS} ${FFLAGS} ${FPP_FLAGS}\__n__\"" >> MINFO
99	-@echo  "\"-----------------------------------------\"; " >> MINFO
100	-@echo  "static const char *petsccompilerflagsinfo = \"\__n__\"" >> MINFO
101	-@echo  "\"Using include paths: ${PETSC_INCLUDE}\__n__\"" >> MINFO
102	-@echo  "\"------------------------------------------\"; " >> MINFO
103	-@echo  "static const char *petsclinkerinfo = \"\__n__\"" >> MINFO
104	-@echo  "\"Using C linker: ${CLINKER}\__n__\"" >> MINFO
105	-@echo  "\"Using Fortran linker: ${FLINKER}\__n__\"" >> MINFO
106	-@echo  "\"Using libraries: ${PETSC_LIB} \__n__\"" >> MINFO
107	-@echo  "\"------------------------------------------\"; " >> MINFO
108	-@cat MINFO | ${SED} -e 's/\\ /\\\\ /g' | ${SED} -e 's/__n__/n/g' > ${MINFO}
109	-@ if [ -f /usr/bin/cygcheck.exe ]; then /usr/bin/dos2unix ${MINFO} 2> /dev/null; fi
110	-@$(RM) -f MINFO
111
112#
113# Builds the PETSc libraries
114# This target also builds fortran77 and f90 interface
115# files and compiles .F files
116#
117build:
118	-@echo "BEGINNING TO COMPILE LIBRARIES IN ALL DIRECTORIES"
119	-@echo "========================================="
120	-@${OMAKE}  PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=libfast tree
121	-@${RANLIB} ${PETSC_LIB_DIR}/*.${AR_LIB_SUFFIX}
122	-@echo "Completed building libraries"
123	-@echo "========================================="
124#
125#
126# Builds PETSc test examples for a given architecture
127#
128test:
129	@${OMAKE}  PETSC_ARCH=${PETSC_ARCH}  chkpetsc_dir
130	-@${OMAKE} test_build 2>&1 | tee ${PETSC_DIR}/${PETSC_ARCH}/conf/test.log
131test_build:
132	-@echo "Running test examples to verify correct installation"
133	@cd src/snes/examples/tutorials; ${OMAKE} PETSC_ARCH=${PETSC_ARCH}  PETSC_DIR=${PETSC_DIR} clean
134	@cd src/snes/examples/tutorials; ${OMAKE} PETSC_ARCH=${PETSC_ARCH}  PETSC_DIR=${PETSC_DIR} testex19
135	@if [ "${FC}" != "" ]; then cd src/snes/examples/tutorials; ${OMAKE} PETSC_ARCH=${PETSC_ARCH}  PETSC_DIR=${PETSC_DIR} testex5f; fi;
136	@cd src/snes/examples/tutorials; ${OMAKE} PETSC_ARCH=${PETSC_ARCH}  PETSC_DIR=${PETSC_DIR} clean
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}/libpetsc*.*
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	-@./config/install.py --rootDir=${PETSC_DIR} --installDir=${INSTALL_DIR} --arch=${PETSC_ARCH} --ranlib=${RANLIB} --make=${OMAKE} --libSuffix=${AR_LIB_SUFFIX}
209
210# ------------------------------------------------------------------
211#
212# All remaining actions are intended for PETSc developers only.
213# PETSc users should not generally need to use these commands.
214#
215
216# To access the tags in EMACS, type M-x visit-tags-table and specify
217# the file petsc/TAGS.
218# 1) To move to where a PETSc function is defined, enter M-. and the
219#     function name.
220# 2) To search for a string and move to the first occurrence,
221#     use M-x tags-search and the string.
222#     To locate later occurrences, use M-,
223# Builds all etags files
224alletags:
225	-@bin/maint/generateetags.py
226	-@find config -type f -name "*.py" |grep -v SCCS | xargs etags -o TAGS_PYTHON
227
228allfortranstubs:
229	-@bin/maint/generatefortranstubs.py ${BFORT}
230deletefortranstubs:
231	-@find . -type d -name ftn-auto | xargs rm -rf
232#
233# These are here for the target allci and allco, and etags
234#
235
236BMAKEFILES = conf/base conf/test bmake/adic.init bmake/adicmf.init
237SCRIPTS    = bin/maint/builddist  bin/maint/wwwman bin/maint/xclude bin/maint/bugReport.py bin/maint/buildconfigtest bin/maint/builddistlite \
238             bin/maint/buildtest bin/maint/checkBuilds.py bin/maint/copylognightly bin/maint/copylognightly.tao bin/maint/countfiles bin/maint/findbadfiles \
239             bin/maint/fixinclude bin/maint/getexlist bin/maint/getpdflabels.py bin/maint/helpindex.py bin/maint/hosts.local bin/maint/hosts.solaris  \
240             bin/maint/lex.py  bin/maint/mapnameslatex.py bin/maint/startnightly bin/maint/startnightly.tao bin/maint/submitPatch.py \
241             bin/maint/update-docs.py  bin/maint/wwwindex.py bin/maint/xcludebackup bin/maint/xcludecblas bin/maint/zap bin/maint/zapall \
242             config/PETSc/Configure.py config/PETSc/Options.py \
243             config/PETSc/packages/*.py config/PETSc/utilities/*.py
244
245
246# Builds all the documentation - should be done every night
247alldoc: alldoc1 alldoc2
248
249# Build everything that goes into 'doc' dir except html sources
250alldoc1: chk_loc deletemanualpages chk_concepts_dir
251	-${OMAKE} ACTION=manualpages_buildcite tree_basic LOC=${LOC}
252	-@sed -e s%man+../%man+manualpages/% ${LOC}/docs/manualpages/manualpages.cit > ${LOC}/docs/manualpages/htmlmap
253	-@cat ${PETSC_DIR}/src/docs/mpi.www.index >> ${LOC}/docs/manualpages/htmlmap
254	-cd src/docs/tex/manual; ${OMAKE} manual.pdf LOC=${LOC}
255	-${OMAKE} ACTION=manualpages tree_basic LOC=${LOC}
256	-bin/maint/wwwindex.py ${PETSC_DIR} ${LOC}
257	-${OMAKE} ACTION=manexamples tree_basic LOC=${LOC}
258	-${OMAKE} manconcepts LOC=${LOC}
259	-${OMAKE} ACTION=getexlist tree_basic LOC=${LOC}
260	-${OMAKE} ACTION=exampleconcepts tree_basic LOC=${LOC}
261	-bin/maint/helpindex.py ${PETSC_DIR} ${LOC}
262	-grep -h Polymorphic include/*.h | grep -v '#define ' | sed "s?PetscPolymorphic[a-zA-Z]*(??g" | cut -f1 -d"{" > tmppoly
263	-bin/maint/processpoly.py ${PETSC_DIR} ${LOC}
264	-${RM} tmppoly
265
266# Builds .html versions of the source
267# html overwrites some stuff created by update-docs - hence this is done later.
268alldoc2: chk_loc
269	-${OMAKE} ACTION=html PETSC_DIR=${PETSC_DIR} alltree LOC=${LOC}
270	-bin/maint/update-docs.py ${PETSC_DIR} ${LOC}
271
272alldocclean: deletemanualpages allcleanhtml
273
274# Deletes man pages (HTML version)
275deletemanualpages: chk_loc
276	-@if [ -d ${LOC} -a -d ${LOC}/docs/manualpages ]; then \
277          find ${LOC}/docs/manualpages -type f -name "*.html" -exec ${RM} {} \; ;\
278          ${RM} ${LOC}/docs/exampleconcepts ;\
279          ${RM} ${LOC}/docs/manconcepts ;\
280          ${RM} ${LOC}/docs/manualpages/manualpages.cit ;\
281          bin/maint/update-docs.py ${PETSC_DIR} ${LOC} clean;\
282        fi
283
284allcleanhtml:
285	-${RM} include/adic/*.h.html
286	-${OMAKE} ACTION=cleanhtml PETSC_DIR=${PETSC_DIR} alltree
287
288chk_concepts_dir: chk_loc
289	@if [ ! -d "${LOC}/docs/manualpages/concepts" ]; then \
290	  echo Making directory ${LOC}/docs/manualpages/concepts for library; ${MKDIR} ${LOC}/docs/manualpages/concepts; fi
291
292###########################################################
293# targets to build distribution and update docs
294###########################################################
295
296# Creates ${HOME}/petsc.tar.gz [and petsc-lite.tar.gz]
297dist:
298	${PETSC_DIR}/bin/maint/builddist ${PETSC_DIR}
299
300# This target works only if you can do 'ssh petsc@harley.mcs.anl.gov'
301# also copy the file over to ftp site.
302web-snapshot:
303	@if [ ! -f "${HOME}/petsc-dev.tar.gz" ]; then \
304	    echo "~/petsc-dev.tar.gz missing! cannot update petsc-dev snapshot on mcs-web-site"; \
305	  else \
306            echo "updating petsc-dev snapshot on mcs-web-site"; \
307	    tmpdir=`mktemp -d -t petsc-doc.XXXXXXXX`; \
308	    cd $${tmpdir}; tar -xzf ${HOME}/petsc-dev.tar.gz; \
309	    /usr/bin/rsync  -e ssh -az --delete $${tmpdir}/petsc-dev/ \
310              petsc@harley.mcs.anl.gov:/mcs/web/research/projects/petsc/petsc-as/snapshots/petsc-dev ;\
311	    /bin/cp -f /home/petsc/petsc-dev.tar.gz /nfs/ftp/pub/petsc/petsc-dev.tar.gz;\
312	    ${RM} -rf $${tmpdir} ;\
313	  fi
314
315# build the tarfile - and then update petsc-dev snapshot on mcs-web-site
316update-web-snapshot: dist web-snapshot
317
318# This target updates website main pages
319update-web:
320	@cd ${PETSC_DIR}/src/docs; make PETSC_DIR=${PETSC_DIR} PETSC_ARCH=${PETSC_ARCH} bib2html; \
321	/usr/bin/rsync -az -C --exclude=BitKeeper --exclude=documentation/installation.html \
322	  ${PETSC_DIR}/src/docs/website/ petsc@harley.mcs.anl.gov:/mcs/web/research/projects/petsc/petsc-as
323	@cd ${PETSC_DIR}/src/docs/tex/manual; make developers.pdf PETSC_DIR=${PETSC_DIR} PETSC_ARCH=${PETSC_ARCH} LOC=${PETSC_DIR}; \
324	/usr/bin/rsync -az developers.pdf petsc@harley.mcs.anl.gov:/mcs/web/research/projects/petsc/petsc-as/developers/
325
326#
327#  builds a single list of files for each PETSc library so they may all be built in parallel
328#  without a recursive set of make calls
329createfastbuild:
330	cd src/vec; ${RM} -f files; /bin/echo -n "SOURCEC = " > files; make tree ACTION=sourcelist BASE_DIR=${PETSC_DIR}/src/vec;  /bin/echo -n "OBJSC    = $${SOURCEC:.c=.o} " >> files
331
332###########################################################
333
334#
335#  makes .lines files for all source code
336#
337allgcov:
338	-@${RM} -rf /tmp/gcov
339	-@mkdir /tmp/gcov
340	-${OMAKE} ACTION=gcov PETSC_DIR=${PETSC_DIR} tree
341
342# usage make allrcslabel NEW_RCS_LABEL=v_2_0_28
343allrcslabel:
344	-@${OMAKE} PETSC_ARCH=${PETSC_ARCH} NEW_RCS_LABEL=${NEW_RCS_LABEL} ACTION=rcslabel  alltree
345#
346#   The commands below are for generating ADIC versions of the code;
347# they are not currently used.
348#
349alladicignore:
350	-@${RM} ${INSTALL_LIB_DIR}/adicignore
351	-@${OMAKE}  PETSC_ARCH=${PETSC_ARCH} ACTION=adicignore  tree
352
353alladic:
354	-@echo "Beginning to compile ADIC source code in all directories"
355	-@echo "Using ADIC compiler: ${ADIC_CC} ${CCPPFLAGS}"
356	-@echo "========================================="
357	-@cd include ; \
358           ${ADIC_CC} -s -f 1 ${CCPPFLAGS} petsc.h
359	-@${OMAKE}  PETSC_ARCH=${PETSC_ARCH} ACTION=adic  tree
360	-@cd src/inline ; \
361            ${OMAKE} PETSC_ARCH=${PETSC_ARCH} adic
362
363alladiclib:
364	-@echo "Beginning to compile ADIC libraries in all directories"
365	-@echo "Using compiler: ${PCC} ${COPTFLAGS}"
366	-@echo "-----------------------------------------"
367	-@echo "Using PETSc flags: ${PETSCFLAGS} ${PCONF}"
368	-@echo "-----------------------------------------"
369	-@echo "Using configuration flags:"
370	-@grep "define " ${PETSC_ARCH}/include/petscconf.h
371	-@echo "-----------------------------------------"
372	-@echo "Using include paths: ${PETSC_INCLUDE}"
373	-@echo "-----------------------------------------"
374	-@echo "Using PETSc directory: ${PETSC_DIR}"
375	-@echo "Using PETSc arch: ${PETSC_ARCH}"
376	-@echo "========================================="
377	-@${RM} -f  ${INSTALL_LIB_DIR}/*adic.${AR_LIB_SUFFIX}
378	-@${OMAKE} PETSC_ARCH=${PETSC_ARCH} ACTION=adiclib  tree
379	-@cd src/adic/src ; \
380            ${OMAKE} PETSC_ARCH=${PETSC_ARCH} lib
381
382# -------------------------------------------------------------------------------
383#
384# Some macros to check if the fortran interface is up-to-date.
385#
386countfortranfunctions:
387	-@cd ${PETSC_DIR}/src/fortran; egrep '^void' custom/*.c auto/*.c | \
388	cut -d'(' -f1 | tr -s  ' ' | cut -d' ' -f2 | uniq | egrep -v "(^$$|Petsc)" | \
389	sed "s/_$$//" | sort > /tmp/countfortranfunctions
390
391countcfunctions:
392	-@grep extern ${PETSC_DIR}/include/*.h  | grep "(" | tr -s ' ' | \
393	cut -d'(' -f1 | cut -d' ' -f3 | grep -v "\*" | tr -s '\012' |  \
394	tr 'A-Z' 'a-z' |  sort > /tmp/countcfunctions
395
396difffortranfunctions: countfortranfunctions countcfunctions
397	-@echo -------------- Functions missing in the fortran interface ---------------------
398	-@${DIFF} /tmp/countcfunctions /tmp/countfortranfunctions | grep "^<" | cut -d' ' -f2
399	-@echo ----------------- Functions missing in the C interface ------------------------
400	-@${DIFF} /tmp/countcfunctions /tmp/countfortranfunctions | grep "^>" | cut -d' ' -f2
401	-@${RM}  /tmp/countcfunctions /tmp/countfortranfunctions
402
403checkbadfortranstubs:
404	-@echo "========================================="
405	-@echo "Functions with MPI_Comm as an Argument"
406	-@echo "========================================="
407	-@cd ${PETSC_DIR}/src/fortran/auto; grep '^void' *.c | grep 'MPI_Comm' | \
408	tr -s ' ' | tr -s ':' ' ' |cut -d'(' -f1 | cut -d' ' -f1,3
409	-@echo "========================================="
410	-@echo "Functions with a String as an Argument"
411	-@echo "========================================="
412	-@cd ${PETSC_DIR}/src/fortran/auto; grep '^void' *.c | grep 'char \*' | \
413	tr -s ' ' | tr -s ':' ' ' |cut -d'(' -f1 | cut -d' ' -f1,3
414	-@echo "========================================="
415	-@echo "Functions with Pointers to PETSc Objects as Argument"
416	-@echo "========================================="
417	-@cd ${PETSC_DIR}/src/fortran/auto; \
418	_p_OBJ=`grep _p_ ${PETSC_DIR}/include/*.h | tr -s ' ' | \
419	cut -d' ' -f 3 | tr -s '\012' | grep -v '{' | cut -d'*' -f1 | \
420	sed "s/_p_//g" | tr -s '\012 ' ' *|' ` ; \
421	for OBJ in $$_p_OBJ; do \
422	grep "$$OBJ \*" *.c | tr -s ' ' | tr -s ':' ' ' | \
423	cut -d'(' -f1 | cut -d' ' -f1,3; \
424	done
425#
426# Automatically generates PETSc exercises in html from the tutorial examples.
427#
428# The introduction for each section is obtained from docs/manualpages/header_${MANSEC} is under RCS and may be edited
429#  (used also in introductions to the manual pages)
430# The overall introduction is in docs/exercises/introduction.html and is under RCS and may be edited
431# The list of exercises is from TUTORIALS in each directory's makefile
432#
433# DO NOT EDIT the pageform.txt or *.htm files generated since they will be automatically replaced.
434# The pagemaker rule is in the file conf (at the bottom)
435#
436# Eventually the line below will replace the two cd in the rule below, it is just this way now for speed
437#	-@${OMAKE} PETSC_DIR=${PETSC_DIR} pagemaker
438#
439exercises:
440	-@echo "========================================="
441	-@echo "Generating HTML tutorial exercises"
442	-@${RM} docs/pageform.txt
443	-@echo "title=\"PETSc Exercises\""                >  docs/pageform.txt
444	-@echo "access_title=Exercise Sections"              >>  docs/pageform.txt
445	-@echo "access_format=short"                        >> docs/pageform.txt
446	-@echo "startpage=../exercises/introduction.htm"  >> docs/pageform.txt
447	-@echo "NONE title=\"Introduction\" command=link src=../exercises/introduction.htm" >> docs/pageform.txt
448	-@echo "Generating HTML for individual directories"
449	-@echo "========================================="
450	-@${OMAKE} PETSC_DIR=${PETSC_DIR} ACTION=pagemaker tree
451	-@echo "Completed HTML for individual directories"
452	-@echo "NONE title=\"<HR>\" " >> docs/pageform.txt;
453	-@echo "NONE title=\"PETSc Documentation\" command=link src=../index.html target=replace" >> docs/pageform.txt
454	/home/MPI/class/mpiexmpl/maint/makepage.new -pageform=docs/pageform.txt -access_extra=/dev/null -outdir=docs/exercises
455	-@echo "========================================="
456
457.PHONY: info info_h all all_build build testexamples testfortran testexamples_uni testfortran_uni ranlib deletelibs allclean update chk_petsc_dir \
458        alletags etags etags_complete etags_noexamples etags_makefiles etags_examples etags_fexamples alldoc allmanualpages \
459        allhtml allcleanhtml  allci allco allrcslabel alladicignore alladic alladiclib countfortranfunctions \
460        start_configure configure_petsc configure_clean
461
462getsigs:
463	-@if [ ! -d src/sigs ]; then mkdir -p sigs; fi
464	-@echo ${PETSC_INCLUDE} > sigs/petsc_include
465	-@echo "#include \"petscvec.h\"" > sigs/vec.sigs.h
466	-@grep -h "enum " include/petscsys.h include/petscvec.h >> sigs/vec.sigs.h
467	-@grep " Vec[a-zA-Z][a-zA-Z]*(Vec," include/petscvec.h | grep EXTERN | grep -v "(\*)" | grep -v IS |grep -v VecType | sed "s/EXTERN PetscErrorCode PETSCVEC_DLLEXPORT//g" >> sigs/vec.sigs.h
468	-@echo "#include \"petscmat.h\"" > sigs/mat.sigs.h
469	-@grep "enum " include/petscmat.h | grep } >> sigs/mat.sigs.h
470	-@grep " Mat[a-zA-Z][a-zA-Z]*(Mat," include/petscmat.h | grep EXTERN | grep -v "(\*)" | grep -v IS |grep -v MatType | sed "s/EXTERN PetscErrorCode PETSCMAT_DLLEXPORT//g" >> sigs/mat.sigs.h
471	-@echo "#include \"petscpc.h\"" > sigs/pc.sigs.h
472	-@grep "enum " include/petscpc.h | grep } >> sigs/pc.sigs.h
473	-@grep " PC[a-zA-Z][a-zA-Z]*(PC," include/petscpc.h | grep EXTERN | grep -v "(\*)" | grep -v "(\*\*)" | grep -v IS |grep -v PCType | sed "s/EXTERN PetscErrorCode PETSCKSP_DLLEXPORT//g" >> sigs/pc.sigs.h
474	-@echo "#include \"petscksp.h\"" > sigs/ksp.sigs.h
475	-@grep "enum " include/petscksp.h | grep } >> sigs/ksp.sigs.h
476	-@grep " KSP[a-zA-Z][a-zA-Z]*(KSP," include/petscksp.h | grep EXTERN | grep -v "(\*)" | grep -v "(\*\*)" | grep -v IS |grep -v KSPType | sed "s/EXTERN PetscErrorCode PETSCKSP_DLLEXPORT//g" >> sigs/ksp.sigs.h
477	-@echo "#include \"petscsnes.h\"" > sigs/snes.sigs.h
478	-@grep " SNES[a-zA-Z][a-zA-Z]*(SNES," include/petscsnes.h | grep EXTERN | grep -v "(\*)" | grep -v "(\*\*)" | grep -v IS |grep -v SNESType | sed "s/EXTERN PetscErrorCode PETSCSNES_DLLEXPORT//g" >> sigs/snes.sigs.h
479
480
481
482
483
484
485
486
487
488
489
490petscao : petscmat petscao.f90.h
491petscda : petscksp petscda.f90.h
492petscdraw : petsc petscdraw.f90.h
493petscis : petsc petscis.f90.h
494petscksp : petscpc  petscksp.f90.h
495petsclog : petsc petsclog.f90.h
496petscmat : petscvec petscmat.f90.h
497petscmg : petscksp petscmg.f90.h
498petscpc : petscmat petscpc.f90.h
499petscsnes : petscksp petscsnes.f90.h
500petscsys : petsc petscsys.f90.h
501petscts : petscsnes petscts.f90.h
502petsc : petsc.f90.h
503petscvec : petscis petscvec.f90.h
504petscviewer : petsc petscviewer.f90.h
505modules : petscao petscda petscdraw petscis petscksp petsclog petscmat petscmg petscpc petscsnes petscsys petscts petsc petscvec petscviewer
506