xref: /petsc/makefile (revision e74ef6923b2c0251c8aab3a0671bbb2dfd6aaf97)
1# $Id: makefile,v 1.353 2001/08/28 19:43:38 balay Exp $
2#
3# This is the makefile for installing PETSc. See the file
4# docs/installation.html for directions on installing PETSc.
5# See also bmake/common for additional commands.
6#
7ALL: all
8LOCDIR = .
9DIRS   = src include docs
10#
11# Configuration Variables
12#
13# Read configure options from a file if CONFIGURE_OPTIONSis not defined
14CONFIGURE_OPTIONS_FILE = ./config/configure_options
15CONFIGURE_OPTIONS      = $(shell cat $(CONFIGURE_OPTIONS_FILE))
16CONFIGURE_LOG_FILE     = configure_petsc.log
17AUTOMAKE_ADD_FILES     = config/config.guess config/config.sub config/install-sh config/missing config/mkinstalldirs \
18                         config/ltconfig config/ltmain.sh
19
20include ${PETSC_DIR}/bmake/common/base
21include ${PETSC_DIR}/bmake/common/test
22
23#
24# Configuration Targets
25#
26aclocal.m4: configure.in
27	@echo "Making $@" >> $(CONFIGURE_LOG_FILE)
28	@echo "----------------------------------------" >> $(CONFIGURE_LOG_FILE)
29	@aclocal >> $(CONFIGURE_LOG_FILE)
30
31bmake/config/petscconf.h.in: config/acconfig.h config/acsite.m4 configure.in
32	@echo "Making $@" >> $(CONFIGURE_LOG_FILE)
33	@echo "----------------------------------------" >> $(CONFIGURE_LOG_FILE)
34	@autoheader -l config >> $(CONFIGURE_LOG_FILE)
35
36$(AUTOMAKE_ADD_FILES):
37	@echo "Making $@" >> $(CONFIGURE_LOG_FILE)
38	@echo "----------------------------------------" >> $(CONFIGURE_LOG_FILE)
39	@automake --foreign --add-missing Makefile >> $(CONFIGURE_LOG_FILE)
40
41Makefile.am: $(AUTOMAKE_ADD_FILES)
42
43Makefile.in: Makefile.am
44	@echo "Making $@" >> $(CONFIGURE_LOG_FILE)
45	@echo "----------------------------------------" >> $(CONFIGURE_LOG_FILE)
46	@automake --foreign Makefile >> $(CONFIGURE_LOG_FILE)
47
48configure: configure.in config/acsite.m4 aclocal.m4 bmake/config/petscconf.h.in $(AUTOMAKE_ADD_FILES)
49	@echo "Making $@" >> $(CONFIGURE_LOG_FILE)
50	@echo "----------------------------------------" >> $(CONFIGURE_LOG_FILE)
51	@autoconf -l config >> $(CONFIGURE_LOG_FILE)
52
53start_configure:
54	-@$(RM) $(CONFIGURE_LOG_FILE)
55
56configure_petsc: start_configure configure Makefile.in
57	@echo "Configuring Petsc with options:" >> $(CONFIGURE_LOG_FILE)
58	@echo "$(CONFIGURE_OPTIONS)" >> $(CONFIGURE_LOG_FILE)
59	@echo "----------------------------------------" >> $(CONFIGURE_LOG_FILE)
60	@echo "$(CONFIGURE_OPTIONS)" > $(CONFIGURE_OPTIONS_FILE)
61	@./configure $(CONFIGURE_OPTIONS) >> $(CONFIGURE_LOG_FILE)
62
63$(CONFIGURE_LOG_FILE): $(CONFIGURE_OPTIONS_FILE)
64	$(MAKE) configure_petsc
65
66configure_clean:
67	-@$(RM) aclocal.m4
68	-@$(RM) bmake/config/petscconf.h.in
69	-@$(RM) $(AUTOMAKE_ADD_FILES) Makefile.in
70	-@$(RM) configure
71#
72# Basic targets to build PETSc libraries.
73# all     : builds the c, fortran, and f90 libraries
74all       : $(CONFIGURE_LOG_FILE) nall
75all_lt    : $(CONFIGURE_LOG_FILE) chk_petsc_dir info info_h chklib_dir deletelibs build_lt shared
76nall      : chk_petsc_dir info info_h chklib_dir deletelibs build shared
77#
78# Prints information about the system and version of PETSc being compiled
79#
80info:
81	-@echo "=========================================="
82	-@echo " "
83	-@echo "See docs/troubleshooting.html and docs/bugreporting.html"
84	-@echo "for help with installation problems. Please send EVERYTHING"
85	-@echo "printed out below when reporting problems"
86	-@echo " "
87	-@echo "To subscribe to the PETSc users mailing list, send mail to "
88	-@echo "majordomo@mcs.anl.gov with the message: "
89	-@echo "subscribe petsc-users"
90	-@echo " "
91	-@echo "=========================================="
92	-@echo On `date` on `hostname`
93	-@echo Machine characteristics: `uname -a`
94	-@echo "-----------------------------------------"
95	-@echo "Using C compiler: ${CC} ${COPTFLAGS} ${CCPPFLAGS}"
96	-@if [ -n "${C_CCV}" -a "${C_CCV}" != "unknown" ] ; then \
97	  echo "C Compiler version:" ; ${C_CCV} ; fi ; true
98	-@if [ -n "${CXX_CCV}" -a "${CXX_CCV}" != "unknown" ] ; then \
99	  echo "C++ Compiler version:" ; ${CXX_CCV} ; fi; true
100	-@echo "Using Fortran compiler: ${FC} ${FOPTFLAGS} ${FCPPFLAGS}"
101	-@if [ -n "${C_FCV}" -a "${C_FCV}" != "unknown" ] ; then \
102	  echo "Fortran Compiler version:" ; ${C_FCV} ; fi; true
103	-@echo "-----------------------------------------"
104	-@grep PETSC_VERSION_NUMBER ${PETSC_DIR}/include/petscversion.h | ${SED} "s/........//"
105	-@echo "-----------------------------------------"
106	-@echo "Using PETSc flags: ${PETSCFLAGS} ${PCONF}"
107	-@echo "-----------------------------------------"
108	-@echo "Using configuration flags:"
109	-@grep "define " ${PETSC_DIR}/bmake/${PETSC_ARCH}/petscconf.h
110	-@echo "-----------------------------------------"
111	-@echo "Using include paths: ${PETSC_INCLUDE}"
112	-@echo "-----------------------------------------"
113	-@echo "Using PETSc directory: ${PETSC_DIR}"
114	-@echo "Using PETSc arch: ${PETSC_ARCH}"
115	-@echo "------------------------------------------"
116	-@echo "Using C linker: ${CLINKER}"
117	-@echo "Using Fortran linker: ${FLINKER}"
118	-@echo "Using libraries: ${PETSC_LIB}"
119	-@echo "=========================================="
120#
121#
122MINFO = ${PETSC_DIR}/bmake/${PETSC_ARCH}/petscmachineinfo.h
123info_h:
124	-@$(RM) -f MINFO ${MINFO}
125	-@echo  "static char *petscmachineinfo = \"  " >> MINFO
126	-@echo  "Libraries compiled on `date` on `hostname` " >> MINFO
127	-@echo  Machine characteristics: `uname -a` "" >> MINFO
128	-@echo  "Using PETSc directory: ${PETSC_DIR}" >> MINFO
129	-@echo  "Using PETSc arch: ${PETSC_ARCH}" >> MINFO
130	-@echo  "-----------------------------------------\"; " >> MINFO
131	-@echo  "static char *petsccompilerinfo = \"  " >> MINFO
132	-@echo  "Using C compiler: ${CC} ${COPTFLAGS} ${CCPPFLAGS} " >> MINFO
133	-@if [  "${C_CCV}" -a "${C_CCV}" != "unknown" ] ; then \
134	  echo  "C Compiler version:"  >> MINFO ; ${C_CCV} >> MINFO 2>&1; fi ; true
135	-@if [  "${CXX_CCV}" -a "${CXX_CCV}" != "unknown" ] ; then \
136	  echo  "C++ Compiler version:"  >> MINFO; ${CXX_CCV} >> MINFO 2>&1 ; fi ; true
137	-@echo  "Using Fortran compiler: ${FC} ${FOPTFLAGS} ${FCPPFLAGS}" >> MINFO
138	-@if [  "${C_FCV}" -a "${C_FCV}" != "unknown" ] ; then \
139	  echo  "Fortran Compiler version:" >> MINFO ; ${C_FCV} >> MINFO 2>&1 ; fi ; true
140	-@echo  "-----------------------------------------\"; " >> MINFO
141	-@echo  "static char *petsccompilerflagsinfo = \"  " >> MINFO
142	-@echo  "Using PETSc flags: ${PETSCFLAGS} ${PCONF}" >> MINFO
143	-@echo  "-----------------------------------------" >> MINFO
144	-@echo  "Using configuration flags:" >> MINFO
145	-@echo  "-----------------------------------------" >> MINFO
146	-@echo  "Using include paths: ${PETSC_INCLUDE}" >> MINFO
147	-@echo  "------------------------------------------\"; " >> MINFO
148	-@echo  "static char *petsclinkerinfo = \"  " >> MINFO
149	-@echo  "Using C linker: ${CLINKER}" >> MINFO
150	-@echo  "Using Fortran linker: ${FLINKER}" >> MINFO
151	-@echo  "Using libraries: ${PETSC_LIB} \"; " >> MINFO
152	-@cat MINFO | ${SED} -e 's/$$/ \\n\\/' | sed -e 's/\;  \\n\\/\;/'> ${MINFO}
153	-@chmod g+w ${MINFO}
154	-@$(RM) MINFO
155#
156# Builds the PETSc libraries
157# This target also builds fortran77 and f90 interface
158# files and compiles .F files
159#
160build:
161	-@echo "BEGINNING TO COMPILE LIBRARIES IN ALL DIRECTORIES"
162	-@echo "========================================="
163	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=libfast tree
164	${RANLIB} ${PETSC_LIB_DIR}/*.a
165	-@chmod g+w  ${PETSC_LIB_DIR}/*.a
166	-@echo "Completed building libraries"
167	-@echo "========================================="
168#
169# Builds the PETSc libraries
170# This target is the same as 'build', but uses the 'lib' target instead
171#
172build_lt:
173	-@echo "BEGINNING TO COMPILE LIBTOOL LIBRARIES IN ALL DIRECTORIES"
174	-@echo "========================================="
175	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=lib tree
176	-@echo "Completed building libraries"
177	-@echo "========================================="
178#
179# Builds PETSc test examples for a given BOPT and architecture
180#
181testexamples: info chkopts
182	-@echo "BEGINNING TO COMPILE AND RUN TEST EXAMPLES"
183	-@echo "Due to different numerical round-off on certain"
184	-@echo "machines some of the numbers may not match exactly."
185	-@echo "========================================="
186	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH}  PETSC_DIR=${PETSC_DIR} ACTION=testexamples_1  tree
187	-@echo "Completed compiling and running test examples"
188	-@echo "========================================="
189testfortran: info chkopts
190	-@echo "BEGINNING TO COMPILE AND RUN FORTRAN TEST EXAMPLES"
191	-@echo "========================================="
192	-@echo "Due to different numerical round-off on certain"
193	-@echo "machines or the way Fortran formats numbers"
194	-@echo "some of the results may not match exactly."
195	-@echo "========================================="
196	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=testexamples_3  tree
197	-@echo "Completed compiling and running Fortran test examples"
198	-@echo "========================================="
199testexamples_uni: info chkopts
200	-@echo "BEGINNING TO COMPILE AND RUN TEST UNI-PROCESSOR EXAMPLES"
201	-@echo "Due to different numerical round-off on certain"
202	-@echo "machines some of the numbers may not match exactly."
203	-@echo "========================================="
204	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=testexamples_4  tree
205	-@echo "Completed compiling and running uniprocessor test examples"
206	-@echo "========================================="
207testfortran_uni: info chkopts
208	-@echo "BEGINNING TO COMPILE AND RUN TEST UNI-PROCESSOR FORTRAN EXAMPLES"
209	-@echo "Due to different numerical round-off on certain"
210	-@echo "machines some of the numbers may not match exactly."
211	-@echo "========================================="
212	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=testexamples_9  tree
213	-@echo "Completed compiling and running uniprocessor fortran test examples"
214	-@echo "========================================="
215
216# Ranlib on the libraries
217ranlib:
218	${RANLIB} ${PETSC_LIB_DIR}/*.a
219
220# Deletes PETSc libraries
221deletelibs: chkopts_basic
222	-${RM} -f ${PETSC_LIB_DIR}/*
223
224# Cleans up build
225allclean: deletelibs
226	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} PETSC_DIR=${PETSC_DIR} ACTION=clean tree
227
228#
229#   Updates your PETSc version to the latest set of patches
230#
231update:
232	-@bin/petscupdate
233
234#
235# Check if PETSC_DIR variable specified is valid
236#
237chk_petsc_dir:
238	@if [ ! -f ${PETSC_DIR}/include/petscversion.h ]; then \
239	  echo "Incorrect PETSC_DIR specified: ${PETSC_DIR}!"; \
240	  echo "You need to use / to separate directories, not \\!"; \
241	  echo "Aborting build"; \
242	  false; fi
243
244# ------------------------------------------------------------------
245#
246# All remaining actions are intended for PETSc developers only.
247# PETSc users should not generally need to use these commands.
248#
249
250# To access the tags in EMACS, type M-x visit-tags-table and specify
251# the file petsc/TAGS.
252# 1) To move to where a PETSc function is defined, enter M-. and the
253#     function name.
254# 2) To search for a string and move to the first occurrence,
255#     use M-x tags-search and the string.
256#     To locate later occurrences, use M-,
257# Builds all etags files
258alletags:
259	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSDIR=${PETSC_DIR} etags
260	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSDIR=${PETSC_DIR} etags_complete
261	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSDIR=${PETSC_DIR} etags_noexamples
262	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSDIR=${PETSC_DIR} etags_examples
263	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSDIR=${PETSC_DIR} etags_makefiles
264# Builds the basic etags file.	This should be employed by most users.
265etags:
266	-${RM} ${TAGSDIR}/TAGS
267	-touch ${TAGSDIR}/TAGS
268	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_sourcec alltree
269	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_sourcej alltree
270	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_sourceh alltree
271	-cd src/fortran; ${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_sourcef alltree
272	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_examplesc alltree
273	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_examplesf alltree
274	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_examplesch alltree
275	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_examplesfh alltree
276	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS ACTION=etags_makefile alltree
277	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS etags_bmakefiles
278	-chmod g+w TAGS
279# Builds complete etags list; only for PETSc developers.
280etags_complete:
281	-${RM} ${TAGSDIR}/TAGS_COMPLETE
282	-touch ${TAGSDIR}/TAGS_COMPLETE
283	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_sourcec alltree
284	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_sourcej alltree
285	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_sourceh alltree
286	-cd src/fortran; ${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_sourcef alltree
287	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_examplesc alltree
288	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_examplesf alltree
289	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_examplesch alltree
290	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_examplesfh alltree
291	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_makefile alltree
292	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE etags_bmakefiles
293	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_docs alltree
294	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_COMPLETE ACTION=etags_scripts alltree
295	-chmod g+w TAGS_COMPLETE
296# Builds the etags file that excludes the examples directories
297etags_noexamples:
298	-${RM} ${TAGSDIR}/TAGS_NO_EXAMPLES
299	-touch ${TAGSDIR}/TAGS_NO_EXAMPLES
300	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES ACTION=etags_sourcec alltree
301	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES ACTION=etags_sourcej alltree
302	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES ACTION=etags_sourceh alltree
303	-cd src/fortran; ${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES ACTION=etags_sourcef alltree
304	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES ACTION=etags_makefile alltree
305	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES etags_bmakefiles
306	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_NO_EXAMPLES ACTION=etags_docs alltree
307	-chmod g+w TAGS_NO_EXAMPLES
308# Builds the etags file for makefiles
309etags_makefiles:
310	-${RM} ${TAGSDIR}/TAGS_MAKEFILES
311	-touch ${TAGSDIR}/TAGS_MAKEFILES
312	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_MAKEFILES ACTION=etags_makefile alltree
313	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_MAKEFILES etags_bmakefiles
314	-chmod g+w TAGS_MAKEFILES
315# Builds the etags file for examples
316etags_examples:
317	-${RM} ${TAGSDIR}/TAGS_EXAMPLES
318	-touch ${TAGSDIR}/TAGS_EXAMPLES
319	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_EXAMPLES ACTION=etags_examplesc alltree
320	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_EXAMPLES ACTION=etags_examplesch alltree
321	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_EXAMPLES ACTION=etags_examplesf alltree
322	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_EXAMPLES ACTION=etags_examplesfh alltree
323	-chmod g+w TAGS_EXAMPLES
324etags_fexamples:
325	-${RM} ${TAGSDIR}/TAGS_FEXAMPLES
326	-touch ${TAGSDIR}/TAGS_FEXAMPLES
327	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_FEXAMPLES ACTION=etags_examplesf alltree
328	-${OMAKE} PETSC_DIR=${PETSC_DIR} TAGSFILE=${TAGSDIR}/TAGS_EXAMPLES ACTION=etags_examplesfh alltree
329	-chmod g+w TAGS_FEXAMPLES
330#
331# These are here for the target allci and allco, and etags
332#
333
334BMAKEFILES = bmake/common/base bmake/common/rules_win32 bmake/common/test \
335	     bmake/common/bopt* bmake/*/rules bmake/*/variables bmake/*/packages \
336	     bmake/*/petscconf.h bmake/*/petscfix.h bmake/win32/makefile.dos bmake/config/*.in \
337             bmake/*/buildtest bmake/adic.init bmake/adicmf.init
338DOCS	   = bmake/readme bmake/petscconf.defs
339SCRIPTS    = maint/addlinks maint/builddist maint/buildlinks maint/wwwman \
340	     maint/xclude maint/crontab  \
341	     maint/autoftp include/foldinclude/generateincludes
342
343updatewebdocs:
344	-chmod -R ug+w /mcs/tmp/petsc-tmp
345	-chgrp -R petsc /mcs/tmp/petsc-tmp
346	-/bin/rm -rf /mcs/tmp/petscdocs
347	-/bin/cp -r /mcs/tmp/petsc-tmp/docs /mcs/tmp/petscdocs
348	-maint/update-docs.py /mcs/tmp/petscdocs
349	-find /mcs/tmp/petscdocs -type d -name "*" -exec chmod g+w {} \;
350	-/bin/cp -r /mcs/tmp/petscdocs/* ${PETSC_DIR}/docs
351	-/bin/rm -rf /mcs/tmp/petscdocs
352
353# Builds all the documentation - should be done every night
354alldoc: allmanualpages
355	cd docs/tex/manual; ${OMAKE} manual.dvi manual.ps manual.html splitmanual.html
356
357# Deletes man pages (HTML version)
358deletemanualpages:
359	${RM} -f ${LOC}/docs/manualpages/*/*.html \
360                 ${LOC}/docs/manualpages/manualpages.cit
361
362# Builds all versions of the man pages
363allmanualpages: deletemanualpages
364	-${OMAKE} ACTION=manualpages_buildcite tree_basic LOC=${LOC}
365	-${OMAKE} ACTION=manualpages tree_basic  LOC=${LOC}
366	-maint/wwwindex.py ${PETSC_DIR} ${LOC}
367	-${OMAKE} ACTION=manexamples tree  LOC=${LOC}
368	-${OMAKE} manconcepts  LOC=${LOC}
369	-${OMAKE} ACTION=getexlist tree LOC=${LOC}
370	-${OMAKE} ACTION=exampleconcepts tree LOC=${LOC}
371	-maint/helpindex.py ${PETSC_DIR} ${LOC}
372	-@chmod g+w ${LOC}/docs/manualpages/*/*.html
373
374# Builds .html versions of the source
375allhtml:
376	-${OMAKE} ACTION=html PETSC_DIR=${PETSC_DIR} tree LOC=${LOC}
377
378allcleanhtml:
379	-${OMAKE} ACTION=cleanhtml PETSC_DIR=${PETSC_DIR} tree
380
381# Builds Fortran stub files
382allfortranstubs:
383	-@include/foldinclude/generateincludes
384	-@${RM} -f src/fortran/auto/*.c
385	-${OMAKE} ACTION=fortranstubs tree_basic
386	-@cd src/fortran/auto; ${OMAKE} fixfortran
387	chmod g+w src/fortran/auto/*.c
388
389allci:
390	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=ci  alltree
391
392allco:
393	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=co  alltree
394
395# usage make allrcslabel NEW_RCS_LABEL=v_2_0_28
396allrcslabel:
397	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} NEW_RCS_LABEL=${NEW_RCS_LABEL} ACTION=rcslabel  alltree
398#
399#   The commands below are for generating ADIC versions of the code;
400# they are not currently used.
401#
402alladicignore:
403	-@${RM} ${INSTALL_LIB_DIR}/adicignore
404	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adicignore  tree
405
406alladic:
407	-@echo "Beginning to compile ADIC source code in all directories"
408	-@echo "Using ADIC compiler: ${ADIC_CC} ${CCPPFLAGS}"
409	-@echo "========================================="
410	-@cd include ; \
411           ${ADIC_CC} -s -f 1 ${CCPPFLAGS} petsc.h
412	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adic  tree
413	-@cd src/inline ; \
414            ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} adic
415	-@cd src/blaslapack ; \
416            ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adic  tree
417
418alladiclib:
419	-@echo "Beginning to compile ADIC libraries in all directories"
420	-@echo "Using compiler: ${CC} ${COPTFLAGS}"
421	-@echo "-----------------------------------------"
422	-@echo "Using PETSc flags: ${PETSCFLAGS} ${PCONF}"
423	-@echo "-----------------------------------------"
424	-@echo "Using configuration flags:"
425	-@grep "define " bmake/${PETSC_ARCH}/petscconf.h
426	-@echo "-----------------------------------------"
427	-@echo "Using include paths: ${PETSC_INCLUDE}"
428	-@echo "-----------------------------------------"
429	-@echo "Using PETSc directory: ${PETSC_DIR}"
430	-@echo "Using PETSc arch: ${PETSC_ARCH}"
431	-@echo "========================================="
432	-@${RM} -f  ${INSTALL_LIB_DIR}/*adic.a
433	-@${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adiclib  tree
434	-@cd src/blaslapack ; \
435            ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} ACTION=adiclib  tree
436	-@cd src/adic/src ; \
437            ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} lib
438
439# -------------------------------------------------------------------------------
440#
441# Some macros to check if the fortran interface is up-to-date.
442#
443countfortranfunctions:
444	-@cd ${PETSC_DIR}/src/fortran; egrep '^void' custom/*.c auto/*.c | \
445	cut -d'(' -f1 | tr -s  ' ' | cut -d' ' -f2 | uniq | egrep -v "(^$$|Petsc)" | \
446	sed "s/_$$//" | sort > /tmp/countfortranfunctions
447
448countcfunctions:
449	-@ grep extern ${PETSC_DIR}/include/*.h *.h | grep "(" | tr -s ' ' | \
450	cut -d'(' -f1 | cut -d' ' -f3 | grep -v "\*" | tr -s '\012' |  \
451	tr 'A-Z' 'a-z' |  sort > /tmp/countcfunctions
452
453difffortranfunctions: countfortranfunctions countcfunctions
454	-@echo -------------- Functions missing in the fortran interface ---------------------
455	-@${DIFF} /tmp/countcfunctions /tmp/countfortranfunctions | grep "^<" | cut -d' ' -f2
456	-@echo ----------------- Functions missing in the C interface ------------------------
457	-@${DIFF} /tmp/countcfunctions /tmp/countfortranfunctions | grep "^>" | cut -d' ' -f2
458	-@${RM}  /tmp/countcfunctions /tmp/countfortranfunctions
459
460checkbadfortranstubs:
461	-@echo "========================================="
462	-@echo "Functions with MPI_Comm as an Argument"
463	-@echo "========================================="
464	-@cd ${PETSC_DIR}/src/fortran/auto; grep '^void' *.c | grep 'MPI_Comm' | \
465	tr -s ' ' | tr -s ':' ' ' |cut -d'(' -f1 | cut -d' ' -f1,3
466	-@echo "========================================="
467	-@echo "Functions with a String as an Argument"
468	-@echo "========================================="
469	-@cd ${PETSC_DIR}/src/fortran/auto; grep '^void' *.c | grep 'char \*' | \
470	tr -s ' ' | tr -s ':' ' ' |cut -d'(' -f1 | cut -d' ' -f1,3
471	-@echo "========================================="
472	-@echo "Functions with Pointers to PETSc Objects as Argument"
473	-@echo "========================================="
474	-@cd ${PETSC_DIR}/src/fortran/auto; \
475	_p_OBJ=`grep _p_ ${PETSC_DIR}/include/*.h | tr -s ' ' | \
476	cut -d' ' -f 3 | tr -s '\012' | grep -v '{' | cut -d'*' -f1 | \
477	sed "s/_p_//g" | tr -s '\012 ' ' *|' ` ; \
478	for OBJ in $$_p_OBJ; do \
479	grep "$$OBJ \*" *.c | tr -s ' ' | tr -s ':' ' ' | \
480	cut -d'(' -f1 | cut -d' ' -f1,3; \
481	done
482# Builds noise routines (not yet publically available)
483# Note:	 libfast cannot run on .F files on certain machines, so we
484# use lib and check for errors here.
485noise: info chklib_dir
486	-@echo "Beginning to compile noise routines"
487	-@echo "========================================="
488	-@cd src/snes/interface/noise; \
489	  ${OMAKE} BOPT=${BOPT} PETSC_ARCH=${PETSC_ARCH} lib > trashz 2>&1; \
490	  grep -v clog trashz | grep -v "information sections" | \
491	  egrep -i '(Error|warning|Can)' >> /dev/null;\
492	  if [ "$$?" != 1 ]; then \
493	  cat trashz ; fi; ${RM} trashz
494	${RANLIB} ${INSTALL_LIB_DIR}/libpetscsnes.a
495	-@chmod g+w  ${INSTALL_LIB_DIR}/libpetscsnes.a
496	-@echo "Completed compiling noise routines"
497	-@echo "========================================="
498
499#
500# Automatically generates PETSc exercises in html from the tutorial examples.
501#
502# The introduction for each section is obtained from docs/manualpages/bop.${MANSEC} is under RCS and may be edited
503#  (used also in introductions to the manual pages)
504# The overall introduction is in docs/exercises/introduction.html and is under RCS and may be edited
505# The list of exercises is from TUTORIALS in each directory's makefile
506#
507# DO NOT EDIT the pageform.txt or *.htm files generated since they will be automatically replaced.
508# The pagemaker rule is in the file bmake/common (at the bottom)
509#
510# Eventually the line below will replace the two cd in the rule below, it is just this way now for speed
511#	-@${OMAKE} PETSC_DIR=${PETSC_DIR} pagemaker
512#
513exercises:
514	-@echo "========================================="
515	-@echo "Generating HTML tutorial exercises"
516	-@${RM} docs/pageform.txt
517	-@echo "title=\"PETSc Exercises\""                >  docs/pageform.txt
518	-@echo "access_title=Exercise Sections"              >>  docs/pageform.txt
519	-@echo "access_format=short"                        >> docs/pageform.txt
520	-@echo "startpage=../exercises/introduction.htm"  >> docs/pageform.txt
521	-@echo "NONE title=\"Introduction\" command=link src=../exercises/introduction.htm" >> docs/pageform.txt
522	-@echo "Generating HTML for individual directories"
523	-@echo "========================================="
524	-@${OMAKE} PETSC_DIR=${PETSC_DIR} ACTION=pagemaker tree
525	-@echo "Completed HTML for individual directories"
526	-@echo "NONE title=\"<HR>\" " >> docs/pageform.txt;
527	-@echo "NONE title=\"PETSc Documentation\" command=link src=../index.html target=replace" >> docs/pageform.txt
528	/home/MPI/class/mpiexmpl/maint/makepage.new -pageform=docs/pageform.txt -access_extra=/dev/null -outdir=docs/exercises
529	-@echo "========================================="
530
531.PHONY: info info_h build build_lt testexamples testfortran testexamples_uni testfortran_uni ranlib deletelibs allclean update chk_petsc_dir \
532        alletags etags etags_complete etags_noexamples etags_makefiles etags_examples etags_fexamples updatewebdocs alldoc allmanualpages \
533        allhtml allcleanhtml allfortranstubs allci allco allrcslabel alladicignore alladic alladiclib countfortranfunctions \
534        start_configure configure_petsc configure_clean
535
536