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