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