xref: /petsc/makefile (revision 30fdcc7ab1a345e9712c587aed2aa3582665d7ed)
1*30fdcc7aSBarry Smith# $Id: makefile,v 1.179 1997/08/15 16:24:04 bsmith Exp bsmith $
211b6ed10SLois Curfman McInnes#
3cfd69a58SBarry Smith# This is the makefile for installing PETSc. See the file
4cfd69a58SBarry Smith# Installation for directions on installing PETSc.
5cfd69a58SBarry Smith# See also bmake/common for additional commands.
611b6ed10SLois Curfman McInnes#
711b6ed10SLois Curfman McInnes
8ab94cc7aSSatish BalayCFLAGS	 =
961523587SBarry SmithSOURCEC	 =
1061523587SBarry SmithSOURCEF	 =
115eea60f9SBarry SmithDOCS	 = Changes Machines Readme maint/addlinks \
1243a90d84SBarry Smith	   maint/builddist FAQ Installation BugReporting\
13deb7fc1cSBarry Smith	   maint/buildlinks maint/wwwman maint/xclude maint/crontab\
14630a6785SBarry Smith	   bmake/common bmake/*/base* maint/autoftp docs/www/sec/* \
15630a6785SBarry Smith           include/finclude/generateincludes bin/petscviewinfo.text \
16630a6785SBarry Smith           bin/petscoptsinfo.text
1761523587SBarry SmithOBJSC	 =
1861523587SBarry SmithOBJSF	 =
1961523587SBarry SmithLIBBASE	 = libpetscvec
20b16a3bb1SBarry SmithDIRS	 = src include docs
2161523587SBarry Smith
224e627d3aSBarry Smithinclude $(PETSC_DIR)/bmake/$(PETSC_ARCH)/base
2361523587SBarry Smith
2411b6ed10SLois Curfman McInnes# Builds PETSc libraries for a given BOPT and architecture
257857610eSBarry Smithall: chkpetsc_dir
26511caf8eSSatish Balay	-$(RM) -f $(PDIR)/*
270b3634f8SBarry Smith	-@echo "Beginning to compile libraries in all directories"
281d91fb6eSBarry Smith	-@echo On `date` on `hostname`
29*30fdcc7aSBarry Smith	-@echo Machine characteristics: `uname -a`
3047794344SBarry Smith	-@echo "Using compiler: $(CC) $(COPTFLAGS)"
3147794344SBarry Smith	-@echo "-----------------------------------------"
32b14e8f29SBarry Smith	-@echo "Using PETSc flags: $(PETSCFLAGS) $(PCONF)"
3347794344SBarry Smith	-@echo "-----------------------------------------"
34b14e8f29SBarry Smith	-@echo "Using configuration flags: $(CONF)"
3547794344SBarry Smith	-@echo "-----------------------------------------"
36b14e8f29SBarry Smith	-@echo "Using include paths: $(PETSC_INCLUDE)"
3747794344SBarry Smith	-@echo "-----------------------------------------"
38c2c9bc36SBarry Smith	-@echo "Using PETSc directory: $(PETSC_DIR)"
39c2c9bc36SBarry Smith	-@echo "Using PETSc arch: $(PETSC_ARCH)"
4047794344SBarry Smith	-@echo "========================================="
41e35bd481SBarry Smith	-@$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) \
42f3848965SBarry Smith	   ACTION=libfast  tree
43f88f42abSSatish Balay	-@cd $(PETSC_DIR)/src/sys/src ; \
44f88f42abSSatish Balay	$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) rs6000_time
454e04c1a0SBarry Smith	$(RANLIB) $(PDIR)/*.a
460be1b381SSatish Balay	-@chmod g+w  $(PDIR)/*.a
470b3634f8SBarry Smith	-@echo "Completed building libraries"
4847794344SBarry Smith	-@echo "========================================="
490b3634f8SBarry Smith
500b3634f8SBarry Smith# Builds PETSc test examples for a given BOPT and architecture
51a9369724SSatish Balaytestexamples: chkopts
520b3634f8SBarry Smith	-@echo "Beginning to compile and run test examples"
531d91fb6eSBarry Smith	-@echo On `date` on `hostname`
5447794344SBarry Smith	-@echo "Using compiler: $(CC) $(COPTFLAGS)"
5547794344SBarry Smith	-@echo "-----------------------------------------"
56b14e8f29SBarry Smith	-@echo "Using PETSc flags: $(PETSCFLAGS) $(PCONF)"
5747794344SBarry Smith	-@echo "-----------------------------------------"
58b14e8f29SBarry Smith	-@echo "Using include paths: $(PETSC_INCLUDE)"
5947794344SBarry Smith	-@echo "-----------------------------------------"
60c2c9bc36SBarry Smith	-@echo "Using PETSc directory: $(PETSC_DIR)"
61c2c9bc36SBarry Smith	-@echo "Using PETSc arch: $(PETSC_ARCH)"
62c2c9bc36SBarry Smith	-@echo "------------------------------------------"
639c69534bSBarry Smith	-@echo "Using linker: $(CLINKER)"
649c69534bSBarry Smith	-@echo "Using libraries: $(PETSC_LIB)"
650b3634f8SBarry Smith	-@echo "------------------------------------------"
66eb817c50SBarry Smith	-@echo "Due to different numerical round-off on certain"
67eb817c50SBarry Smith	-@echo "machines some of the numbers may not match exactly."
6847794344SBarry Smith	-@echo "========================================="
690b3634f8SBarry Smith	-@$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) \
700b3634f8SBarry Smith	   ACTION=testexamples_1  tree
710b3634f8SBarry Smith	-@echo "Completed compiling and running test examples"
7247794344SBarry Smith	-@echo "========================================="
730b3634f8SBarry Smith
740b3634f8SBarry Smith# Builds PETSc test examples for a given BOPT and architecture
75a9369724SSatish Balaytestexamples_uni: chkopts
768475343bSBarry Smith	-@echo "Beginning to compile and run uniprocessor test examples"
771d91fb6eSBarry Smith	-@echo On `date` on `hostname`
7847794344SBarry Smith	-@echo "Using compiler: $(CC) $(COPTFLAGS)"
798475343bSBarry Smith	-@echo "Using linker: $(CLINKER)"
8047794344SBarry Smith	-@echo "------------------------------------------"
81b14e8f29SBarry Smith	-@echo "Using PETSc flags: $(PETSCFLAGS) $(PCONF)"
8247794344SBarry Smith	-@echo "------------------------------------------"
83b14e8f29SBarry Smith	-@echo "Using include paths: $(PETSC_INCLUDE)"
8447794344SBarry Smith	-@echo "------------------------------------------"
85d6db1478SLois Curfman McInnes	-@echo "Using PETSc directory: $(PETSC_DIR)"
86d6db1478SLois Curfman McInnes	-@echo "Using PETSc arch: $(PETSC_ARCH)"
87d6db1478SLois Curfman McInnes	-@echo "------------------------------------------"
88d6db1478SLois Curfman McInnes	-@echo "Using linker: $(CLINKER)"
898475343bSBarry Smith	-@echo "Using libraries: $(PETSC_LIB)"
908475343bSBarry Smith	-@echo "------------------------------------------"
918475343bSBarry Smith	-@echo "Due to different numerical round-off on certain"
928475343bSBarry Smith	-@echo "machines some of the numbers may not match exactly."
9347794344SBarry Smith	-@echo "========================================="
948475343bSBarry Smith	-@$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) \
958475343bSBarry Smith	   ACTION=testexamples_4  tree
968475343bSBarry Smith	-@echo "Completed compiling and running uniprocessor test examples"
9747794344SBarry Smith	-@echo "========================================="
988475343bSBarry Smith
9935ca7349SBarry Smith#
10011b6ed10SLois Curfman McInnes# Builds PETSc Fortran interface libary
10111b6ed10SLois Curfman McInnes# Note:	 libfast cannot run on .F files on certain machines, so we
10235ca7349SBarry Smith# use lib and check for errors here.
10383f0b094SBarry Smithfortran: chkpetsc_dir
104727c161cSBarry Smith	-$(RM) -f $(PDIR)/libpetscfortran.*
1050b3634f8SBarry Smith	-@echo "Beginning to compile Fortran interface library"
1061d91fb6eSBarry Smith	-@echo On `date` on `hostname`
10726de76a5SSatish Balay	-@echo "Using Fortran compiler: $(FC) $(FFLAGS) $(FOPTFLAGS)"
10847794344SBarry Smith	-@echo "Using C/C++ compiler: $(CC) $(COPTFLAGS)"
10947794344SBarry Smith	-@echo "------------------------------------------"
110fc939babSLois Curfman McInnes	-@echo "Using PETSc flags: $(PETSCFLAGS) $(PCONF)"
11147794344SBarry Smith	-@echo "------------------------------------------"
112fc939babSLois Curfman McInnes	-@echo "Using configuration flags: $(CONF)"
11347794344SBarry Smith	-@echo "------------------------------------------"
114fc939babSLois Curfman McInnes	-@echo "Using include paths: $(PETSC_INCLUDE)"
11547794344SBarry Smith	-@echo "------------------------------------------"
116d6db1478SLois Curfman McInnes	-@echo "Using PETSc directory: $(PETSC_DIR)"
117d6db1478SLois Curfman McInnes	-@echo "Using PETSc arch: $(PETSC_ARCH)"
11847794344SBarry Smith	-@echo "========================================="
119b16a3bb1SBarry Smith	-@cd src/fortran/custom; \
12035ca7349SBarry Smith	  $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) lib > trashz 2>&1; \
12135ca7349SBarry Smith	  grep -v clog trashz | grep -v "information sections" | \
12235ca7349SBarry Smith	  egrep -i '(Error|warning|Can)' >> /dev/null;\
12335ca7349SBarry Smith	  if [ "$$?" != 1 ]; then \
12435ca7349SBarry Smith	  cat trashz ; fi; $(RM) trashz
125b16a3bb1SBarry Smith	-@cd src/fortran/auto; \
12635ca7349SBarry Smith	  $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) libfast
12783f0b094SBarry Smith	$(RANLIB) $(PDIR)/libpetscfortran.a
1280be1b381SSatish Balay	-@chmod g+w  $(PDIR)/*.a
1290b3634f8SBarry Smith	-@echo "Completed compiling Fortran interface library"
13047794344SBarry Smith	-@echo "========================================="
13183f0b094SBarry Smith
132727c161cSBarry Smith# Builds PETSc test examples for a given BOPT and architecture
133a9369724SSatish Balaytestfortran: chkopts
134727c161cSBarry Smith	-@echo "Beginning to compile and run Fortran test examples"
1351d91fb6eSBarry Smith	-@echo On `date` on `hostname`
136727c161cSBarry Smith	-@echo "Using compiler: $(FC) $(FFLAGS) $(FOPTFLAGS)"
137727c161cSBarry Smith	-@echo "Using linker: $(FLINKER)"
138727c161cSBarry Smith	-@echo "Using PETSc flags: $(PETSCFLAGS) $(PCONF)"
13947794344SBarry Smith	-@echo "------------------------------------------"
140727c161cSBarry Smith	-@echo "Using PETSc directory: $(PETSC_DIR)"
141727c161cSBarry Smith	-@echo "Using PETSc arch: $(PETSC_ARCH)"
142727c161cSBarry Smith	-@echo "------------------------------------------"
143727c161cSBarry Smith	-@echo "Using linker: $(FLINKER)"
144727c161cSBarry Smith	-@echo "Using libraries: $(PETSC_FORTRAN_LIB) $(PETSC_LIB)"
14547794344SBarry Smith	-@echo "========================================="
146e4ef9893SBarry Smith	-@echo "Due to different numerical round-off on certain"
147e4ef9893SBarry Smith	-@echo "machines or the way Fortran formats numbers"
148e4ef9893SBarry Smith	-@echo "some of the results may not match exactly."
149e4ef9893SBarry Smith	-@echo "========================================="
150e4ef9893SBarry Smith	-@echo "On some machines you may get messages of the form"
151e4ef9893SBarry Smith	-@echo "PetscScalarAddressToFortran:C and Fortran arrays are"
152e4ef9893SBarry Smith	-@echo "not commonly aligned or are too far apart to be indexed"
153e4ef9893SBarry Smith	-@echo "by an integer. Locations: C xxxc Fortran xxxf"
154e4ef9893SBarry Smith	-@echo "Locations/sizeof(Scalar): C yyc Fortran yyf"
155e4ef9893SBarry Smith	-@echo "This indicates that you may not be able to use the"
156e4ef9893SBarry Smith	-@echo "PETSc routines VecGetArray() and MatGetArray() from Fortran"
157e4ef9893SBarry Smith	-@echo "========================================="
158727c161cSBarry Smith	-@$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) \
159727c161cSBarry Smith	   ACTION=testexamples_3  tree
160727c161cSBarry Smith	-@echo "Completed compiling and running Fortran test examples"
16147794344SBarry Smith	-@echo "========================================="
162727c161cSBarry Smith
163b1f85764SBarry Smith#
164b1f85764SBarry Smith# Builds PETSc Fortran90 interface libary
165b1f85764SBarry Smith# Note:	 libfast cannot run on .F files on certain machines, so we
166b1f85764SBarry Smith# use lib and check for errors here.
167b1f85764SBarry Smith# Note: F90 interface currently only supported in NAG F90 compiler
168d7f8d646SSatish Balayfortran90: chkpetsc_dir fortran
169b1f85764SBarry Smith	-@echo "Beginning to compile Fortran90 interface library"
1701d91fb6eSBarry Smith	-@echo On `date` on `hostname`
171b1f85764SBarry Smith	-@echo "Using Fortran compiler: $(FC) $(FFLAGS) $(FOPTFLAGS)"
172b1f85764SBarry Smith	-@echo "Using C/C++ compiler: $(CC) $(COPTFLAGS)"
173b1f85764SBarry Smith	-@echo "------------------------------------------"
174b1f85764SBarry Smith	-@echo "Using PETSc flags: $(PETSCFLAGS) $(PCONF)"
175b1f85764SBarry Smith	-@echo "------------------------------------------"
176b1f85764SBarry Smith	-@echo "Using configuration flags: $(CONF)"
177b1f85764SBarry Smith	-@echo "------------------------------------------"
178b1f85764SBarry Smith	-@echo "Using include paths: $(PETSC_INCLUDE)"
179b1f85764SBarry Smith	-@echo "------------------------------------------"
180b1f85764SBarry Smith	-@echo "Using PETSc directory: $(PETSC_DIR)"
181b1f85764SBarry Smith	-@echo "Using PETSc arch: $(PETSC_ARCH)"
182b1f85764SBarry Smith	-@echo "========================================="
183b1f85764SBarry Smith	-@cd src/fortran/f90; \
184b1f85764SBarry Smith	  $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) lib > trashz 2>&1; \
185b1f85764SBarry Smith	  grep -v clog trashz | grep -v "information sections" | \
186b1f85764SBarry Smith	  egrep -i '(Error|warning|Can)' >> /dev/null;\
187b1f85764SBarry Smith	  if [ "$$?" != 1 ]; then \
188b1f85764SBarry Smith	  cat trashz ; fi; $(RM) trashz
189b1f85764SBarry Smith	$(RANLIB) $(PDIR)/libpetscfortran.a
1900be1b381SSatish Balay	-@chmod g+w  $(PDIR)/*.a
191b1f85764SBarry Smith	-@echo "Completed compiling Fortran90 interface library"
192b1f85764SBarry Smith	-@echo "========================================="
193b1f85764SBarry Smith
194ad96cc0dSLois Curfman McInnes# Builds noise routines (not yet publically available)
195ad96cc0dSLois Curfman McInnes# Note:	 libfast cannot run on .F files on certain machines, so we
196ad96cc0dSLois Curfman McInnes# use lib and check for errors here.
197ad96cc0dSLois Curfman McInnesnoise: chkpetsc_dir
198ad96cc0dSLois Curfman McInnes	-@echo "Beginning to compile noise routines"
199ad96cc0dSLois Curfman McInnes	-@echo "Using Fortran compiler: $(FC) $(FFLAGS) $(FOPTFLAGS)"
200ad96cc0dSLois Curfman McInnes	-@echo "Using C/C++ compiler: $(CC) $(COPTFLAGS)"
201ad96cc0dSLois Curfman McInnes	-@echo "------------------------------------------"
202ad96cc0dSLois Curfman McInnes	-@echo "Using PETSc flags: $(PETSCFLAGS) $(PCONF)"
203ad96cc0dSLois Curfman McInnes	-@echo "------------------------------------------"
204ad96cc0dSLois Curfman McInnes	-@echo "Using configuration flags: $(CONF)"
205ad96cc0dSLois Curfman McInnes	-@echo "------------------------------------------"
206ad96cc0dSLois Curfman McInnes	-@echo "Using include paths: $(PETSC_INCLUDE)"
207ad96cc0dSLois Curfman McInnes	-@echo "------------------------------------------"
208ad96cc0dSLois Curfman McInnes	-@echo "Using PETSc directory: $(PETSC_DIR)"
209ad96cc0dSLois Curfman McInnes	-@echo "Using PETSc arch: $(PETSC_ARCH)"
210ad96cc0dSLois Curfman McInnes	-@echo "========================================="
211ad96cc0dSLois Curfman McInnes	-@cd src/snes/interface/noise; \
212ad96cc0dSLois Curfman McInnes	  $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) lib > trashz 2>&1; \
213ad96cc0dSLois Curfman McInnes	  grep -v clog trashz | grep -v "information sections" | \
214ad96cc0dSLois Curfman McInnes	  egrep -i '(Error|warning|Can)' >> /dev/null;\
215ad96cc0dSLois Curfman McInnes	  if [ "$$?" != 1 ]; then \
216ad96cc0dSLois Curfman McInnes	  cat trashz ; fi; $(RM) trashz
217ad96cc0dSLois Curfman McInnes	$(RANLIB) $(PDIR)/libpetscsnes.a
218ad96cc0dSLois Curfman McInnes	-@chmod g+w  $(PDIR)/libpetscsnes.a
219ad96cc0dSLois Curfman McInnes	-@echo "Completed compiling noise routines"
220ad96cc0dSLois Curfman McInnes	-@echo "========================================="
221ad96cc0dSLois Curfman McInnes
222ad96cc0dSLois Curfman McInnes
2238c37ef55SBarry Smithranlib:
2244e04c1a0SBarry Smith	$(RANLIB) $(PDIR)/*.a
22561523587SBarry Smith
22611b6ed10SLois Curfman McInnes# Deletes PETSc libraries
22761523587SBarry Smithdeletelibs:
2284e04c1a0SBarry Smith	-$(RM) -f $(PDIR)/*.a $(PDIR)/complex/* $(PDIR)/c++/*
229d44968ceSBarry Smith
23011b6ed10SLois Curfman McInnes# Deletes man pages (HTML version)
231b346654fSBarry Smithdeletewwwpages:
232dea827f2SLois Curfman McInnes	$(RM) -f $(PETSC_DIR)/docs/www/man*/* $(PETSC_DIR)/docs/www/www.cit \
233dea827f2SLois Curfman McInnes	         $(PETSC_DIR)/docs/www/man*.html
234b346654fSBarry Smith
23511b6ed10SLois Curfman McInnes# Deletes man pages (LaTeX version)
236b346654fSBarry Smithdeletelatexpages:
2377857610eSBarry Smith	$(RM) -f $(PETSC_DIR)/docs/tex/rsum/*sum*.tex
23820563c6bSBarry Smith
2397acb7333SLois Curfman McInnes# To access the tags in emacs, type M-x visit-tags-table and specify
2407acb7333SLois Curfman McInnes# the file petsc/TAGS.	Then, to move to where a PETSc function is
2417acb7333SLois Curfman McInnes# defined, enter M-. and the function name.  To search for a string
2427acb7333SLois Curfman McInnes# and move to the first occurrence, use M-x tags-search and the string.
2437acb7333SLois Curfman McInnes# To locate later occurrences, use M-,
2447acb7333SLois Curfman McInnes
245b38bb785SSatish BalayTAGS_INCLUDE_FILES  = include/*.h include/pinclude/*.h include/FINCLUDE/*.h
246b38bb785SSatish BalayTAGS_BMAKE_FILES    = bmake/common bmake/*/base*
247b38bb785SSatish BalayTAGS_EXAMPLE_FILES  = src/*/examples/*/*.[c,h,F,f] src/*/examples/*/*/*.[c,h,F,f] \
248b38bb785SSatish Balay                      src/benchmarks/*.c src/contrib/*/examples/*/*.[c,h,F,f]
249b38bb785SSatish BalayTAGS_DOC_FILES      = docs/tex/manual/routin.tex docs/tex/manual/manual.tex \
250b38bb785SSatish Balay                      docs/tex/manual/manual_tex.tex docs/tex/manual/intro.tex \
251b38bb785SSatish Balay                      docs/tex/manual/part1.tex docs/tex/manual/part2.tex
2524431cf12SSatish BalayTAGS_SRC_FILES      = src/*/*.[c,h] src/*/interface/*.[c,h] src/*/src/*.[c,h] \
253b38bb785SSatish Balay                      src/*/utils/*.[c,h] \
254b38bb785SSatish Balay                      src/*/impls/*.[c,h] src/*/impls/*/*.[c,h] src/*/impls/*/*/*.[c,h] \
255b334301eSBarry Smith                      src/gvec/impls/*/*/*/*/*.[c,h] src/contrib/*/*.[c,h] \
256b334301eSBarry Smith                      src/contrib/*/src/*.[c,h] src/fortran/custom/*.[c,h,F]
257b38bb785SSatish BalayTAGS_MAKEFILE_FILES = include/makefile include/*/makefile \
258b38bb785SSatish Balay                      makefile \
259b38bb785SSatish Balay                      src/makefile src/*/makefile src/*/src/makefile \
260b38bb785SSatish Balay                      src/*/interface/makefile \
261b38bb785SSatish Balay                      src/*/utils/makefile \
262b38bb785SSatish Balay                      src/*/impls/makefile src/*/impls/*/makefile src/*/impls/*/*/makefile \
263b38bb785SSatish Balay                      src/*/examples/makefile src/*/examples/*/makefile src/*/examples/*/*/makefile \
264b38bb785SSatish Balay                      src/gvec/impls/*/*/*/*/makefile src/gvec/impls/*/*/*/makefile \
265b38bb785SSatish Balay                      src/fortran/*/makefile \
266b38bb785SSatish Balay                      src/contrib/*/makefile src/contrib/*/src/makefile \
267b38bb785SSatish Balay                      src/contrib/*/examples/makefile src/contrib/*/examples/*/makefile \
268b38bb785SSatish Balay                      docs/makefile
269b38bb785SSatish Balay
27011b6ed10SLois Curfman McInnes# Builds all etags files
27111b6ed10SLois Curfman McInnesalletags:
2729ae7ee0fSLois Curfman McInnes	-make etags_complete
27311b6ed10SLois Curfman McInnes	-make etags
27411b6ed10SLois Curfman McInnes	-make etags_noexamples
27511b6ed10SLois Curfman McInnes	-make etags_makefiles
27611b6ed10SLois Curfman McInnes
27711b6ed10SLois Curfman McInnes# Builds the basic etags file.	This should be employed by most users.
27820563c6bSBarry Smithetags:
279edd2f0e1SBarry Smith	$(RM) TAGS
280b38bb785SSatish Balay	etags -f TAGS $(TAGS_INCLUDE_FILES)
281b38bb785SSatish Balay	etags -a -f TAGS $(TAGS_SRC_FILES)
282b38bb785SSatish Balay	etags -a -f TAGS $(TAGS_EXAMPLE_FILES)
283b38bb785SSatish Balay	etags -a -f TAGS $(TAGS_MAKEFILE_FILES)
284b38bb785SSatish Balay	etags -a -f TAGS $(TAGS_BMAKE_FILES)
28528988994SBarry Smith	chmod g+w TAGS
286bfce26a3SBarry Smith
28729cdf679SBarry Smith# Builds complete etags list; only for PETSc developers.
28829cdf679SBarry Smithetags_complete:
28929cdf679SBarry Smith	$(RM) TAGS_COMPLETE
2909ca56a1bSSatish Balay	etags -f TAGS_COMPLETE $(TAGS_SRC_FILES)
2919ca56a1bSSatish Balay	etags -a -f TAGS_COMPLETE $(TAGS_INCLUDE_FILES)
292b38bb785SSatish Balay	etags -a -f TAGS_COMPLETE $(TAGS_EXAMPLE_FILES)
293b38bb785SSatish Balay	etags -a -f TAGS_COMPLETE $(TAGS_MAKEFILE_FILES)
294b38bb785SSatish Balay	etags -a -f TAGS_COMPLETE $(TAGS_BMAKE_FILES)
295b38bb785SSatish Balay	etags -a -f TAGS_COMPLETE $(TAGS_DOC_FILES)
29629cdf679SBarry Smith	chmod g+w TAGS_COMPLETE
29729cdf679SBarry Smith
29811b6ed10SLois Curfman McInnes# Builds the etags file that excludes the examples directories
299bfce26a3SBarry Smithetags_noexamples:
300bfce26a3SBarry Smith	$(RM) TAGS_NO_EXAMPLES
3019ca56a1bSSatish Balay	etags -f TAGS_NO_EXAMPLES $(TAGS_SRC_FILES)
3029ca56a1bSSatish Balay	etags -a -f TAGS_NO_EXAMPLES $(TAGS_INCLUDE_FILES)
303b38bb785SSatish Balay	etags -a -f TAGS_NO_EXAMPLES $(TAGS_MAKEFILE_FILES)
304b38bb785SSatish Balay	etags -a -f TAGS_NO_EXAMPLES $(TAGS_BMAKE_FILES)
305b38bb785SSatish Balay	etags -a -f TAGS_NO_EXAMPLES $(TAGS_DOC_FILES)
306bfce26a3SBarry Smith	chmod g+w TAGS_NO_EXAMPLES
307b16a3bb1SBarry Smith
30811b6ed10SLois Curfman McInnes# Builds the etags file for makefiles
309b16a3bb1SBarry Smithetags_makefiles:
310b16a3bb1SBarry Smith	$(RM) TAGS_MAKEFILES
311b38bb785SSatish Balay	etags -f TAGS_MAKEFILES $(TAGS_MAKEFILE_FILES)
312b38bb785SSatish Balay	etags -a -f TAGS_MAKEFILES $(TAGS_BMAKE_FILES)
313b16a3bb1SBarry Smith	chmod g+w TAGS_MAKEFILES
31411b6ed10SLois Curfman McInnes
315b38bb785SSatish Balay#
316b38bb785SSatish Balay# ctags builds the tags file required for VI.
317b38bb785SSatish Balay# To use the tags file do the following:
318b38bb785SSatish Balay# 1. within vi invole the command - :set tags=/home/bsmith/petsc/tags
319b38bb785SSatish Balay#    or add  the command to your ~/.exrc file - set tags=/home/bsmith/petsc/tags
320b38bb785SSatish Balay# 2. now to go to a tag do - :tag TAGNAME for eg - :tag MatCreate
321b38bb785SSatish Balay#
322b38bb785SSatish Balayctags:
323b38bb785SSatish Balay	$(RM) tags
324b8319b70SSatish Balay	ctags -w -f tags $(TAGS_INCLUDE_FILES)
325b8319b70SSatish Balay	ctags -w -a -f tags $(TAGS_SRC_FILES)
326b38bb785SSatish Balay	ctags -w -a -f tags $(TAGS_EXAMPLE_FILES)
327b38bb785SSatish Balay	ctags -w -a -f tags $(TAGS_MAKEFILE_FILES)
328b38bb785SSatish Balay	ctags -w -a -f tags $(TAGS_BMAKE_FILES)
329b38bb785SSatish Balay	chmod g+w tags
330b38bb785SSatish Balay
33111b6ed10SLois Curfman McInnes# ------------------------------------------------------------------
33211b6ed10SLois Curfman McInnes#
33311b6ed10SLois Curfman McInnes# All remaining actions are intended for PETSc developers only.
33411b6ed10SLois Curfman McInnes# PETSc users should not generally need to use these commands.
33511b6ed10SLois Curfman McInnes#
33611b6ed10SLois Curfman McInnes
33711b6ed10SLois Curfman McInnes# Builds all versions of the man pages
338956e605aSBarry Smithallmanpages: allwwwpages alllatexpages
339dea827f2SLois Curfman McInnesallwwwpages: deletewwwpages
340299192b9SLois Curfman McInnes	-make ACTION=wwwpages_buildcite tree
341c3e30b67SBarry Smith	-cd src/fortran/custom; make wwwpages_buildcite
342c3e30b67SBarry Smith	-cd src/fortran/custom; make wwwpages
343dea827f2SLois Curfman McInnes	-make ACTION=wwwpages tree
344dea827f2SLois Curfman McInnes	-maint/wwwman
3459921e35aSSatish Balay	-maint/examplesindex.tcl -www
346f8cfbf3fSSatish Balay	-maint/htmlkeywords.tcl
34751c61065SBarry Smith	-@chmod g+w docs/www/man*/*
348e01137a2SSatish Balay
349e01137a2SSatish Balay#This is similar to allwwwpages except -www -> -wwwhome
350e01137a2SSatish Balay#The wwwmanpages built this way can pe placed at PETSc Home Page
351e01137a2SSatish Balayallwwwhomepages: deletewwwpages
352e01137a2SSatish Balay	-make ACTION=wwwpages_buildcite tree
353e01137a2SSatish Balay	-cd src/fortran/custom; make wwwpages_buildcite
354e01137a2SSatish Balay	-cd src/fortran/custom; make wwwpages
355e01137a2SSatish Balay	-make ACTION=wwwpages tree
356e01137a2SSatish Balay	-maint/wwwman
357e01137a2SSatish Balay	-maint/examplesindex.tcl -wwwhome
35884047b72SSatish Balay	-maint/htmlkeywords.tcl -wwwhome
359e01137a2SSatish Balay	-@chmod g+w docs/www/man*/*
360e01137a2SSatish Balay
361416022c9SBarry Smithalllatexpages: deletelatexpages
362416022c9SBarry Smith	-make ACTION=latexpages tree
363c3e30b67SBarry Smith	-cd src/fortran/custom; make latexpages
36451c61065SBarry Smith	-@chmod g+w docs/tex/rsum/*
365416022c9SBarry Smith
36611b6ed10SLois Curfman McInnes# Builds Fortran stub files
36711b6ed10SLois Curfman McInnesallfortranstubs:
36835aab85fSBarry Smith	-@include/finclude/generateincludes
3690a0eb2c5SBarry Smith	-@$(RM) -f src/fortran/auto/*.c
37011b6ed10SLois Curfman McInnes	-make ACTION=fortranstubs tree
3710a0eb2c5SBarry Smith	chmod g+w src/fortran/auto/*.c
372f6ff2982SSatish Balay
373d55938c2SBarry Smithallci:
374d55938c2SBarry Smith	-@cd src/fortran/custom ; $(OMAKE) BOPT=$(BOPT) ci
375b951964fSBarry Smith	-@$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) ACTION=ci  tree
376b951964fSBarry Smith
377d55938c2SBarry Smithallco:
378d55938c2SBarry Smith	-@cd src/fortran/custom ; $(OMAKE) BOPT=$(BOPT) co
379d55938c2SBarry Smith	-@$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) ACTION=co  tree
380d55938c2SBarry Smith
381b334301eSBarry Smith#
382b334301eSBarry Smith#   The commands below are for generating ADIC versions of the code;
383b334301eSBarry Smith# they are not currently used.
384b334301eSBarry Smith#
385b334301eSBarry SmithCFLAGS   =  $(CPPFLAGS) $(CONF)
3865eea60f9SBarry Smithalladicignore:
3875eea60f9SBarry Smith	-@$(RM) $(PDIR)/adicignore
3885eea60f9SBarry Smith	-@$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) ACTION=adicignore  tree
3895eea60f9SBarry Smith
3905eea60f9SBarry Smithalladic:
391d18b0ea7SBarry Smith	-@echo "Beginning to compile ADIC source code in all directories"
392d18b0ea7SBarry Smith	-@echo "Using ADIC compiler: $(ADIC_CC) $(CFLAGS)"
393d18b0ea7SBarry Smith	-@echo "========================================="
39447794344SBarry Smith	-@cd include ; \
395f218b1c0SBarry Smith           $(ADIC_CC) -s -f 1 $(CFLAGS) petsc.h
396ba8edd79SBarry Smith	-@$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) ACTION=adic  tree
39747794344SBarry Smith	-@cd src/inline ; \
39847794344SBarry Smith            $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) adic
3997e351921SBarry Smith	-@cd src/adic/blas ; \
4007e351921SBarry Smith            $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) adic
4017e351921SBarry Smith	-@cd src/adic/lapack ; \
402e1063516SSatish Balay            $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) ACTION=adic  tree
4036e81b665SBarry Smith
40447794344SBarry Smithalladiclib:
405d18b0ea7SBarry Smith	-@echo "Beginning to compile ADIC libraries in all directories"
406d18b0ea7SBarry Smith	-@echo "Using compiler: $(CC) $(COPTFLAGS)"
407d18b0ea7SBarry Smith	-@echo "-----------------------------------------"
408d18b0ea7SBarry Smith	-@echo "Using PETSc flags: $(PETSCFLAGS) $(PCONF)"
409d18b0ea7SBarry Smith	-@echo "-----------------------------------------"
410d18b0ea7SBarry Smith	-@echo "Using configuration flags: $(CONF)"
411d18b0ea7SBarry Smith	-@echo "-----------------------------------------"
412d18b0ea7SBarry Smith	-@echo "Using include paths: $(PETSC_INCLUDE)"
413d18b0ea7SBarry Smith	-@echo "-----------------------------------------"
414d18b0ea7SBarry Smith	-@echo "Using PETSc directory: $(PETSC_DIR)"
415d18b0ea7SBarry Smith	-@echo "Using PETSc arch: $(PETSC_ARCH)"
416d18b0ea7SBarry Smith	-@echo "========================================="
417f218b1c0SBarry Smith	-@$(RM) -f  $(PDIR)/*adic.a
41847794344SBarry Smith	-@$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) ACTION=adiclib  tree
4197e351921SBarry Smith	-@cd src/adic/blas ; \
4207e351921SBarry Smith            $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) adiclib
4217e351921SBarry Smith	-@cd src/adic/lapack ; \
422e1063516SSatish Balay            $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) ACTION=adiclib  tree
4237e351921SBarry Smith	-@cd src/adic/src ; \
424cb3b3f49SBarry Smith            $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) lib
4255eea60f9SBarry Smith
4269e417c50SSatish Balay# -------------------------------------------------------------------------------
4279e417c50SSatish Balay#
4289e417c50SSatish Balay# Some macros to check if the fortran interface is up-to-date.
4299e417c50SSatish Balay#
4309e417c50SSatish Balaycountfortranfunctions:
4319e417c50SSatish Balay	-@cd $(PETSC_DIR)/src/fortran; egrep '^void' custom/*.c auto/*.c | \
4329e417c50SSatish Balay	cut -d'(' -f1 | tr -s '' ' ' | cut -d' ' -f2 | uniq | egrep -v "(^$$|Petsc)" | \
4339e417c50SSatish Balay	sed "s/_$$//" | sort > /tmp/countfortranfunctions
434b334301eSBarry Smith
4359e417c50SSatish Balaycountcfunctions:
4369e417c50SSatish Balay	-@ grep extern $(PETSC_DIR)/include/*.h *.h | grep "(" | tr -s '' ' ' | \
4379e417c50SSatish Balay	cut -d'(' -f1 | cut -d' ' -f3 | grep -v "\*" | tr -s '' '\012' |  \
4389e417c50SSatish Balay	tr 'A-Z' 'a-z' |  sort > /tmp/countcfunctions
4399e417c50SSatish Balay
4409e417c50SSatish Balaydifffortranfunctions: countfortranfunctions countcfunctions
4419e417c50SSatish Balay	-@echo -------------- Functions missing in the fortran interface ---------------------
4429e417c50SSatish Balay	-@diff /tmp/countcfunctions /tmp/countfortranfunctions | grep "^<" | cut -d' ' -f2
4439e417c50SSatish Balay	-@echo ----------------- Functions missing in the C interface ------------------------
4449e417c50SSatish Balay	-@diff /tmp/countcfunctions /tmp/countfortranfunctions | grep "^>" | cut -d' ' -f2
4459e417c50SSatish Balay	-@$(RM)  /tmp/countcfunctions /tmp/countfortranfunctions
446b334301eSBarry Smith
4473f4c9a3aSSatish Balaycheckbadfortranstubs:
4483f4c9a3aSSatish Balay	-@echo "========================================="
4493f4c9a3aSSatish Balay	-@echo "Functions with MPI_Comm as an Argument"
4503f4c9a3aSSatish Balay	-@echo "========================================="
4513f4c9a3aSSatish Balay	-@cd $(PETSC_DIR)/src/fortran/auto; grep '^void' *.c | grep 'MPI_Comm' | \
4523f4c9a3aSSatish Balay	tr -s '' ' ' | tr -s ':' ' ' |cut -d'(' -f1 | cut -d' ' -f1,3
4533f4c9a3aSSatish Balay	-@echo "========================================="
4543f4c9a3aSSatish Balay	-@echo "Functions with a String as an Argument"
4553f4c9a3aSSatish Balay	-@echo "========================================="
4563f4c9a3aSSatish Balay	-@cd $(PETSC_DIR)/src/fortran/auto; grep '^void' *.c | grep 'char \*' | \
4573f4c9a3aSSatish Balay	tr -s '' ' ' | tr -s ':' ' ' |cut -d'(' -f1 | cut -d' ' -f1,3
4583f4c9a3aSSatish Balay	-@echo "========================================="
4593f4c9a3aSSatish Balay	-@echo "Functions with Pointers to PETSc Objects as Argument"
4603f4c9a3aSSatish Balay	-@echo "========================================="
4613f4c9a3aSSatish Balay	-@cd $(PETSC_DIR)/src/fortran/auto; \
4623f4c9a3aSSatish Balay	_p_OBJ=`grep _p_ $(PETSC_DIR)/include/*.h | tr -s '' ' ' | \
4633f4c9a3aSSatish Balay	cut -d' ' -f 3 | tr -s '' '\012' | grep -v '{' | cut -d'*' -f1 | \
4643f4c9a3aSSatish Balay	sed "s/_p_//g" | tr -s '\012 ' ' *|' ` ; \
4653f4c9a3aSSatish Balay	for OBJ in $$_p_OBJ; do \
4663f4c9a3aSSatish Balay	grep "$$OBJ \*" *.c | tr -s '' ' ' | tr -s ':' ' ' | \
4673f4c9a3aSSatish Balay	cut -d'(' -f1 | cut -d' ' -f1,3; \
4683f4c9a3aSSatish Balay	done
469