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