1# 2# This makefile contains some basic commands for building PETSc. 3# See bmake/common for additional commands. 4# 5 6PETSC_DIR = . 7 8CFLAGS = -I$(PETSC_DIR)/include -I.. -I$(PETSC_DIR) $(CONF) $(PCONF) 9SOURCEC = 10SOURCEF = 11SOURCEH = Changes Machines Readme maint/addlinks maint/buildtest \ 12 maint/builddist FAQ Installation Performance BugReporting\ 13 maint/buildlinks maint/wwwman maint/xclude maint/crontab\ 14 bmake/common bmake/*/* maint/autoftp 15OBJSC = 16OBJSF = 17LIBBASE = libpetscvec 18DIRS = src include docs 19 20include $(PETSC_DIR)/bmake/$(PETSC_ARCH)/$(PETSC_ARCH) 21 22# Builds PETSc libraries for a given BOPT and architecture 23all: chkpetsc_dir 24 -$(RM) -f $(PDIR)/*.a 25 -@echo "Beginning to compile libraries in all directories" 26 -@echo "Using $(CC) $(PETSC_INCLUDE) $(CONF) $(PCONF) $(BASEOPT)" 27 -@echo "------------------------------------------" 28 -@$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) \ 29 ACTION=libfast tree 30 $(RANLIB) $(PDIR)/*.a 31 -@echo "Completed building libraries" 32 -@echo "------------------------------------------" 33 34# Builds PETSc test examples for a given BOPT and architecture 35testexamples: chkpetsc_dir 36 -@echo "Beginning to compile and run test examples" 37 -@echo "Using compiler: $(CC) $(PETSC_INCLUDE) $(PCONF) $(BASEOPT)" 38 -@echo "Using linker: $(CLINKER)" 39 -@echo "Using libraries: $(PETSC_LIB)" 40 -@echo "------------------------------------------" 41 -@echo "Due to different numerical round-off on " 42 -@echo "certain machines some of the numbers may not " 43 -@echo "match exactly." 44 -@echo "------------------------------------------" 45 -@$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) \ 46 ACTION=testexamples_1 tree 47 -@echo "Completed compiling and running test examples" 48 -@echo "------------------------------------------" 49 50# Builds PETSc test examples for a given BOPT and architecture 51testfortran: chkpetsc_dir 52 -@echo "Beginning to compile and run Fortran test examples" 53 -@echo "Using compiler: $(FC) $(BASEOPTF)" 54 -@echo "Using linker: $(FLINKER)" 55 -@echo "Using libraries: $(PETSC_FORTRAN_LIB) $(PETSC_LIB)" 56 -@echo "------------------------------------------" 57 -@$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) \ 58 ACTION=testexamples_3 tree 59 -@echo "Completed compiling and running Fortran test examples" 60 -@echo "------------------------------------------" 61 62# 63# Builds PETSc Fortran interface libary 64# Note: libfast cannot run on .F files on certain machines, so we 65# use lib and check for errors here. 66fortran: chkpetsc_dir 67 -$(RM) -f $(PDIR)/libpetscfortran.a 68 -@echo "Beginning to compile Fortran interface library" 69 -@echo "------------------------------------------" 70 -@cd src/fortran/custom; \ 71 $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) lib > trashz 2>&1; \ 72 grep -v clog trashz | grep -v "information sections" | \ 73 egrep -i '(Error|warning|Can)' >> /dev/null;\ 74 if [ "$$?" != 1 ]; then \ 75 cat trashz ; fi; $(RM) trashz 76 -@cd src/fortran/auto; \ 77 $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) libfast 78 $(RANLIB) $(PDIR)/libpetscfortran.a 79 -@echo "Completed compiling Fortran interface library" 80 -@echo "------------------------------------------" 81 82ranlib: 83 $(RANLIB) $(PDIR)/*.a 84 85# Deletes PETSc libraries 86deletelibs: 87 -$(RM) -f $(PDIR)/*.a $(PDIR)/complex/* $(PDIR)/c++/* 88 89# Deletes man pages (xman version) 90deletemanpages: 91 $(RM) -f $(PETSC_DIR)/Keywords $(PETSC_DIR)/docs/man/man*/* 92 93# Deletes man pages (HTML version) 94deletewwwpages: 95 $(RM) -f $(PETSC_DIR)/docs/www/man*/* $(PETSC_DIR)/docs/www/www.cit 96 97# Deletes man pages (LaTeX version) 98deletelatexpages: 99 $(RM) -f $(PETSC_DIR)/docs/tex/rsum/*sum*.tex 100 101# To access the tags in emacs, type M-x visit-tags-table and specify 102# the file petsc/TAGS. Then, to move to where a PETSc function is 103# defined, enter M-. and the function name. To search for a string 104# and move to the first occurrence, use M-x tags-search and the string. 105# To locate later occurrences, use M-, 106 107# Builds all etags files 108alletags: 109 -make etags 110 -make etags_noexamples 111 -make etags_makefiles 112 113# Builds the basic etags file. This should be employed by most users. 114etags: 115 $(RM) TAGS 116 etags -f TAGS src/*/impls/*/*.h src/*/impls/*/*/*.h 117 etags -a -f TAGS src/*/examples/*.c src/*/examples/*/*.c 118 etags -a -f TAGS src/*/*.h src/*/*/*.h src/*/interface/*.c 119 etags -a -f TAGS src/*/src/*.c src/*/impls/*/*.c 120 etags -a -f TAGS src/*/impls/*/*/*.c 121 etags -a -f TAGS include/*.h include/*include/*.h bmake/common 122 etags -a -f TAGS src/*/impls/*.c src/*/utils/*.c 123 etags -a -f TAGS makefile src/*/src/makefile 124 etags -a -f TAGS src/*/interface/makefile src/makefile 125 etags -a -f TAGS src/*/impls/makefile src/*/impls/*/makefile 126 etags -a -f TAGS src/*/utils/makefile src/*/examples/makefile 127 etags -a -f TAGS src/*/examples/*/makefile 128 etags -a -f TAGS src/*/makefile src/*/impls/*/*/makefile 129 etags -a -f TAGS src/fortran/makefile src/fortran/auto/makefile 130 etags -a -f TAGS src/fortran/custom/makefile 131 etags -a -f TAGS include/makefile include/*/makefile docs/makefile 132 etags -a -f TAGS bmake/common bmake/sun4/sun4* bmake/rs6000/rs6000* 133 etags -a -f TAGS bmake/solaris/solaris* 134 etags -a -f TAGS bmake/IRIX/IRIX* bmake/freebsd/freebsd* 135 etags -a -f TAGS bmake/hpux/hpux* bmake/alpha/alpha* 136 etags -a -f TAGS bmake/t3d/t3d* bmake/paragon/paragon* 137 etags -a -f TAGS docs/tex/routin.tex docs/tex/manual.tex docs/tex/manual_tex.tex 138 etags -a -f TAGS docs/tex/intro.tex docs/tex/part1.tex docs/tex/part2.tex 139 etags -a -f TAGS src/fortran/custom/*.c src/fortran/auto/*.c 140 etags -a -f TAGS src/*/examples/*.F src/fortran/custom/*.F 141 chmod g+w TAGS 142 143# Builds the etags file that excludes the examples directories 144etags_noexamples: 145 $(RM) TAGS_NO_EXAMPLES 146 etags -f TAGS_NO_EXAMPLES src/*/impls/*/*.h src/*/impls/*/*/*.h 147 etags -a -f TAGS_NO_EXAMPLES src/*/*.h src/*/*/*.h src/*/interface/*.c 148 etags -a -f TAGS_NO_EXAMPLES src/*/src/*.c src/*/impls/*/*.c 149 etags -a -f TAGS_NO_EXAMPLES src/*/impls/*/*/*.c 150 etags -a -f TAGS_NO_EXAMPLES include/*.h include/*include/*.h 151 etags -a -f TAGS_NO_EXAMPLES bmake/common 152 etags -a -f TAGS_NO_EXAMPLES src/*/impls/*.c src/*/utils/*.c 153 etags -a -f TAGS_NO_EXAMPLES makefile src/*/src/makefile 154 etags -a -f TAGS_NO_EXAMPLES src/*/interface/makefile src/makefile 155 etags -a -f TAGS_NO_EXAMPLES src/*/impls/makefile src/*/impls/*/makefile 156 etags -a -f TAGS_NO_EXAMPLES src/*/utils/makefile 157 etags -a -f TAGS_NO_EXAMPLES src/*/makefile src/*/impls/*/*/makefile 158 etags -a -f TAGS_NO_EXAMPLES src/fortran/makefile src/fortran/auto/makefile 159 etags -a -f TAGS_NO_EXAMPLES src/fortran/custom/makefile 160 etags -a -f TAGS_NO_EXAMPLES include/makefile include/*/makefile docs/makefile 161 etags -a -f TAGS_NO_EXAMPLES bmake/common bmake/sun4/sun4* 162 etags -a -f TAGS_NO_EXAMPLES bmake/rs6000/rs6000* 163 etags -a -f TAGS_NO_EXAMPLES bmake/solaris/solaris* 164 etags -a -f TAGS_NO_EXAMPLES bmake/IRIX/IRIX* bmake/freebsd/freebsd* 165 etags -a -f TAGS_NO_EXAMPLES bmake/hpux/hpux* bmake/alpha/alpha* 166 etags -a -f TAGS_NO_EXAMPLES bmake/t3d/t3d* bmake/paragon/paragon* 167 etags -a -f TAGS_NO_EXAMPLES docs/tex/routin.tex docs/tex/manual.tex 168 etags -a -f TAGS_NO_EXAMPLES docs/tex/intro.tex docs/tex/part1.tex 169 etags -a -f TAGS_NO_EXAMPLES src/fortran/auto/*.c 170 etags -a -f TAGS_NO_EXAMPLES src/fortran/custom/*.c src/fortran/custom/*.F 171 chmod g+w TAGS_NO_EXAMPLES 172 173# Builds the etags file for makefiles 174etags_makefiles: 175 $(RM) TAGS_MAKEFILES 176 etags -a -f TAGS_MAKEFILES bmake/common 177 etags -a -f TAGS_MAKEFILES makefile src/*/src/makefile 178 etags -a -f TAGS_MAKEFILES src/*/interface/makefile src/makefile 179 etags -a -f TAGS_MAKEFILES src/*/impls/makefile src/*/impls/*/makefile 180 etags -a -f TAGS_MAKEFILES src/*/utils/makefile src/*/interface/makefile 181 etags -a -f TAGS_MAKEFILES src/*/makefile src/*/impls/*/*/makefile 182 etags -a -f TAGS_MAKEFILES src/*/examples/makefile src/*/examples/*/makefile 183 etags -a -f TAGS_MAKEFILES src/fortran/makefile src/fortran/auto/makefile 184 etags -a -f TAGS_MAKEFILES src/fortran/custom/makefile 185 etags -a -f TAGS_MAKEFILES include/makefile include/*/makefile docs/makefile 186 etags -a -f TAGS_MAKEFILES bmake/common bmake/sun4/sun4* 187 etags -a -f TAGS_MAKEFILES bmake/rs6000/rs6000* 188 etags -a -f TAGS_MAKEFILES bmake/solaris/solaris* 189 etags -a -f TAGS_MAKEFILES bmake/IRIX/IRIX* bmake/freebsd/freebsd* 190 etags -a -f TAGS_MAKEFILES bmake/hpux/hpux* bmake/alpha/alpha* 191 etags -a -f TAGS_MAKEFILES bmake/t3d/t3d* bmake/paragon/paragon* 192 chmod g+w TAGS_MAKEFILES 193 194# ------------------------------------------------------------------ 195# 196# All remaining actions are intended for PETSc developers only. 197# PETSc users should not generally need to use these commands. 198# 199 200# Builds all versions of the man pages 201allmanpages: deletemanpages deletewwwpages deletelatexpages 202 -make ACTION=manpages tree 203 -make ACTION=wwwpages tree 204 -make ACTION=latexpages tree 205 -maint/wwwman 206 207alllatexpages: deletelatexpages 208 -make ACTION=latexpages tree 209 210# Builds Fortran stub files 211allfortranstubs: 212 -@$(RM) -f $(PETSC_DIR)/src/fortran/auto/*.c 213 -make ACTION=fortranstubs tree 214 chmod g+w $(PETSC_DIR)/src/fortran/auto/*.c 215 216