xref: /petsc/makefile (revision 11b6ed10c95332efa977ecee0e099f3d5ee22ff7)
1*11b6ed10SLois Curfman McInnes#
2*11b6ed10SLois Curfman McInnes# This makefile contains some basic commands for building PETSc.
3*11b6ed10SLois Curfman McInnes# See bmake/common for additional commands.
4*11b6ed10SLois Curfman McInnes#
5*11b6ed10SLois Curfman McInnes
66b5873e3SBarry SmithIPETSCDIR = .
761523587SBarry Smith
86b5873e3SBarry SmithCFLAGS   = $(OPT) -I$(IPETSCDIR)/include -I.. -I$(IPETSCDIR) $(CONF)
961523587SBarry SmithSOURCEC  =
1061523587SBarry SmithSOURCEF  =
116f817ba4SBarry SmithSOURCEH  = Changes Machines Readme maint/addlinks maint/buildtest \
12bcfa8486SBarry Smith           maint/builddist FAQ Installation Performance BugReporting\
13deb7fc1cSBarry Smith           maint/buildlinks maint/wwwman maint/xclude maint/crontab\
146b2e9f06SBarry Smith           bmake/common bmake/*/*.*
1561523587SBarry SmithOBJSC    =
1661523587SBarry SmithOBJSF    =
1761523587SBarry SmithLIBBASE  = libpetscvec
18b16a3bb1SBarry SmithDIRS     = src include docs
1961523587SBarry Smith
207857610eSBarry Smithinclude $(IPETSCDIR)/bmake/$(PETSC_ARCH)/$(PETSC_ARCH)
2161523587SBarry Smith
22*11b6ed10SLois Curfman McInnes# Builds PETSc libraries for a given BOPT and architecture
237857610eSBarry Smithall: chkpetsc_dir
244e04c1a0SBarry Smith	-$(RM) -f $(PDIR)/*.a
25e35bd481SBarry Smith	-@$(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) \
26f3848965SBarry Smith           ACTION=libfast  tree
274e04c1a0SBarry Smith	$(RANLIB) $(PDIR)/*.a
2861523587SBarry Smith
2935ca7349SBarry Smith#
30*11b6ed10SLois Curfman McInnes# Builds PETSc Fortran interface libary
31*11b6ed10SLois Curfman McInnes# Note:  libfast cannot run on .F files on certain machines, so we
3235ca7349SBarry Smith# use lib and check for errors here.
3383f0b094SBarry Smithfortran: chkpetsc_dir
34b16a3bb1SBarry Smith	-@cd src/fortran/custom; \
3535ca7349SBarry Smith          $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) lib > trashz 2>&1; \
3635ca7349SBarry Smith          grep -v clog trashz | grep -v "information sections" | \
3735ca7349SBarry Smith          egrep -i '(Error|warning|Can)' >> /dev/null;\
3835ca7349SBarry Smith          if [ "$$?" != 1 ]; then \
3935ca7349SBarry Smith          cat trashz ; fi; $(RM) trashz
40b16a3bb1SBarry Smith	-@cd src/fortran/auto; \
4135ca7349SBarry Smith          $(OMAKE) BOPT=$(BOPT) PETSC_ARCH=$(PETSC_ARCH) libfast
4283f0b094SBarry Smith	$(RANLIB) $(PDIR)/libpetscfortran.a
4383f0b094SBarry Smith
448c37ef55SBarry Smithranlib:
454e04c1a0SBarry Smith	$(RANLIB) $(PDIR)/*.a
4661523587SBarry Smith
47*11b6ed10SLois Curfman McInnes# Deletes PETSc libraries
4861523587SBarry Smithdeletelibs:
494e04c1a0SBarry Smith	-$(RM) -f $(PDIR)/*.a $(PDIR)/complex/* $(PDIR)/c++/*
50d44968ceSBarry Smith
51*11b6ed10SLois Curfman McInnes# Deletes man pages (xman version)
52d44968ceSBarry Smithdeletemanpages:
537857610eSBarry Smith	$(RM) -f $(PETSC_DIR)/Keywords $(PETSC_DIR)/docs/man/man*/*
54d44968ceSBarry Smith
55*11b6ed10SLois Curfman McInnes# Deletes man pages (HTML version)
56b346654fSBarry Smithdeletewwwpages:
577857610eSBarry Smith	$(RM) -f $(PETSC_DIR)/docs/www/man*/* $(PETSC_DIR)/docs/www/www.cit
58b346654fSBarry Smith
59*11b6ed10SLois Curfman McInnes# Deletes man pages (LaTeX version)
60b346654fSBarry Smithdeletelatexpages:
617857610eSBarry Smith	$(RM) -f $(PETSC_DIR)/docs/tex/rsum/*sum*.tex
6220563c6bSBarry Smith
637acb7333SLois Curfman McInnes# To access the tags in emacs, type M-x visit-tags-table and specify
647acb7333SLois Curfman McInnes# the file petsc/TAGS.  Then, to move to where a PETSc function is
657acb7333SLois Curfman McInnes# defined, enter M-. and the function name.  To search for a string
667acb7333SLois Curfman McInnes# and move to the first occurrence, use M-x tags-search and the string.
677acb7333SLois Curfman McInnes# To locate later occurrences, use M-,
687acb7333SLois Curfman McInnes
69*11b6ed10SLois Curfman McInnes# Builds all etags files
70*11b6ed10SLois Curfman McInnesalletags:
71*11b6ed10SLois Curfman McInnes	-make etags
72*11b6ed10SLois Curfman McInnes	-make etags_noexamples
73*11b6ed10SLois Curfman McInnes	-make etags_makefiles
74*11b6ed10SLois Curfman McInnes
75*11b6ed10SLois Curfman McInnes# Builds the basic etags file.  This should be employed by most users.
7620563c6bSBarry Smithetags:
77edd2f0e1SBarry Smith	$(RM) TAGS
7870a6ad8cSBarry Smith	etags -f TAGS    src/*/impls/*/*.h src/*/impls/*/*/*.h
79ba6aed2eSLois Curfman McInnes	etags -a -f TAGS src/*/examples/*.c src/*/examples/*/*.c
809b0d1189SLois Curfman McInnes	etags -a -f TAGS src/*/*.h src/*/src/*.c src/*/impls/*/*.c
81d60b1e76SLois Curfman McInnes	etags -a -f TAGS src/*/impls/*/*/*.c src/*/impls/*/*/*/*.c
82b16a3bb1SBarry Smith	etags -a -f TAGS include/*.h include/pinclude/*.h bmake/common
8370a6ad8cSBarry Smith	etags -a -f TAGS src/*/impls/*.c src/*/utils/*.c
84f5354500SBarry Smith	etags -a -f TAGS makefile src/*/src/makefile src/makefile
85f5354500SBarry Smith	etags -a -f TAGS src/*/impls/makefile src/*/impls/*/makefile
863ebb8ef7SBarry Smith	etags -a -f TAGS src/*/utils/makefile src/*/examples/makefile
873ebb8ef7SBarry Smith	etags -a -f TAGS src/*/makefile src/*/impls/*/*/makefile
880675aaacSBarry Smith	etags -a -f TAGS bmake/common bmake/sun4/sun4* bmake/rs6000/rs6000*
89deb7fc1cSBarry Smith	etags -a -f TAGS bmake/solaris/solaris*
900675aaacSBarry Smith	etags -a -f TAGS bmake/IRIX/IRIX* bmake/freebsd/freebsd*
91017faef8SBarry Smith	etags -a -f TAGS bmake/hpux/hpux* bmake/alpha/alpha*
920675aaacSBarry Smith	etags -a -f TAGS bmake/t3d/t3d* bmake/paragon/paragon*
9370a6ad8cSBarry Smith	etags -a -f TAGS docs/tex/routin.tex  docs/tex/manual.tex
946f817ba4SBarry Smith	etags -a -f TAGS docs/tex/intro.tex  docs/tex/part1.tex
9528988994SBarry Smith	chmod g+w TAGS
96bfce26a3SBarry Smith
97*11b6ed10SLois Curfman McInnes# Builds the etags file that excludes the examples directories
98bfce26a3SBarry Smithetags_noexamples:
99bfce26a3SBarry Smith	$(RM) TAGS_NO_EXAMPLES
100bfce26a3SBarry Smith	etags -f TAGS_NO_EXAMPLES src/*/impls/*/*.h src/*/impls/*/*/*.h
101464493b3SBarry Smith	etags -a -f TAGS_NO_EXAMPLES src/*/*.h src/*/src/*.c src/*/impls/*/*.c
102464493b3SBarry Smith	etags -a -f TAGS_NO_EXAMPLES src/*/impls/*/*/*.c src/*/impls/*/*/*/*.c
103b16a3bb1SBarry Smith	etags -a -f TAGS_NO_EXAMPLES include/*.h include/pinclude/*.h
104b16a3bb1SBarry Smith	etags -a -f TAGS_NO_EXAMPLES bmake/common
105464493b3SBarry Smith	etags -a -f TAGS_NO_EXAMPLES src/*/impls/*.c src/*/utils/*.c
106464493b3SBarry Smith	etags -a -f TAGS_NO_EXAMPLES makefile src/*/src/makefile src/makefile
107464493b3SBarry Smith	etags -a -f TAGS_NO_EXAMPLES src/*/impls/makefile src/*/impls/*/makefile
108464493b3SBarry Smith	etags -a -f TAGS_NO_EXAMPLES src/*/utils/makefile
109464493b3SBarry Smith	etags -a -f TAGS_NO_EXAMPLES src/*/makefile src/*/impls/*/*/makefile
110464493b3SBarry Smith	etags -a -f TAGS_NO_EXAMPLES bmake/common bmake/sun4/sun4*
111464493b3SBarry Smith	etags -a -f TAGS_NO_EXAMPLES bmake/rs6000/rs6000*
112464493b3SBarry Smith	etags -a -f TAGS_NO_EXAMPLES bmake/solaris/solaris*
113464493b3SBarry Smith	etags -a -f TAGS_NO_EXAMPLES bmake/IRIX/IRIX* bmake/freebsd/freebsd*
114464493b3SBarry Smith	etags -a -f TAGS_NO_EXAMPLES bmake/hpux/hpux* bmake/alpha/alpha*
115464493b3SBarry Smith	etags -a -f TAGS_NO_EXAMPLES bmake/t3d/t3d* bmake/paragon/paragon*
116464493b3SBarry Smith	etags -a -f TAGS_NO_EXAMPLES docs/tex/routin.tex  docs/tex/manual.tex
117464493b3SBarry Smith	etags -a -f TAGS_NO_EXAMPLES docs/tex/intro.tex  docs/tex/part1.tex
118bfce26a3SBarry Smith	chmod g+w TAGS_NO_EXAMPLES
119b16a3bb1SBarry Smith
120*11b6ed10SLois Curfman McInnes# Builds the etags file for makefiles
121b16a3bb1SBarry Smithetags_makefiles:
122b16a3bb1SBarry Smith	$(RM) TAGS_MAKEFILES
123b16a3bb1SBarry Smith	etags -a -f TAGS_MAKEFILES bmake/common
124b16a3bb1SBarry Smith	etags -a -f TAGS_MAKEFILES makefile src/*/src/makefile src/makefile
125b16a3bb1SBarry Smith	etags -a -f TAGS_MAKEFILES src/*/impls/makefile src/*/impls/*/makefile
126b16a3bb1SBarry Smith	etags -a -f TAGS_MAKEFILES src/*/utils/makefile
127b16a3bb1SBarry Smith	etags -a -f TAGS_MAKEFILES src/*/makefile src/*/impls/*/*/makefile
128b16a3bb1SBarry Smith	etags -a -f TAGS_MAKEFILES bmake/common bmake/sun4/sun4*
129b16a3bb1SBarry Smith	etags -a -f TAGS_MAKEFILES bmake/rs6000/rs6000*
130b16a3bb1SBarry Smith	etags -a -f TAGS_MAKEFILES bmake/solaris/solaris*
131b16a3bb1SBarry Smith	etags -a -f TAGS_MAKEFILES bmake/IRIX/IRIX* bmake/freebsd/freebsd*
132b16a3bb1SBarry Smith	etags -a -f TAGS_MAKEFILES bmake/hpux/hpux* bmake/alpha/alpha*
133b16a3bb1SBarry Smith	etags -a -f TAGS_MAKEFILES bmake/t3d/t3d* bmake/paragon/paragon*
134b16a3bb1SBarry Smith	chmod g+w TAGS_MAKEFILES
135*11b6ed10SLois Curfman McInnes
136*11b6ed10SLois Curfman McInnes# ------------------------------------------------------------------
137*11b6ed10SLois Curfman McInnes#
138*11b6ed10SLois Curfman McInnes# All remaining actions are intended for PETSc developers only.
139*11b6ed10SLois Curfman McInnes# PETSc users should not generally need to use these commands.
140*11b6ed10SLois Curfman McInnes#
141*11b6ed10SLois Curfman McInnes
142*11b6ed10SLois Curfman McInnes# Builds all versions of the man pages
143*11b6ed10SLois Curfman McInnesallmanpages: deletemanpages deletewwwpages deletelatexpages
144*11b6ed10SLois Curfman McInnes	-make ACTION=manpages tree
145*11b6ed10SLois Curfman McInnes	-make ACTION=wwwpages tree
146*11b6ed10SLois Curfman McInnes	-make ACTION=latexpages tree
147*11b6ed10SLois Curfman McInnes	-maint/wwwman
148*11b6ed10SLois Curfman McInnes
149*11b6ed10SLois Curfman McInnes# Builds Fortran stub files
150*11b6ed10SLois Curfman McInnesallfortranstubs:
151*11b6ed10SLois Curfman McInnes	-@$(RM) $(PETSC_DIR)/fortran/auto/*.c
152*11b6ed10SLois Curfman McInnes	-make ACTION=fortranstubs tree
153*11b6ed10SLois Curfman McInnes
154