xref: /petsc/makefile (revision 47d17dc926dfb68fad7e54e72508abb736d39bcd)
173f4d377SMatthew Knepley# $Id: makefile,v 1.353 2001/08/28 19:43:38 balay Exp $
211b6ed10SLois Curfman McInnes#
3cfd69a58SBarry Smith# This is the makefile for installing PETSc. See the file
47fc3c18eSBarry Smith# docs/installation.html for directions on installing PETSc.
5cfd69a58SBarry Smith# See also bmake/common for additional commands.
611b6ed10SLois Curfman McInnes#
7716b9c40SSatish BalayALL: all
848b2c0e9SBarry SmithLOCDIR = .
9b16a3bb1SBarry SmithDIRS   = src include docs
10ca5c9d59SMatthew Knepley#
11ca5c9d59SMatthew Knepley# Configuration Variables
12ca5c9d59SMatthew Knepley#
13ca5c9d59SMatthew Knepley# Read configure options from a file if CONFIGURE_OPTIONSis not defined
141fe47f9fSMatthew KnepleyAUTOMAKE               = ${PETSC_DIR}/bin/automake
1544ecba3fSMatthew KnepleyCONFIGURE_ARCH_PROG    = ${PETSC_DIR}/config/configarch
1644ecba3fSMatthew KnepleyCONFIGURE_ARCH         = $(shell ${CONFIGURE_ARCH_PROG})
1714fc0c24SMatthew KnepleyCONFIGURE_OPTIONS_FILE = ./config/configure_options.${PETSC_ARCH}
185898bf02SMatthew KnepleyCONFIGURE_OPTIONS      = $(shell echo $(shell cat ${CONFIGURE_OPTIONS_FILE} | sed -e 's/\#.*$$//' -e "s/'/\\\\'/g"))
19ca5c9d59SMatthew KnepleyCONFIGURE_LOG_FILE     = configure_petsc.log
20ca5c9d59SMatthew KnepleyAUTOMAKE_ADD_FILES     = config/config.guess config/config.sub config/install-sh config/missing config/mkinstalldirs \
21ba1077baSMatthew Knepley                         config/ltmain.sh
22bc87b169SSatish BalayBMAKE_TEMPLATE_FILES   = bmake/config/packages.in bmake/config/rules.in bmake/config/variables.in
2361523587SBarry Smith
24516d1546SSatish Balayinclude ${PETSC_DIR}/bmake/common/base
25516d1546SSatish Balayinclude ${PETSC_DIR}/bmake/common/test
2661523587SBarry Smith
27ca5c9d59SMatthew Knepley#
28ca5c9d59SMatthew Knepley# Configuration Targets
29ca5c9d59SMatthew Knepley#
30ca5c9d59SMatthew Knepleyaclocal.m4: configure.in
31ca5c9d59SMatthew Knepley	@echo "Making $@" >> $(CONFIGURE_LOG_FILE)
32ca5c9d59SMatthew Knepley	@echo "----------------------------------------" >> $(CONFIGURE_LOG_FILE)
33ca5c9d59SMatthew Knepley	@aclocal >> $(CONFIGURE_LOG_FILE)
34c83b6f97SSatish Balay
35ca5c9d59SMatthew Knepleybmake/config/petscconf.h.in: config/acconfig.h config/acsite.m4 configure.in
36ca5c9d59SMatthew Knepley	@echo "Making $@" >> $(CONFIGURE_LOG_FILE)
37ca5c9d59SMatthew Knepley	@echo "----------------------------------------" >> $(CONFIGURE_LOG_FILE)
381946b435SMatthew Knepley	@if test -f $@; then ${RM} $@ >> $(CONFIGURE_LOG_FILE); fi
39ca5c9d59SMatthew Knepley	@autoheader -l config >> $(CONFIGURE_LOG_FILE)
40c83b6f97SSatish Balay
41ca5c9d59SMatthew Knepley$(AUTOMAKE_ADD_FILES):
42ca5c9d59SMatthew Knepley	@echo "Making $@" >> $(CONFIGURE_LOG_FILE)
43ca5c9d59SMatthew Knepley	@echo "----------------------------------------" >> $(CONFIGURE_LOG_FILE)
441fe47f9fSMatthew Knepley	@${AUTOMAKE} --foreign --add-missing --copy Makefile >> $(CONFIGURE_LOG_FILE)
45ca5c9d59SMatthew Knepley
46ca5c9d59SMatthew KnepleyMakefile.am: $(AUTOMAKE_ADD_FILES)
47ca5c9d59SMatthew Knepley
48ca5c9d59SMatthew KnepleyMakefile.in: Makefile.am
49ca5c9d59SMatthew Knepley	@echo "Making $@" >> $(CONFIGURE_LOG_FILE)
50ca5c9d59SMatthew Knepley	@echo "----------------------------------------" >> $(CONFIGURE_LOG_FILE)
51f94e2999SMatthew Knepley	@${AUTOMAKE} --foreign --add-missing --copy Makefile >> $(CONFIGURE_LOG_FILE)
52ca5c9d59SMatthew Knepley
53ca5c9d59SMatthew Knepleyconfigure: configure.in config/acsite.m4 aclocal.m4 bmake/config/petscconf.h.in $(AUTOMAKE_ADD_FILES)
54ca5c9d59SMatthew Knepley	@echo "Making $@" >> $(CONFIGURE_LOG_FILE)
55ca5c9d59SMatthew Knepley	@echo "----------------------------------------" >> $(CONFIGURE_LOG_FILE)
56ca5c9d59SMatthew Knepley	@autoconf -l config >> $(CONFIGURE_LOG_FILE)
57bd0372f7SMatthew Knepley	@cat configure | sed -e 's/\[A-Za-z_\]\[A-Za-z0-9_\]/\[A-Za-z_\]\[A-Za-z0-9_(),\]/' -e 's/\[a-zA-Z_\]\[a-zA-Z_0-9\]/\[a-zA-Z_\]\[a-zA-Z_0-9(),\]/' > configure.alter
58bd0372f7SMatthew Knepley	@mv configure.alter configure
59bd0372f7SMatthew Knepley	@chmod 755 configure
60ca5c9d59SMatthew Knepley
61ca5c9d59SMatthew Knepleystart_configure:
62ca5c9d59SMatthew Knepley	-@$(RM) $(CONFIGURE_LOG_FILE)
63ca5c9d59SMatthew Knepley
64ca5c9d59SMatthew Knepleyconfigure_petsc: start_configure configure Makefile.in
65ca5c9d59SMatthew Knepley	@echo "Configuring Petsc with options:" >> $(CONFIGURE_LOG_FILE)
66ca5c9d59SMatthew Knepley	@echo "$(CONFIGURE_OPTIONS)" >> $(CONFIGURE_LOG_FILE)
67ca5c9d59SMatthew Knepley	@echo "----------------------------------------" >> $(CONFIGURE_LOG_FILE)
68ca5c9d59SMatthew Knepley	@./configure $(CONFIGURE_OPTIONS) >> $(CONFIGURE_LOG_FILE)
69ca5c9d59SMatthew Knepley
703302b940SMatthew Knepley$(CONFIGURE_OPTIONS_FILE):
718d86d5feSSatish Balay	@touch $(CONFIGURE_OPTIONS_FILE)
723302b940SMatthew Knepley
7319552e71SMatthew Knepley# We allow substring matching so that new configure architectures can be created
74ba1077baSMatthew Knepley$(CONFIGURE_LOG_FILE): $(CONFIGURE_OPTIONS_FILE) $(BMAKE_TEMPLATE_FILES)
75b7acdfbfSMatthew Knepley	@carch=`${CONFIGURE_ARCH_PROG}`; \
76b7acdfbfSMatthew Knepley	if test `echo ${PETSC_ARCH} | sed -e 's/^\($$carch\).*/\1/'` = "$$carch"; then \
77b7acdfbfSMatthew Knepley	    ${MAKE} configure_petsc; \
78ba1077baSMatthew Knepley	else \
79b7acdfbfSMatthew Knepley	    echo "Petsc is preconfigured for architecture ${PETSC_ARCH}" > ${CONFIGURE_LOG_FILE}; \
80ba1077baSMatthew Knepley	fi
81ca5c9d59SMatthew Knepley
82ca5c9d59SMatthew Knepleyconfigure_clean:
83ca5c9d59SMatthew Knepley	-@$(RM) aclocal.m4
84ca5c9d59SMatthew Knepley	-@$(RM) bmake/config/petscconf.h.in
85ca5c9d59SMatthew Knepley	-@$(RM) $(AUTOMAKE_ADD_FILES) Makefile.in
86ca5c9d59SMatthew Knepley	-@$(RM) configure
873677444aSSatish Balay#
883677444aSSatish Balay# Basic targets to build PETSc libraries.
89fa527775SLois Curfman McInnes# all: builds the c, fortran, and f90 libraries
90ba1077baSMatthew Knepleyall: $(CONFIGURE_LOG_FILE)
9144ecba3fSMatthew Knepley	-@${MAKE} all_build 2>&1 | tee make_log_${PETSC_ARCH}_${BOPT}
92ba1077baSMatthew Knepley# This is necessary if configure jsut created files to have them reread
93*47d17dc9SKris Buschelmanall_build: chk_petsc_dir info info_h chklib_dir deletelibs build shared
94efd74e9bSBarry Smith#
95fa527775SLois Curfman McInnes# Prints information about the system and version of PETSc being compiled
96efd74e9bSBarry Smith#
97efd74e9bSBarry Smithinfo:
98efd74e9bSBarry Smith	-@echo "=========================================="
9911b6dc0cSBarry Smith	-@echo " "
100d76296fbSBarry Smith	-@echo "See docs/troubleshooting.html and docs/bugreporting.html"
101d76296fbSBarry Smith	-@echo "for help with installation problems. Please send EVERYTHING"
102d76296fbSBarry Smith	-@echo "printed out below when reporting problems"
10311b6dc0cSBarry Smith	-@echo " "
10411b6dc0cSBarry Smith	-@echo "To subscribe to the PETSc users mailing list, send mail to "
10511b6dc0cSBarry Smith	-@echo "majordomo@mcs.anl.gov with the message: "
1068b6f49e5SSatish Balay	-@echo "subscribe petsc-announce"
10711b6dc0cSBarry Smith	-@echo " "
108d76296fbSBarry Smith	-@echo "=========================================="
1091d91fb6eSBarry Smith	-@echo On `date` on `hostname`
11030fdcc7aSBarry Smith	-@echo Machine characteristics: `uname -a`
111efd74e9bSBarry Smith	-@echo "-----------------------------------------"
1120387d3c6SKris Buschelman	-@echo "Using C compiler: ${C_CC} ${COPTFLAGS} ${CCPPFLAGS}"
113c20d8eedSBarry Smith	-@if [ -n "${C_CCV}" -a "${C_CCV}" != "unknown" ]; then \
114ba1077baSMatthew Knepley        echo "C Compiler version: " `${C_CCV}`; fi
1150387d3c6SKris Buschelman	-@echo "Using C++ compiler: ${CXX_CC} ${COPTFLAGS} ${CCPPFLAGS}"
116c20d8eedSBarry Smith	-@if [ -n "${CXX_CCV}" -a "${CXX_CCV}" != "unknown" ]; then \
117ba1077baSMatthew Knepley        echo "C++ Compiler version: " `${CXX_CCV}`; fi
1180387d3c6SKris Buschelman	-@echo "Using Fortran compiler: ${C_FC} ${FOPTFLAGS} ${FCPPFLAGS}"
11988b81347SBarry Smith	-@if [ -n "${C_FCV}" -a "${C_FCV}" != "unknown" ]; then \
120ba1077baSMatthew Knepley	  echo "Fortran Compiler version: " `${C_FCV}`; fi
12147794344SBarry Smith	-@echo "-----------------------------------------"
122bdd8b494SSatish Balay	-@grep "define PETSC_VERSION" ${PETSC_DIR}/include/petscversion.h | ${SED} "s/........//"
123f265ae5cSBarry Smith	-@echo "-----------------------------------------"
124d77bb2e1SSatish Balay	-@echo "Using PETSc flags: ${PETSCFLAGS} ${PCONF}"
12547794344SBarry Smith	-@echo "-----------------------------------------"
126e0e703c1SSatish Balay	-@echo "Using configuration flags:"
12719552e71SMatthew Knepley	-@grep "\#define " ${PETSC_DIR}/bmake/${PETSC_ARCH}/petscconf.h
12847794344SBarry Smith	-@echo "-----------------------------------------"
129d77bb2e1SSatish Balay	-@echo "Using include paths: ${PETSC_INCLUDE}"
13047794344SBarry Smith	-@echo "-----------------------------------------"
131d77bb2e1SSatish Balay	-@echo "Using PETSc directory: ${PETSC_DIR}"
13219552e71SMatthew Knepley	-@echo "Using PETSc arch: ${PETSC_ARCH}"
133efd74e9bSBarry Smith	-@echo "------------------------------------------"
134d77bb2e1SSatish Balay	-@echo "Using C linker: ${CLINKER}"
135d77bb2e1SSatish Balay	-@echo "Using Fortran linker: ${FLINKER}"
136f2b01315SBarry Smith	-@echo "Using libraries: ${PETSC_LIB}"
137e3353558SSatish Balay	-@echo "------------------------------------------"
138e3353558SSatish Balay	-@echo "Using mpirun: ${MPIRUN}"
139efd74e9bSBarry Smith	-@echo "=========================================="
140b8d81f61SBarry Smith#
141b8d81f61SBarry Smith#
14219552e71SMatthew KnepleyMINFO = ${PETSC_DIR}/bmake/${PETSC_ARCH}/petscmachineinfo.h
143b8d81f61SBarry Smithinfo_h:
144ddbfe947SBarry Smith	-@$(RM) -f MINFO ${MINFO}
145c5e9c7dfSBarry Smith	-@echo  "static char *petscmachineinfo = \"  " >> MINFO
14634a92de5SBarry Smith	-@echo  "Libraries compiled on `date` on `hostname` " >> MINFO
147c5e9c7dfSBarry Smith	-@echo  Machine characteristics: `uname -a` "" >> MINFO
148f6a9982fSBarry Smith	-@echo  "Using PETSc directory: ${PETSC_DIR}" >> MINFO
14919552e71SMatthew Knepley	-@echo  "Using PETSc arch: ${PETSC_ARCH}" >> MINFO
15093520af8SSatish Balay	-@echo  "-----------------------------------------\"; " >> MINFO
15193520af8SSatish Balay	-@echo  "static char *petsccompilerinfo = \"  " >> MINFO
1525323642bSKris Buschelman	-@echo  "Using C compiler: ${C_CC} ${COPTFLAGS} ${CCPPFLAGS} " >> MINFO
153b8d81f61SBarry Smith	-@if [  "${C_CCV}" -a "${C_CCV}" != "unknown" ] ; then \
154ec289e47SSatish Balay	  echo  "C Compiler version:"  >> MINFO ; ${C_CCV} >> MINFO 2>&1; fi ; true
155b8d81f61SBarry Smith	-@if [  "${CXX_CCV}" -a "${CXX_CCV}" != "unknown" ] ; then \
156ec289e47SSatish Balay	  echo  "C++ Compiler version:"  >> MINFO; ${CXX_CCV} >> MINFO 2>&1 ; fi ; true
1575323642bSKris Buschelman	-@echo  "Using Fortran compiler: ${C_FC} ${FOPTFLAGS} ${FCPPFLAGS}" >> MINFO
158b8d81f61SBarry Smith	-@if [  "${C_FCV}" -a "${C_FCV}" != "unknown" ] ; then \
159ec289e47SSatish Balay	  echo  "Fortran Compiler version:" >> MINFO ; ${C_FCV} >> MINFO 2>&1 ; fi ; true
16093520af8SSatish Balay	-@echo  "-----------------------------------------\"; " >> MINFO
16193520af8SSatish Balay	-@echo  "static char *petsccompilerflagsinfo = \"  " >> MINFO
162c5e9c7dfSBarry Smith	-@echo  "Using PETSc flags: ${PETSCFLAGS} ${PCONF}" >> MINFO
163c5e9c7dfSBarry Smith	-@echo  "-----------------------------------------" >> MINFO
164c5e9c7dfSBarry Smith	-@echo  "Using configuration flags:" >> MINFO
165c5e9c7dfSBarry Smith	-@echo  "-----------------------------------------" >> MINFO
166c5e9c7dfSBarry Smith	-@echo  "Using include paths: ${PETSC_INCLUDE}" >> MINFO
16793520af8SSatish Balay	-@echo  "------------------------------------------\"; " >> MINFO
16893520af8SSatish Balay	-@echo  "static char *petsclinkerinfo = \"  " >> MINFO
169c5e9c7dfSBarry Smith	-@echo  "Using C linker: ${CLINKER}" >> MINFO
170c5e9c7dfSBarry Smith	-@echo  "Using Fortran linker: ${FLINKER}" >> MINFO
17193520af8SSatish Balay	-@echo  "Using libraries: ${PETSC_LIB} \"; " >> MINFO
172*47d17dc9SKris Buschelman	-@cat MINFO | ${SED} -e 's/\^M//' | ${SED} -e 's/$$/ \\n\\/' | sed -e 's/\;  \\n\\/\;/'> ${MINFO}
1739c0905fcSSatish Balay	-@$(RM) MINFO
174ce0f4ea0SKris Buschelman
1753677444aSSatish Balay#
176fa527775SLois Curfman McInnes# Builds the PETSc libraries
177fa527775SLois Curfman McInnes# This target also builds fortran77 and f90 interface
178f6a9982fSBarry Smith# files and compiles .F files
1793677444aSSatish Balay#
180f6a9982fSBarry Smithbuild:
181efd74e9bSBarry Smith	-@echo "BEGINNING TO COMPILE LIBRARIES IN ALL DIRECTORIES"
18247794344SBarry Smith	-@echo "========================================="
18344ecba3fSMatthew Knepley	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=libfast tree
1845fde6e02SSatish Balay	-@${RANLIB} ${PETSC_LIB_DIR}/*.${LIB_SUFFIX}
1850b3634f8SBarry Smith	-@echo "Completed building libraries"
18647794344SBarry Smith	-@echo "========================================="
18735ca7349SBarry Smith#
1883677444aSSatish Balay# Builds PETSc test examples for a given BOPT and architecture
1898744090aSBarry Smith#
1903677444aSSatish Balaytestexamples: info chkopts
1913677444aSSatish Balay	-@echo "BEGINNING TO COMPILE AND RUN TEST EXAMPLES"
1923677444aSSatish Balay	-@echo "Due to different numerical round-off on certain"
1933677444aSSatish Balay	-@echo "machines some of the numbers may not match exactly."
1943677444aSSatish Balay	-@echo "========================================="
19519552e71SMatthew Knepley	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH}  PETSC_DIR=${PETSC_DIR} ACTION=testexamples_1  tree
1963677444aSSatish Balay	-@echo "Completed compiling and running test examples"
1973677444aSSatish Balay	-@echo "========================================="
1983677444aSSatish Balaytestfortran: info chkopts
1993677444aSSatish Balay	-@echo "BEGINNING TO COMPILE AND RUN FORTRAN TEST EXAMPLES"
2003677444aSSatish Balay	-@echo "========================================="
2013677444aSSatish Balay	-@echo "Due to different numerical round-off on certain"
2023677444aSSatish Balay	-@echo "machines or the way Fortran formats numbers"
2033677444aSSatish Balay	-@echo "some of the results may not match exactly."
2043677444aSSatish Balay	-@echo "========================================="
20519552e71SMatthew Knepley	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=testexamples_3  tree
2063677444aSSatish Balay	-@echo "Completed compiling and running Fortran test examples"
2073677444aSSatish Balay	-@echo "========================================="
20801c5c36fSSatish Balaytestexamples_uni: info chkopts
20901c5c36fSSatish Balay	-@echo "BEGINNING TO COMPILE AND RUN TEST UNI-PROCESSOR EXAMPLES"
21001c5c36fSSatish Balay	-@echo "Due to different numerical round-off on certain"
21101c5c36fSSatish Balay	-@echo "machines some of the numbers may not match exactly."
21201c5c36fSSatish Balay	-@echo "========================================="
21319552e71SMatthew Knepley	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=testexamples_4  tree
21401c5c36fSSatish Balay	-@echo "Completed compiling and running uniprocessor test examples"
21501c5c36fSSatish Balay	-@echo "========================================="
2163677444aSSatish Balaytestfortran_uni: info chkopts
2173677444aSSatish Balay	-@echo "BEGINNING TO COMPILE AND RUN TEST UNI-PROCESSOR FORTRAN EXAMPLES"
2183677444aSSatish Balay	-@echo "Due to different numerical round-off on certain"
2193677444aSSatish Balay	-@echo "machines some of the numbers may not match exactly."
2203677444aSSatish Balay	-@echo "========================================="
22119552e71SMatthew Knepley	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=testexamples_9  tree
2223677444aSSatish Balay	-@echo "Completed compiling and running uniprocessor fortran test examples"
2233677444aSSatish Balay	-@echo "========================================="
224ad96cc0dSLois Curfman McInnes
225f3eacedaSSatish Balay# Ranlib on the libraries
2268c37ef55SBarry Smithranlib:
2275fde6e02SSatish Balay	${RANLIB} ${PETSC_LIB_DIR}/*.${LIB_SUFFIX}
22861523587SBarry Smith
22911b6ed10SLois Curfman McInnes# Deletes PETSc libraries
230f3eacedaSSatish Balaydeletelibs: chkopts_basic
231b87434adSSatish Balay	-${RM} -f ${PETSC_LIB_DIR}/*
232d44968ceSBarry Smith
233a42cec9dSMatthew Knepley# Cleans up build
234a42cec9dSMatthew Knepleyallclean: deletelibs
23519552e71SMatthew Knepley	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=clean tree
236a42cec9dSMatthew Knepley
237467fbd6dSBarry Smith#
238467fbd6dSBarry Smith#   Updates your PETSc version to the latest set of patches
239467fbd6dSBarry Smith#
240467fbd6dSBarry Smithupdate:
241467fbd6dSBarry Smith	-@bin/petscupdate
2423677444aSSatish Balay
2434918a6b0SSatish Balay#
2444918a6b0SSatish Balay# Check if PETSC_DIR variable specified is valid
2454918a6b0SSatish Balay#
2464918a6b0SSatish Balaychk_petsc_dir:
2474918a6b0SSatish Balay	@if [ ! -f ${PETSC_DIR}/include/petscversion.h ]; then \
2481390f061SBarry Smith	  echo "Incorrect PETSC_DIR specified: ${PETSC_DIR}!"; \
2491390f061SBarry Smith	  echo "You need to use / to separate directories, not \\!"; \
2501390f061SBarry Smith	  echo "Aborting build"; \
2514918a6b0SSatish Balay	  false; fi
2524918a6b0SSatish Balay
2533677444aSSatish Balay# ------------------------------------------------------------------
2543677444aSSatish Balay#
2553677444aSSatish Balay# All remaining actions are intended for PETSc developers only.
2563677444aSSatish Balay# PETSc users should not generally need to use these commands.
2573677444aSSatish Balay#
2583677444aSSatish Balay
25965783a8cSBarry Smith# To access the tags in EMACS, type M-x visit-tags-table and specify
26065783a8cSBarry Smith# the file petsc/TAGS.
26165783a8cSBarry Smith# 1) To move to where a PETSc function is defined, enter M-. and the
26265783a8cSBarry Smith#     function name.
26365783a8cSBarry Smith# 2) To search for a string and move to the first occurrence,
26465783a8cSBarry Smith#     use M-x tags-search and the string.
2657acb7333SLois Curfman McInnes#     To locate later occurrences, use M-,
26611b6ed10SLois Curfman McInnes# Builds all etags files
26711b6ed10SLois Curfman McInnesalletags:
26801c05c5cSSatish Balay	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSDIR=${PETSC_DIR} etags
26909f7043eSSatish Balay	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSDIR=${PETSC_DIR} etags_complete
27009f7043eSSatish Balay	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSDIR=${PETSC_DIR} etags_noexamples
27109f7043eSSatish Balay	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSDIR=${PETSC_DIR} etags_examples
27209f7043eSSatish Balay	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSDIR=${PETSC_DIR} etags_makefiles
27311b6ed10SLois Curfman McInnes# Builds the basic etags file.	This should be employed by most users.
27420563c6bSBarry Smithetags:
27509f7043eSSatish Balay	-${RM} ${TAGSDIR}/TAGS
27609f7043eSSatish Balay	-touch ${TAGSDIR}/TAGS
27709f7043eSSatish Balay	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_sourcec alltree
27841fa366cSBarry Smith	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_sourcej alltree
27909f7043eSSatish Balay	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_sourceh alltree
28009f7043eSSatish Balay	-cd src/fortran; ${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_sourcef alltree
28109f7043eSSatish Balay	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_examplesc alltree
28209f7043eSSatish Balay	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_examplesf alltree
28309f7043eSSatish Balay	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_examplesch alltree
28409f7043eSSatish Balay	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_examplesfh alltree
28509f7043eSSatish Balay	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_makefile alltree
28609f7043eSSatish Balay	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS etags_bmakefiles
28729cdf679SBarry Smith# Builds complete etags list; only for PETSc developers.
28829cdf679SBarry Smithetags_complete:
28909f7043eSSatish Balay	-${RM} ${TAGSDIR}/TAGS_COMPLETE
29009f7043eSSatish Balay	-touch ${TAGSDIR}/TAGS_COMPLETE
29109f7043eSSatish Balay	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_sourcec alltree
29241fa366cSBarry Smith	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_sourcej alltree
29309f7043eSSatish Balay	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_sourceh alltree
29409f7043eSSatish Balay	-cd src/fortran; ${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_sourcef alltree
29509f7043eSSatish Balay	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_examplesc alltree
29609f7043eSSatish Balay	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_examplesf alltree
29709f7043eSSatish Balay	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_examplesch alltree
29809f7043eSSatish Balay	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_examplesfh alltree
29909f7043eSSatish Balay	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_makefile alltree
30009f7043eSSatish Balay	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE etags_bmakefiles
30109f7043eSSatish Balay	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_docs alltree
30209f7043eSSatish Balay	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_scripts alltree
30311b6ed10SLois Curfman McInnes# Builds the etags file that excludes the examples directories
304bfce26a3SBarry Smithetags_noexamples:
30509f7043eSSatish Balay	-${RM} ${TAGSDIR}/TAGS_NO_EXAMPLES
30609f7043eSSatish Balay	-touch ${TAGSDIR}/TAGS_NO_EXAMPLES
30709f7043eSSatish Balay	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES ACTION=etags_sourcec alltree
30841fa366cSBarry Smith	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES ACTION=etags_sourcej alltree
30909f7043eSSatish Balay	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES ACTION=etags_sourceh alltree
31009f7043eSSatish Balay	-cd src/fortran; ${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES ACTION=etags_sourcef alltree
31109f7043eSSatish Balay	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES ACTION=etags_makefile alltree
31209f7043eSSatish Balay	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES etags_bmakefiles
31309f7043eSSatish Balay	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES ACTION=etags_docs alltree
31411b6ed10SLois Curfman McInnes# Builds the etags file for makefiles
315b16a3bb1SBarry Smithetags_makefiles:
3167e0368d4SSatish Balay	-${RM} ${TAGSDIR}/TAGS_MAKEFILES
3177e0368d4SSatish Balay	-touch ${TAGSDIR}/TAGS_MAKEFILES
3187e0368d4SSatish Balay	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_MAKEFILES ACTION=etags_makefile alltree
3197e0368d4SSatish Balay	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_MAKEFILES etags_bmakefiles
320dc80aa23SSatish Balay# Builds the etags file for examples
321dc80aa23SSatish Balayetags_examples:
32209f7043eSSatish Balay	-${RM} ${TAGSDIR}/TAGS_EXAMPLES
32309f7043eSSatish Balay	-touch ${TAGSDIR}/TAGS_EXAMPLES
32409f7043eSSatish Balay	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_EXAMPLES ACTION=etags_examplesc alltree
32509f7043eSSatish Balay	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_EXAMPLES ACTION=etags_examplesch alltree
32609f7043eSSatish Balay	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_EXAMPLES ACTION=etags_examplesf alltree
32709f7043eSSatish Balay	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_EXAMPLES ACTION=etags_examplesfh alltree
3282176044fSSatish Balayetags_fexamples:
32909f7043eSSatish Balay	-${RM} ${TAGSDIR}/TAGS_FEXAMPLES
33009f7043eSSatish Balay	-touch ${TAGSDIR}/TAGS_FEXAMPLES
33109f7043eSSatish Balay	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_FEXAMPLES ACTION=etags_examplesf alltree
33209f7043eSSatish Balay	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_EXAMPLES ACTION=etags_examplesfh alltree
333b38bb785SSatish Balay#
334f20f7ba3SSatish Balay# These are here for the target allci and allco, and etags
3353677444aSSatish Balay#
336b38bb785SSatish Balay
33723bef294SSatish BalayBMAKEFILES = bmake/common/base bmake/common/test \
338516d1546SSatish Balay	     bmake/common/bopt* bmake/*/rules bmake/*/variables bmake/*/packages \
3392bda9e70SSatish Balay	     bmake/*/petscconf.h bmake/*/petscfix.h bmake/config/packages.in \
3402bda9e70SSatish Balay	     bmake/config/petscfix.h.in  bmake/config/rules.in  bmake/config/stamp-h.in \
3412bda9e70SSatish Balay	     bmake/config/variables.in \
3427666ef6eSBarry Smith             bmake/*/buildtest bmake/adic.init bmake/adicmf.init
3432f1ebae6SLois Curfman McInnesDOCS	   = bmake/readme bmake/petscconf.defs
34457c4596dSSatish BalaySCRIPTS    = maint/addlinks maint/builddist maint/buildlinks maint/wwwman \
34557c4596dSSatish Balay	     maint/xclude maint/crontab  \
346ba212d92SSatish Balay	     maint/autoftp
34711b6ed10SLois Curfman McInnes
3486b91f8d1SSatish Balayupdatewebdocs:
3496b91f8d1SSatish Balay	-chmod -R ug+w /mcs/tmp/petsc-tmp
3506b91f8d1SSatish Balay	-chgrp -R petsc /mcs/tmp/petsc-tmp
3516b91f8d1SSatish Balay	-/bin/rm -rf /mcs/tmp/petscdocs
3526b91f8d1SSatish Balay	-/bin/cp -r /mcs/tmp/petsc-tmp/docs /mcs/tmp/petscdocs
3536b91f8d1SSatish Balay	-maint/update-docs.py /mcs/tmp/petscdocs
3546b91f8d1SSatish Balay	-find /mcs/tmp/petscdocs -type d -name "*" -exec chmod g+w {} \;
3556b91f8d1SSatish Balay	-/bin/cp -r /mcs/tmp/petscdocs/* ${PETSC_DIR}/docs
3566b91f8d1SSatish Balay	-/bin/rm -rf /mcs/tmp/petscdocs
3576b91f8d1SSatish Balay
358ad56a76cSSatish Balaychk_loc:
359ad56a76cSSatish Balay	@if [ ${LOC}foo = foo ] ; then \
360ad56a76cSSatish Balay	  echo "*********************** ERROR ************************" ; \
361ad56a76cSSatish Balay	  echo " Please specify LOC variable for eg: make allmanualpages LOC=/sandbox/petsc"; \
362ad56a76cSSatish Balay	  echo "******************************************************";  false; fi
3632496ca06SSatish Balay# Deletes man pages (HTML version)
364ad56a76cSSatish Balaydeletemanualpages: chk_loc
3650c301e25SSatish Balay	find ${LOC}/docs/manualpages -type f -name "*.html" -exec ${RM} {} \;
3660c301e25SSatish Balay	${RM} ${LOC}/docs/manualpages/manualpages.cit
3672496ca06SSatish Balay
368a2fc510eSBarry Smith# Builds all the documentation - should be done every night
369a2fc510eSBarry Smithalldoc: chk_loc deletemanualpages chk_concepts_dir
370130c9832SBarry Smith	-${OMAKE} ACTION=manualpages_buildcite tree_basic LOC=${LOC}
371fe742e3dSSatish Balay	cd docs/tex/manual; ${OMAKE} manual.pdf LOC=${LOC}
372130c9832SBarry Smith	-${OMAKE} ACTION=manualpages tree_basic LOC=${LOC}
37348b2c0e9SBarry Smith	-maint/wwwindex.py ${PETSC_DIR} ${LOC}
374130c9832SBarry Smith	-${OMAKE} ACTION=manexamples tree LOC=${LOC}
375130c9832SBarry Smith	-${OMAKE} manconcepts LOC=${LOC}
37648b2c0e9SBarry Smith	-${OMAKE} ACTION=getexlist tree LOC=${LOC}
37748b2c0e9SBarry Smith	-${OMAKE} ACTION=exampleconcepts tree LOC=${LOC}
37848b2c0e9SBarry Smith	-maint/helpindex.py ${PETSC_DIR} ${LOC}
379e01137a2SSatish Balay
380435da068SBarry Smith# Builds .html versions of the source
381ad56a76cSSatish Balayallhtml: chk_loc
382779f5535SBarry Smith	-${OMAKE} ACTION=html PETSC_DIR=${PETSC_DIR} tree LOC=${LOC}
383435da068SBarry Smith
384115a300dSBarry Smithallcleanhtml:
385115a300dSBarry Smith	-${OMAKE} ACTION=cleanhtml PETSC_DIR=${PETSC_DIR} tree
386395565bcSBarry Smith
387ad56a76cSSatish Balaychk_concepts_dir: chk_loc
388fe742e3dSSatish Balay	@if [ ! -d "${LOC}/docs/manualpages/concepts" ]; then \
389bfe54af3SSatish Balay	  echo Making directory ${LOC}/docs/manualpages/concepts for library; ${MKDIR} ${LOC}/docs/manualpages/concepts; fi
39011b6ed10SLois Curfman McInnes# Builds Fortran stub files
39111b6ed10SLois Curfman McInnesallfortranstubs:
392d77bb2e1SSatish Balay	-@${RM} -f src/fortran/auto/*.c
3930c488147SSatish Balay	-@touch src/fortran/auto/makefile.src
394bbe92fcfSSatish Balay	-${OMAKE} ACTION=fortranstubs tree_basic
395807270aaSBarry Smith	-@cd src/fortran/auto; ${RM} makefile.src; echo SOURCEC = `find . -type f -name "*.c" -printf "%f "` > makefile.src
396807270aaSBarry Smith	-@cd src/fortran/auto; ${OMAKE} fixfortran
397f6ff2982SSatish Balay
398d55938c2SBarry Smithallci:
39919552e71SMatthew Knepley	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=ci  alltree
400b951964fSBarry Smith
401d55938c2SBarry Smithallco:
40219552e71SMatthew Knepley	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=co  alltree
403d55938c2SBarry Smith
404791d64f4SSatish Balay# usage make allrcslabel NEW_RCS_LABEL=v_2_0_28
405791d64f4SSatish Balayallrcslabel:
40619552e71SMatthew Knepley	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} NEW_RCS_LABEL=${NEW_RCS_LABEL} ACTION=rcslabel  alltree
407b334301eSBarry Smith#
408b334301eSBarry Smith#   The commands below are for generating ADIC versions of the code;
409b334301eSBarry Smith# they are not currently used.
410b334301eSBarry Smith#
4115eea60f9SBarry Smithalladicignore:
412b87434adSSatish Balay	-@${RM} ${INSTALL_LIB_DIR}/adicignore
41319552e71SMatthew Knepley	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adicignore  tree
4145eea60f9SBarry Smith
4155eea60f9SBarry Smithalladic:
416d18b0ea7SBarry Smith	-@echo "Beginning to compile ADIC source code in all directories"
41767b024f7SSatish Balay	-@echo "Using ADIC compiler: ${ADIC_CC} ${CCPPFLAGS}"
418d18b0ea7SBarry Smith	-@echo "========================================="
41947794344SBarry Smith	-@cd include ; \
42067b024f7SSatish Balay           ${ADIC_CC} -s -f 1 ${CCPPFLAGS} petsc.h
42119552e71SMatthew Knepley	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adic  tree
42247794344SBarry Smith	-@cd src/inline ; \
42319552e71SMatthew Knepley            ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} adic
42477ed5343SBarry Smith	-@cd src/blaslapack ; \
42519552e71SMatthew Knepley            ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adic  tree
4266e81b665SBarry Smith
42747794344SBarry Smithalladiclib:
428d18b0ea7SBarry Smith	-@echo "Beginning to compile ADIC libraries in all directories"
429d77bb2e1SSatish Balay	-@echo "Using compiler: ${CC} ${COPTFLAGS}"
430d18b0ea7SBarry Smith	-@echo "-----------------------------------------"
431d77bb2e1SSatish Balay	-@echo "Using PETSc flags: ${PETSCFLAGS} ${PCONF}"
432d18b0ea7SBarry Smith	-@echo "-----------------------------------------"
433e0e703c1SSatish Balay	-@echo "Using configuration flags:"
434ba1077baSMatthew Knepley	-@grep "define " bmake/${INLUDE_ARCH}/petscconf.h
435d18b0ea7SBarry Smith	-@echo "-----------------------------------------"
436d77bb2e1SSatish Balay	-@echo "Using include paths: ${PETSC_INCLUDE}"
437d18b0ea7SBarry Smith	-@echo "-----------------------------------------"
438d77bb2e1SSatish Balay	-@echo "Using PETSc directory: ${PETSC_DIR}"
43919552e71SMatthew Knepley	-@echo "Using PETSc arch: ${PETSC_ARCH}"
440d18b0ea7SBarry Smith	-@echo "========================================="
4415fde6e02SSatish Balay	-@${RM} -f  ${INSTALL_LIB_DIR}/*adic.${LIB_SUFFIX}
44219552e71SMatthew Knepley	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adiclib  tree
44377ed5343SBarry Smith	-@cd src/blaslapack ; \
44419552e71SMatthew Knepley            ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adiclib  tree
4457e351921SBarry Smith	-@cd src/adic/src ; \
44619552e71SMatthew Knepley            ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} lib
4475eea60f9SBarry Smith
4489e417c50SSatish Balay# -------------------------------------------------------------------------------
4499e417c50SSatish Balay#
4509e417c50SSatish Balay# Some macros to check if the fortran interface is up-to-date.
4519e417c50SSatish Balay#
4529e417c50SSatish Balaycountfortranfunctions:
453d77bb2e1SSatish Balay	-@cd ${PETSC_DIR}/src/fortran; egrep '^void' custom/*.c auto/*.c | \
45485c7cd6cSSatish Balay	cut -d'(' -f1 | tr -s  ' ' | cut -d' ' -f2 | uniq | egrep -v "(^$$|Petsc)" | \
4559e417c50SSatish Balay	sed "s/_$$//" | sort > /tmp/countfortranfunctions
456b334301eSBarry Smith
4579e417c50SSatish Balaycountcfunctions:
45885c7cd6cSSatish Balay	-@ grep extern ${PETSC_DIR}/include/*.h *.h | grep "(" | tr -s ' ' | \
45985c7cd6cSSatish Balay	cut -d'(' -f1 | cut -d' ' -f3 | grep -v "\*" | tr -s '\012' |  \
4609e417c50SSatish Balay	tr 'A-Z' 'a-z' |  sort > /tmp/countcfunctions
4619e417c50SSatish Balay
4629e417c50SSatish Balaydifffortranfunctions: countfortranfunctions countcfunctions
4639e417c50SSatish Balay	-@echo -------------- Functions missing in the fortran interface ---------------------
4649700b7f8SSatish Balay	-@${DIFF} /tmp/countcfunctions /tmp/countfortranfunctions | grep "^<" | cut -d' ' -f2
4659e417c50SSatish Balay	-@echo ----------------- Functions missing in the C interface ------------------------
4669700b7f8SSatish Balay	-@${DIFF} /tmp/countcfunctions /tmp/countfortranfunctions | grep "^>" | cut -d' ' -f2
467d77bb2e1SSatish Balay	-@${RM}  /tmp/countcfunctions /tmp/countfortranfunctions
468b334301eSBarry Smith
4693f4c9a3aSSatish Balaycheckbadfortranstubs:
4703f4c9a3aSSatish Balay	-@echo "========================================="
4713f4c9a3aSSatish Balay	-@echo "Functions with MPI_Comm as an Argument"
4723f4c9a3aSSatish Balay	-@echo "========================================="
473d77bb2e1SSatish Balay	-@cd ${PETSC_DIR}/src/fortran/auto; grep '^void' *.c | grep 'MPI_Comm' | \
47485c7cd6cSSatish Balay	tr -s ' ' | tr -s ':' ' ' |cut -d'(' -f1 | cut -d' ' -f1,3
4753f4c9a3aSSatish Balay	-@echo "========================================="
4763f4c9a3aSSatish Balay	-@echo "Functions with a String as an Argument"
4773f4c9a3aSSatish Balay	-@echo "========================================="
478d77bb2e1SSatish Balay	-@cd ${PETSC_DIR}/src/fortran/auto; grep '^void' *.c | grep 'char \*' | \
47985c7cd6cSSatish Balay	tr -s ' ' | tr -s ':' ' ' |cut -d'(' -f1 | cut -d' ' -f1,3
4803f4c9a3aSSatish Balay	-@echo "========================================="
4813f4c9a3aSSatish Balay	-@echo "Functions with Pointers to PETSc Objects as Argument"
4823f4c9a3aSSatish Balay	-@echo "========================================="
483d77bb2e1SSatish Balay	-@cd ${PETSC_DIR}/src/fortran/auto; \
48485c7cd6cSSatish Balay	_p_OBJ=`grep _p_ ${PETSC_DIR}/include/*.h | tr -s ' ' | \
48585c7cd6cSSatish Balay	cut -d' ' -f 3 | tr -s '\012' | grep -v '{' | cut -d'*' -f1 | \
4863f4c9a3aSSatish Balay	sed "s/_p_//g" | tr -s '\012 ' ' *|' ` ; \
4873f4c9a3aSSatish Balay	for OBJ in $$_p_OBJ; do \
48885c7cd6cSSatish Balay	grep "$$OBJ \*" *.c | tr -s ' ' | tr -s ':' ' ' | \
4893f4c9a3aSSatish Balay	cut -d'(' -f1 | cut -d' ' -f1,3; \
4903f4c9a3aSSatish Balay	done
4914556b810SBarry Smith#
4924556b810SBarry Smith# Automatically generates PETSc exercises in html from the tutorial examples.
493b6ea66eeSBarry Smith#
494b6ea66eeSBarry Smith# The introduction for each section is obtained from docs/manualpages/bop.${MANSEC} is under RCS and may be edited
495b6ea66eeSBarry Smith#  (used also in introductions to the manual pages)
496b6ea66eeSBarry Smith# The overall introduction is in docs/exercises/introduction.html and is under RCS and may be edited
497b6ea66eeSBarry Smith# The list of exercises is from TUTORIALS in each directory's makefile
498b6ea66eeSBarry Smith#
4994556b810SBarry Smith# DO NOT EDIT the pageform.txt or *.htm files generated since they will be automatically replaced.
5004556b810SBarry Smith# The pagemaker rule is in the file bmake/common (at the bottom)
5014556b810SBarry Smith#
502843ae28eSBarry Smith# Eventually the line below will replace the two cd in the rule below, it is just this way now for speed
50397e8d271SBarry Smith#	-@${OMAKE} PETSC_DIR=${PETSC_DIR} pagemaker
504843ae28eSBarry Smith#
50597e8d271SBarry Smithexercises:
50697e8d271SBarry Smith	-@echo "========================================="
50797e8d271SBarry Smith	-@echo "Generating HTML tutorial exercises"
508467fbd6dSBarry Smith	-@${RM} docs/pageform.txt
50997e8d271SBarry Smith	-@echo "title=\"PETSc Exercises\""                >  docs/pageform.txt
51097e8d271SBarry Smith	-@echo "access_title=Exercise Sections"              >>  docs/pageform.txt
511beb1b3a5SBarry Smith	-@echo "access_format=short"                        >> docs/pageform.txt
51297e8d271SBarry Smith	-@echo "startpage=../exercises/introduction.htm"  >> docs/pageform.txt
51397e8d271SBarry Smith	-@echo "NONE title=\"Introduction\" command=link src=../exercises/introduction.htm" >> docs/pageform.txt
51497e8d271SBarry Smith	-@echo "Generating HTML for individual directories"
51597e8d271SBarry Smith	-@echo "========================================="
516beb1b3a5SBarry Smith	-@${OMAKE} PETSC_DIR=${PETSC_DIR} ACTION=pagemaker tree
51797e8d271SBarry Smith	-@echo "Completed HTML for individual directories"
51897e8d271SBarry Smith	-@echo "NONE title=\"<HR>\" " >> docs/pageform.txt;
51997e8d271SBarry Smith	-@echo "NONE title=\"PETSc Documentation\" command=link src=../index.html target=replace" >> docs/pageform.txt
52097e8d271SBarry Smith	/home/MPI/class/mpiexmpl/maint/makepage.new -pageform=docs/pageform.txt -access_extra=/dev/null -outdir=docs/exercises
52197e8d271SBarry Smith	-@echo "========================================="
52297e8d271SBarry Smith
5238d3498cbSMatthew Knepley.PHONY: info info_h build testexamples testfortran testexamples_uni testfortran_uni ranlib deletelibs allclean update chk_petsc_dir \
524a42cec9dSMatthew Knepley        alletags etags etags_complete etags_noexamples etags_makefiles etags_examples etags_fexamples updatewebdocs alldoc allmanualpages \
525a42cec9dSMatthew Knepley        allhtml allcleanhtml allfortranstubs allci allco allrcslabel alladicignore alladic alladiclib countfortranfunctions \
526ca5c9d59SMatthew Knepley        start_configure configure_petsc configure_clean
527