xref: /petsc/makefile (revision 90ace30e424d9f4cdf3cb0814f02b30542ad8b7e)
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	   bmake/sun4_local/* 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 compiler: $(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 "Using compiler: $(FC) $(BASEOPTF)"
88	-@echo "------------------------------------------"
89	-@cd src/fortran/custom; \
90	  $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) lib > trashz 2>&1; \
91	  grep -v clog trashz | grep -v "information sections" | \
92	  egrep -i '(Error|warning|Can)' >> /dev/null;\
93	  if [ "$$?" != 1 ]; then \
94	  cat trashz ; fi; $(RM) trashz
95	-@cd src/fortran/auto; \
96	  $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) libfast
97	$(RANLIB) $(PDIR)/libpetscfortran.a
98	-@echo "Completed compiling Fortran interface library"
99	-@echo "------------------------------------------"
100
101ranlib:
102	$(RANLIB) $(PDIR)/*.a
103
104# Deletes PETSc libraries
105deletelibs:
106	-$(RM) -f $(PDIR)/*.a $(PDIR)/complex/* $(PDIR)/c++/*
107
108# Deletes man pages (xman version)
109deletemanpages:
110	$(RM) -f $(PETSC_DIR)/Keywords $(PETSC_DIR)/docs/man/man*/*
111
112# Deletes man pages (HTML version)
113deletewwwpages:
114	$(RM) -f $(PETSC_DIR)/docs/www/man*/* $(PETSC_DIR)/docs/www/www.cit \
115	         $(PETSC_DIR)/docs/www/man*.html
116
117# Deletes man pages (LaTeX version)
118deletelatexpages:
119	$(RM) -f $(PETSC_DIR)/docs/tex/rsum/*sum*.tex
120
121# To access the tags in emacs, type M-x visit-tags-table and specify
122# the file petsc/TAGS.	Then, to move to where a PETSc function is
123# defined, enter M-. and the function name.  To search for a string
124# and move to the first occurrence, use M-x tags-search and the string.
125# To locate later occurrences, use M-,
126
127# Builds all etags files
128alletags:
129	-make etags
130	-make etags_noexamples
131	-make etags_makefiles
132
133# Builds the basic etags file.	This should be employed by most users.
134etags:
135	$(RM) TAGS
136	etags -f TAGS	 src/*/impls/*/*.h src/*/impls/*/*/*.h
137	etags -a -f TAGS src/*/examples/*.c src/*/examples/*/*.c
138	etags -a -f TAGS src/*/*.h src/*/*/*.h src/*/interface/*.c
139	etags -a -f TAGS src/*/src/*.c src/*/impls/*/*.c
140	etags -a -f TAGS src/*/impls/*/*/*.c
141	etags -a -f TAGS src/contrib/*/*.c src/contrib/*/src/*.c
142	etags -a -f TAGS src/contrib/*/examples/*.c src/contrib/*/src/*/*.c
143	etags -a -f TAGS src/contrib/*/src/*.h
144	etags -a -f TAGS include/*.h include/pinclude/*.h bmake/common
145	etags -a -f TAGS include/FINCLUDE/*.h
146	etags -a -f TAGS src/*/impls/*.c src/*/utils/*.c
147	etags -a -f TAGS makefile src/*/src/makefile
148	etags -a -f TAGS src/*/interface/makefile src/makefile
149	etags -a -f TAGS src/*/impls/makefile src/*/impls/*/makefile
150	etags -a -f TAGS src/*/utils/makefile src/*/examples/makefile
151	etags -a -f TAGS src/*/examples/*/makefile
152	etags -a -f TAGS src/*/makefile src/*/impls/*/*/makefile
153	etags -a -f TAGS src/contrib/*/makefile src/contrib/*/src/makefile
154	etags -a -f TAGS src/contrib/*/src/*/makefile
155	etags -a -f TAGS src/fortran/makefile src/fortran/auto/makefile
156	etags -a -f TAGS src/fortran/custom/makefile
157	etags -a -f TAGS include/makefile include/*/makefile
158	etags -a -f TAGS bmake/common bmake/sun4/sun4* bmake/rs6000/rs6000*
159	etags -a -f TAGS bmake/solaris/solaris*
160	etags -a -f TAGS bmake/IRIX/IRIX* bmake/freebsd/freebsd*
161	etags -a -f TAGS bmake/hpux/hpux* bmake/alpha/alpha*
162	etags -a -f TAGS bmake/t3d/t3d* bmake/paragon/paragon*
163	etags -a -f TAGS src/fortran/custom/*.c src/fortran/auto/*.c
164	etags -a -f TAGS src/benchmarks/*.c src/*/examples/*.F src/fortran/custom/*.F
165	etags -a -f TAGS docs/tex/manual/routin.tex docs/tex/manual/manual.tex
166	etags -a -f TAGS docs/tex/manual/manual_tex.tex
167	etags -a -f TAGS docs/tex/manual/intro.tex docs/tex/manual/part1.tex
168	etags -a -f TAGS docs/tex/manual/part2.tex
169	etags -a -f TAGS docs/tex/manual/intro.tex docs/makefile
170	chmod g+w TAGS
171
172# Builds the etags file that excludes the examples directories
173etags_noexamples:
174	$(RM) TAGS_NO_EXAMPLES
175	etags -f TAGS_NO_EXAMPLES src/*/impls/*/*.h src/*/impls/*/*/*.h
176	etags -a -f TAGS_NO_EXAMPLES src/*/*.h src/*/*/*.h src/*/interface/*.c
177	etags -a -f TAGS_NO_EXAMPLES src/*/src/*.c  src/*/impls/*/*.c
178	etags -a -f TAGS_NO_EXAMPLES src/*/impls/*/*/*.c
179	etags -a -f TAGS_NO_EXAMPLES src/contrib/*/*.c src/contrib/*/src/*.c
180	etags -a -f TAGS_NO_EXAMPLES src/contrib/*/src/*/*.c src/contrib/*/src/*.h
181	etags -a -f TAGS_NO_EXAMPLES include/*.h include/pinclude/*.h
182	etags -a -f TAGS_NO_EXAMPLES include/FINCLUDE/*.h
183	etags -a -f TAGS_NO_EXAMPLES bmake/common
184	etags -a -f TAGS_NO_EXAMPLES src/*/impls/*.c src/*/utils/*.c
185	etags -a -f TAGS_NO_EXAMPLES makefile src/*/src/makefile
186	etags -a -f TAGS_NO_EXAMPLES src/*/interface/makefile src/makefile
187	etags -a -f TAGS_NO_EXAMPLES src/*/impls/makefile src/*/impls/*/makefile
188	etags -a -f TAGS_NO_EXAMPLES src/*/utils/makefile
189	etags -a -f TAGS_NO_EXAMPLES src/*/makefile src/*/impls/*/*/makefile
190	etags -a -f TAGS_NO_EXAMPLES src/contrib/*/makefile src/contrib/*/src/makefile
191	etags -a -f TAGS_NO_EXAMPLES src/contrib/*/src/*/makefile
192	etags -a -f TAGS_NO_EXAMPLES src/fortran/makefile src/fortran/auto/makefile
193	etags -a -f TAGS_NO_EXAMPLES src/fortran/custom/makefile
194	etags -a -f TAGS_NO_EXAMPLES include/makefile include/*/makefile
195	etags -a -f TAGS_NO_EXAMPLES bmake/common bmake/sun4/sun4*
196	etags -a -f TAGS_NO_EXAMPLES bmake/rs6000/rs6000*
197	etags -a -f TAGS_NO_EXAMPLES bmake/solaris/solaris*
198	etags -a -f TAGS_NO_EXAMPLES bmake/IRIX/IRIX* bmake/freebsd/freebsd*
199	etags -a -f TAGS_NO_EXAMPLES bmake/hpux/hpux* bmake/alpha/alpha*
200	etags -a -f TAGS_NO_EXAMPLES bmake/t3d/t3d* bmake/paragon/paragon*
201	etags -a -f TAGS_NO_EXAMPLES src/fortran/auto/*.c
202	etags -a -f TAGS_NO_EXAMPLES src/fortran/custom/*.c src/fortran/custom/*.F
203	etags -a -f TAGS_NO_EXAMPLES docs/tex/manual/routin.tex
204	etags -a -f TAGS_NO_EXAMPLES docs/tex/manual/manual.tex
205	etags -a -f TAGS_NO_EXAMPLES docs/tex/manual/intro.tex
206	etags -a -f TAGS_NO_EXAMPLES docs/tex/manual/part1.tex
207	etags -a -f TAGS_NO_EXAMPLES docs/tex/manual/part2.tex
208	etags -a -f TAGS_NO_EXAMPLES docs/makefile
209	chmod g+w TAGS_NO_EXAMPLES
210
211# Builds the etags file for makefiles
212etags_makefiles:
213	$(RM) TAGS_MAKEFILES
214	etags -a -f TAGS_MAKEFILES bmake/common
215	etags -a -f TAGS_MAKEFILES makefile src/*/src/makefile
216	etags -a -f TAGS_MAKEFILES src/*/interface/makefile src/makefile
217	etags -a -f TAGS_MAKEFILES src/*/impls/makefile src/*/impls/*/makefile
218	etags -a -f TAGS_MAKEFILES src/*/utils/makefile src/*/interface/makefile
219	etags -a -f TAGS_MAKEFILES src/*/makefile src/*/impls/*/*/makefile
220	etags -a -f TAGS_MAKEFILES src/*/examples/makefile src/*/examples/*/makefile
221	etags -a -f TAGS_MAKEFILES src/fortran/makefile src/fortran/auto/makefile
222	etags -a -f TAGS_MAKEFILES src/contrib/*/makefile src/contrib/*/src/makefile
223	etags -a -f TAGS_MAKEFILES src/contrib/*/src/*/makefile
224	etags -a -f TAGS_MAKEFILES src/fortran/custom/makefile
225	etags -a -f TAGS_MAKEFILES include/makefile include/*/makefile
226	etags -a -f TAGS_MAKEFILES bmake/common bmake/sun4/sun4*
227	etags -a -f TAGS_MAKEFILES bmake/rs6000/rs6000*
228	etags -a -f TAGS_MAKEFILES bmake/solaris/solaris*
229	etags -a -f TAGS_MAKEFILES bmake/IRIX/IRIX* bmake/freebsd/freebsd*
230	etags -a -f TAGS_MAKEFILES bmake/hpux/hpux* bmake/alpha/alpha*
231	etags -a -f TAGS_MAKEFILES bmake/t3d/t3d* bmake/paragon/paragon*
232	etags -a -f TAGS_MAKEFILES docs/makefile
233	chmod g+w TAGS_MAKEFILES
234
235# ------------------------------------------------------------------
236#
237# All remaining actions are intended for PETSc developers only.
238# PETSc users should not generally need to use these commands.
239#
240
241# Builds all versions of the man pages
242allmanpages: deletemanpages deletewwwpages deletelatexpages
243	-make ACTION=manpages tree
244	-make ACTION=latexpages tree
245	-make ACTION=wwwpages_buildcite tree
246	-make ACTION=wwwpages tree
247	-maint/wwwman
248
249allwwwpages: deletewwwpages
250	-make ACTION=wwwpages_buildcite tree
251	-make ACTION=wwwpages tree
252	-maint/wwwman
253
254alllatexpages: deletelatexpages
255	-make ACTION=latexpages tree
256
257# Builds Fortran stub files
258allfortranstubs:
259	-@include/finclude/generateincludes
260	-@$(RM) -f $(PETSC_DIR)/src/fortran/auto/*.c
261	-make ACTION=fortranstubs tree
262	chmod g+w $(PETSC_DIR)/src/fortran/auto/*.c
263
264
265