xref: /petsc/makefile (revision f630a525398fe18bec863feadb1b5ff26330c5af)
1#
2# This makefile contains some basic commands for building PETSc.
3# See bmake/common for additional commands.
4#
5
6PETSC_DIR = .
7
8CFLAGS	 =
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/*/base* maint/autoftp docs/www/sec/*
15OBJSC	 =
16OBJSF	 =
17LIBBASE	 = libpetscvec
18DIRS	 = src include docs
19
20include $(PETSC_DIR)/bmake/$(PETSC_ARCH)/base
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 compiler: $(CC) $(PETSC_INCLUDE) $(CONF) $(PCONF) $(BASEOPT)"
27	-@echo "------------------------------------------"
28	-@$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) \
29	   ACTION=libfast  tree
30	-@cd $(PETSC_DIR)/src/sys/src ; $(OMAKE) PETSC_ARCH=$(PETSC_ARCH) rs6000_time
31	$(RANLIB) $(PDIR)/*.a
32	-@echo "Completed building libraries"
33	-@echo "------------------------------------------"
34
35# Builds PETSc test examples for a given BOPT and architecture
36testexamples: chkpetsc_dir
37	-@echo "Beginning to compile and run test examples"
38	-@echo "Using compiler: $(CC) $(PETSC_INCLUDE) $(PCONF) $(BASEOPT)"
39	-@echo "Using linker: $(CLINKER)"
40	-@echo "Using libraries: $(PETSC_LIB)"
41	-@echo "------------------------------------------"
42	-@echo "Due to different numerical round-off on certain"
43	-@echo "machines some of the numbers may not 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
51testexamples_uni: chkpetsc_dir
52	-@echo "Beginning to compile and run uniprocessor test examples"
53	-@echo "Using compiler: $(CC) $(PETSC_INCLUDE) $(PCONF) $(BASEOPT)"
54	-@echo "Using linker: $(CLINKER)"
55	-@echo "Using libraries: $(PETSC_LIB)"
56	-@echo "------------------------------------------"
57	-@echo "Due to different numerical round-off on certain"
58	-@echo "machines some of the numbers may not match exactly."
59	-@echo "------------------------------------------"
60	-@$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) \
61	   ACTION=testexamples_4  tree
62	-@echo "Completed compiling and running uniprocessor test examples"
63	-@echo "------------------------------------------"
64
65# Builds PETSc test examples for a given BOPT and architecture
66testfortran: chkpetsc_dir
67	-@echo "Beginning to compile and run Fortran test examples"
68	-@echo "Using compiler: $(FC) $(BASEOPTF)"
69	-@echo "Using linker: $(FLINKER)"
70	-@echo "Using libraries: $(PETSC_FORTRAN_LIB)  $(PETSC_LIB)"
71	-@echo "------------------------------------------"
72	-@$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) \
73	   ACTION=testexamples_3  tree
74	-@echo "Completed compiling and running Fortran test examples"
75	-@echo "------------------------------------------"
76
77#
78# Builds PETSc Fortran interface libary
79# Note:	 libfast cannot run on .F files on certain machines, so we
80# use lib and check for errors here.
81fortran: chkpetsc_dir
82	-$(RM) -f $(PDIR)/libpetscfortran.a
83	-@echo "Beginning to compile Fortran interface library"
84	-@echo "Using C/C++ compiler: $(CC) $(PETSC_INCLUDE) $(PCONF) $(BASEOPT)"
85	-@echo "Using Fortran compiler: $(FC) $(BASEOPTF)"
86	-@echo "------------------------------------------"
87	-@cd src/fortran/custom; \
88	  $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) lib > trashz 2>&1; \
89	  grep -v clog trashz | grep -v "information sections" | \
90	  egrep -i '(Error|warning|Can)' >> /dev/null;\
91	  if [ "$$?" != 1 ]; then \
92	  cat trashz ; fi; $(RM) trashz
93	-@cd src/fortran/auto; \
94	  $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) libfast
95	$(RANLIB) $(PDIR)/libpetscfortran.a
96	-@echo "Completed compiling Fortran interface library"
97	-@echo "------------------------------------------"
98
99ranlib:
100	$(RANLIB) $(PDIR)/*.a
101
102# Deletes PETSc libraries
103deletelibs:
104	-$(RM) -f $(PDIR)/*.a $(PDIR)/complex/* $(PDIR)/c++/*
105
106# Deletes man pages (xman version)
107deletemanpages:
108	$(RM) -f $(PETSC_DIR)/Keywords $(PETSC_DIR)/docs/man/man*/*
109
110# Deletes man pages (HTML version)
111deletewwwpages:
112	$(RM) -f $(PETSC_DIR)/docs/www/man*/* $(PETSC_DIR)/docs/www/www.cit \
113	         $(PETSC_DIR)/docs/www/man*.html
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  src/benchmarks/*.c
139	etags -a -f TAGS src/contrib/*/*.c src/contrib/*/src/*.c
140	etags -a -f TAGS src/contrib/*/examples/*.c
141	etags -a -f TAGS src/contrib/*/src/*.h src/contrib/*/examples/*.F
142	etags -a -f TAGS include/*.h include/pinclude/*.h bmake/common
143	etags -a -f TAGS include/FINCLUDE/*.h
144	etags -a -f TAGS src/*/impls/*.c src/*/utils/*.c
145	etags -a -f TAGS makefile src/*/src/makefile
146	etags -a -f TAGS src/*/interface/makefile src/makefile
147	etags -a -f TAGS src/*/impls/makefile src/*/impls/*/makefile
148	etags -a -f TAGS src/*/utils/makefile src/*/examples/makefile
149	etags -a -f TAGS src/*/examples/*/makefile
150	etags -a -f TAGS src/*/makefile src/*/impls/*/*/makefile
151	etags -a -f TAGS src/contrib/*/makefile src/contrib/*/src/makefile
152	etags -a -f TAGS src/fortran/makefile src/fortran/auto/makefile
153	etags -a -f TAGS src/fortran/custom/makefile
154	etags -a -f TAGS include/makefile include/*/makefile
155	etags -a -f TAGS bmake/common bmake/*/base*
156	etags -a -f TAGS src/fortran/custom/*.c src/fortran/auto/*.c src/benchmarks/*.c
157	etags -a -f TAGS src/*/examples/*.F src/*/examples/*.f src/fortran/custom/*.F
158	etags -a -f TAGS docs/tex/manual/routin.tex docs/tex/manual/manual.tex
159	etags -a -f TAGS docs/tex/manual/manual_tex.tex
160	etags -a -f TAGS docs/tex/manual/intro.tex docs/tex/manual/part1.tex
161	etags -a -f TAGS docs/tex/manual/part2.tex
162	etags -a -f TAGS docs/tex/manual/intro.tex docs/makefile
163	chmod g+w TAGS
164
165# Builds the etags file that excludes the examples directories
166etags_noexamples:
167	$(RM) TAGS_NO_EXAMPLES
168	etags -f TAGS_NO_EXAMPLES src/*/impls/*/*.h src/*/impls/*/*/*.h
169	etags -a -f TAGS_NO_EXAMPLES src/*/*.h src/*/*/*.h src/*/interface/*.c
170	etags -a -f TAGS_NO_EXAMPLES src/*/src/*.c  src/*/impls/*/*.c
171	etags -a -f TAGS_NO_EXAMPLES src/*/impls/*/*/*.c
172	etags -a -f TAGS_NO_EXAMPLES src/contrib/*/*.c src/contrib/*/src/*.c
173	etags -a -f TAGS_NO_EXAMPLES src/contrib/*/src/*.h
174	etags -a -f TAGS_NO_EXAMPLES include/*.h include/pinclude/*.h
175	etags -a -f TAGS_NO_EXAMPLES include/FINCLUDE/*.h
176	etags -a -f TAGS_NO_EXAMPLES bmake/common
177	etags -a -f TAGS_NO_EXAMPLES src/*/impls/*.c src/*/utils/*.c
178	etags -a -f TAGS_NO_EXAMPLES makefile src/*/src/makefile
179	etags -a -f TAGS_NO_EXAMPLES src/*/interface/makefile src/makefile
180	etags -a -f TAGS_NO_EXAMPLES src/*/impls/makefile src/*/impls/*/makefile
181	etags -a -f TAGS_NO_EXAMPLES src/*/utils/makefile
182	etags -a -f TAGS_NO_EXAMPLES src/*/makefile src/*/impls/*/*/makefile
183	etags -a -f TAGS_NO_EXAMPLES src/contrib/*/makefile src/contrib/*/src/makefile
184	etags -a -f TAGS_NO_EXAMPLES src/fortran/makefile src/fortran/auto/makefile
185	etags -a -f TAGS_NO_EXAMPLES src/fortran/custom/makefile
186	etags -a -f TAGS_NO_EXAMPLES include/makefile include/*/makefile
187	etags -a -f TAGS_NO_EXAMPLES bmake/common bmake/*/base*
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/contrib/*/makefile src/contrib/*/src/makefile
210	etags -a -f TAGS_MAKEFILES src/fortran/custom/makefile
211	etags -a -f TAGS_MAKEFILES include/makefile include/*/makefile
212	etags -a -f TAGS_MAKEFILES bmake/common bmake/*/base*
213	etags -a -f TAGS_MAKEFILES docs/makefile
214	chmod g+w TAGS_MAKEFILES
215
216# Builds the etags file for contrib directory only
217etags_dfvec:
218	$(RM) TAGS_DFVEC
219	etags -f TAGS_DFVEC    src/dfvec/*.c src/dfvec/interface/*.c
220	etags -a -f TAGS_DFVEC src/dfvec/examples/*.c src/impls/*/*.c
221	etags -a -f TAGS_DFVEC src/dfvec/impls/*/*/*.c
222	etags -a -f TAGS_DFVEC src/dfvec/*.h
223	etags -a -f TAGS_DFVEC src/dfvec/README
224	etags -a -f TAGS_DFVEC src/dfvec/makefile src/dfvec/interface/makefile
225	etags -a -f TAGS_DFVEC src/dfvec/impls/makefile src/dfvec/examples/makefile
226	etags -a -f TAGS_DFVEC src/dfvec/impls/*/makefile
227	etags -a -f TAGS_DFVEC src/dfvec/impls/*/*/makefile
228
229# ------------------------------------------------------------------
230#
231# All remaining actions are intended for PETSc developers only.
232# PETSc users should not generally need to use these commands.
233#
234
235# Builds all versions of the man pages
236allmanpages: deletemanpages allwwwpages alllatexpages
237	-make ACTION=manpages tree
238	-cd src/fortran/custom; make manpages
239
240allwwwpages: deletewwwpages
241	-make ACTION=wwwpages_buildcite tree
242	-cd src/fortran/custom; make wwwpages_buildcite
243	-cd src/fortran/custom; make wwwpages
244	-make ACTION=wwwpages tree
245	-maint/wwwman
246
247alllatexpages: deletelatexpages
248	-make ACTION=latexpages tree
249	-cd src/fortran/custom; make latexpages
250
251# Builds Fortran stub files
252allfortranstubs:
253	-@include/finclude/generateincludes
254	-@$(RM) -f $(PETSC_DIR)/src/fortran/auto/*.c
255	-make ACTION=fortranstubs tree
256	chmod g+w $(PETSC_DIR)/src/fortran/auto/*.c
257
258
259