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