| Version 1.9 Build 1556
|
|
Next: mkinst
Up: System generation
Previous: Template instantiation
Subsections
System generation makefile rules
GNU makefile rules used to rebuild AIPS++
makefile
makefile.{app,aps,chk,doc,ftn,imp,pkg,scr,tst}
The AIPS++ makefile targets are listed below by category. These lists are
not exhaustive, but do aim to cover everything of practical use. In
particular, they omit targets which are intended for the internal use of the
makefiles.
A target is labelled as ``recursive'' if it causes gmake (p) to be
invoked in all subdirectories. It is ``general'' if it applies to all
makefiles; such targets are defined in makedefs. A target is
``specific'' if defined in a specific makefile.
Some targets such as allsys have a general meaning, the specific
behaviour of which differs for specific makefiles. These are referred to as
``general/specific'' and where appropriate the details of a target's behaviour
are described for each of the generic makefiles, for the top-level makefile
(top), and the installation makefile (ins).
Targets which apply only if the RCS source code repositories are present are
marked as ``RCS''.
Rules for system-oriented targets always take source code from the
$AIPSCODE subdirectories. If $AIPSRCS exists, then these
plain-text sources are updated from the RCS repository first if necessary.
- allsys : (default system target, general/specific, recursive)
This is declared generally in makedefs as the default target if
gmake has been invoked from a subdirectory of $AIPSCODE.
It has a dependency which causes source files to be checked out where
required if the RCS repositories exist. Further dependencies and
commands are defined in the specific makefiles to compile and install all
AIPS++ sources.
- app: Rebuild the application; template instantiation files will
be created from a templates file if necessary. Also install any
Glish scripts in $(LIBEXECD).
- aps: Rebuild all applications residing in an apps
directory.
- chk: Just update the plain-text sources if RCS repositories
are present.
- doc: Compile all documentation.
- ftn: Rebuild a FORTRAN library from its sources.
- imp: Rebuild a C++ library from its sources updating the
system dependency list in the process (see depend (p)). Also
install any Glish scripts in $(LIBEXECD).
- ins: Compile and install all AIPS++ system utilities in the
bin area. See also thisys.
- pkg: Rebuild a whole package. Auxiliary directories such as
glish and wcslib in the aips package are done
first, then the scripts subdirectory, then the AIPS++ libraries, then all applications.
- scr: Install all AIPS++ executable scripts in the bin
area and install any Glish scripts in $(LIBEXECD). When
perl scripts are installed the pathname in the strings
#!/usr/local/bin/perl4 and #!/usr/local/bin/perl5 on the
first line of the script are replaced with the pathname encoded in the
PERL4 and PERL5 makedefs variables. All sources
present in the directory will be installed except for those listed in
the EXCLUDE variable. By default, this contains the name of the
makefile itself to prevent it from being installed.
- top: Rebuild the entire AIPS++ system as follows:
If necessary, the include subdirectory is first created and
populated with symbolic links to the implement directories of all
installed packages (see mktree (p)).
Before commencing the rebuild any required system directories are
created.
The install, aips, dish, synthesis, and
vlbi subdirectories are then built in that order.
If the admin subdirectory exists it is then rebuilt.
Auxiliary packages are then rebuilt under the control of the
AUXILIARY variable. This may be set in makedefs to the
required combination of contrib and trial. They will be
rebuilt in the order listed in AUXILIARY.
Consortium packages are then rebuilt under the control of the
CONSORTIA variable. This may be set in makedefs to the
required combination of atnf, bima, hia,
nfra, nral, nrao, and tifr. They will be
rebuilt in the order listed in CONSORTIA.
The AIPS++ documentation is then compiled. This can be defeated by
unsetting the DOCSYS variable in makedefs.
Document extraction from C++ sources is then performed under
the control of the DOCEXTR variable in makedefs.
- tst: Create template instantiation files from a templates
file if necessary. If the BINTEST variable is set to
``bintest'' (or just ``bin'') in makedefs then
rebuild all test programs. Debug compilations are done by default, but
if the TESTOPT variable is set to ``opt'' in
makedefs then optimized compilations will be done.
- thisys : (specific)
Non-recursive version of allsys.
- ins: Compile and install all AIPS++ system utilities in the
bin area. Same as allsys except that it does not recurse
into any subdirectories.
- aipsroot : (specific)
Special purpose rule to remake the $(AIPSROOT) directory.
- ins: Install all root level files.
- $(SUBDIRS) : (general, recursive)
makedefs sets the SUBDIRS variable to the names of all
subdirectories which have a makefile, thus making them recognized targets.
If the RCS source code repositories exist then SUBDIRS lists
the subdirectories of the corresponding RCS directory. This list is
then made the target of a rule for creating the subdirectory and, if the
RCS directories are present, its RCS symlink (see
mktree (p)). A gmake is then initiated within the
subdirectory. Note that this target has a programmer-oriented counterpart
which behaves similarly.
- $(CODESUBS) : (general, recursive)
Same as $(SUBDIRS) except that a subdirectory of
$AIPSCODE may be specified via an absolute pathname.
- null : (general)
Does nothing directly, but indirectly it may cause a makefile to update
its included files, and in particular, this may trigger a dependency
analysis to be done (see depend (p)).
- chkout : (general, recursive, RCS)
Update the $AIPSCODE directories by checking out files from the
corresponding $(AIPSRCS) directories (if the RCS repositories
are present).
In installations which use do-it-yourself template instantiation
(§10.8) the chkout rule also generates
template instantiation files in the tmplinst subdirectory by
invoking mkinst (p). (These tmplinst subdirectories are
maintained by the makefile in their parent directory and should not contain
their own makefile.)
The chkout target for the doc makefile explicitly handles all
subdirectories with names of the form .dir so that these
subdirectories need not and should not contain a makefile.
- symlinks : (specific)
Create the $(CODEINCD) directory and symlinks.
- top: Create the $(CODEINCD) directory and symlinks.
- sysdirs : (general)
Create the AIPS++ system directories, the subdirectories of
$AIPSARCH. This is invoked by the top-level ($AIPSCODE)
makefile at the beginning of a recursive rebuild to ensure that all
required system directories exist.
- cleancode : (general/specific, recursive)
Recursively delete files from the AIPS++ code areas which shouldn't
be there - since noone should work from within these areas such files
should not normally accumulate in them. Generally, the following are
deleted: ,*,, * , *%, a.out, and core.
The general target has a dependency which may be defined in the specific
makefiles as the target of a rule to delete additional files:
- app: *.i, *.o, *.cdb, *.cyi, and any
tmplinst subdirectory.
- aps: (none)
- chk: (none)
- doc: *.aux, *.bbl, *.blg, *.cp,
*.cps, *.dvi, *.fi, *.fis, *.fn,
*.fns, *.ky, *.kys, *.lof, *.log,
*.pg, *.pgs, *.toc, *.tp, *.tps,
*.vr, *.vrs, *.info, *.info-*
- ftn: *.o
- imp: *.lcc, *.ycc, *.i, *.o,
*.cdb, *.cyi, and any tmplinst subdirectory.
- ins: *.i, *.o
- pkg: (none)
- scr: (none)
- top: (none)
- tst: *.i, *.o, *.cdb, *.cyi,
*_tmp* (temporaries created by assay (p)), and any
tmplinst subdirectory.
- cleansys : (general/specific, recursive)
Delete selected files from the AIPS++ system directories, usually
as a prelude to rebuilding the system in its entirety. The general rule
does nothing except recurse, but it has a dependency which may be defined
in the specific makefiles as the target of a rule to delete additional
files:
- app: (none)
- aps: (none)
- chk: (none)
- doc: (none)
- ftn: The debug and optimized static FORTRAN object
libraries for the package, and also certain BUILD.* lock files
which are normally deleted after a library is built but may be left
behind if the build is terminated with prejudice.
- imp: The debug and optimized static C++ object libraries
for the package, dependency lists and the timestamp files maintained
for the module by the dependency analysis (their deletion causes the
dependency analysis to be done again from scratch), the version.o
object module, the debug and optimized C++ template repositories
(if any, in their entirety).
- ins: (none)
- pkg: Recursively delete the tmp directories for the
package. These exist as subdirectories of $(ARCHTMPD).
- scr: (none)
- top: (none)
- tst: Test executables and reports in $(BINTESTD)
generated by the runtests rule (see section §). Also, the intermediate object library produced when
compiling all test executables in the directory.
- cleandocs : (specific)
Clean up $(AIPSDOCS).
- imp: Delete defunct and unrecognized files from the corresponding
subdirectory of $(AIPSDOCS).
- dependsys : (specific)
Update the system dependency lists in $(ARCHAUXD). Since these
lists are included by the makefiles they are normally updated automatically
by gmake.
- imp: Build the system dependency lists for the C++ libraries.
- instsys : (specific)
Generate and possibly compile template instantiation files specified by
a templates file in $(CODEDIR).
- app: Generate template instantiation files using mkinst (p)
and deposit them in subdirectory $(CODEDIR)/tmplinst.
- imp: Generate template instantiation files using mkinst
and deposit them in subdirectory $(CODEDIR)/tmplinst, then
invoke gmake allsys in that directory to compile them and insert
them into the object library.
- tst: Generate template instantiation files using mkinst
and deposit them in subdirectory $(CODEDIR)/tmplinst.
- version : (specific)
Compile version.o.
- imp: Generate version.o using doover (p), compile it
and insert it into the object libraries.
- lib(%.o) : (specific, pattern rule)
Compile an object module from the corresponding source file in
$(CODEDIR) and insert it into the system library, then apply
$(RANLIB) to the library.
An AIPS++ installation may be configured to maintain a debug version
of the object libraries, an optimized version, or both as determined by the
setting of the library control variables in makedefs (p).
If dual debug/optimized libraries are being maintained then both forms are
compiled and the libraries updated in tandem to ensure that they remain
synchronized (see updatelib (p)).
Intermediate object files are stored in a subdirectory of
$(ARCHTMPD).
- ftn: Compile the .f file for a FORTRAN subroutine
and insert it into the FORTRAN library.
- imp: Compile the .cc file for a C++ class
implementation and insert it into the C++ library.
- lib : (specific)
Invoke the lib(%.o) pattern rule for all sources in
$(CODEDIR) to build the system object libraries (debug and/or
optimized).
- ftn: Build the FORTRAN library(s).
- imp: Update the package library for all C++ sources in
this module. Also, install any Glish scripts in $(LIBEXECD).
- pkg: Invoke allsys in the implement and
fortran subdirectories.
- tst: Invoke allsys in the implement directory for
this package.
- updatelib : (specific)
Insert all object modules into the system libraries and ranlib
them.
- ftn: Update the FORTRAN libraries.
- imp: Update the C++ libraries.
- ranlib : (specific)
Apply $(RANLIB) to the system static object libraries.
- ftn: ranlib the FORTRAN libraries.
- imp: ranlib the C++ libraries.
- bin/$(AIPSEXES) : (specific)
Compile an executable in optimized mode from the corresponding source
file in $(CODEDIR) and install it in $BINOPTD.
- aps: The apps directory makefile generates a list of all
applications which may be compiled from applications subdirectories.
It then forms this into a list of targets of a rule for invoking the
bin target in each applications subdirectory.
- ins: Compile and install a utility program, e.g. getrc (p).
- tst: Synonym for bintest/%.
- bindbg/$(AIPSEXES) : (specific)
Compile an executable in debug mode from the corresponding source
file in $(CODEDIR) and install it in $(BINDBGD).
- aps: The apps directory makefile generates a list of all
applications which may be compiled from applications subdirectories.
It then forms this into a list of targets of a rule for invoking the
bindbg target in each applications subdirectory.
- bintest/% : (specific, pattern rule)
Compile a test program.
- tst:
Compile a test program from the corresponding source file
in $(CODEDIR) and install it in $BINTESTD. If necessary,
template instantiation files will be created from a templates
file and compiled into an object library (which is retained). The
compilation will be done in optimized mode if the TESTOPT
makedefs variable is set to ``opt'', anything else will
produce a debug compilation. The include path will be augmented with
the name of the test subdirectory thereby allowing test programs to
maintain a set of include files specific to them.
- bin : (specific)
Compile all executables with sources in $(CODEDIR) in optimized
mode and install them in the $(BINOPTD).
- app: Compile and install the application. The include path will
be augmented with the name of the applications subdirectory thereby
allowing an application to maintain a set of include files specific to
it. Also, install any Glish scripts in $(LIBEXECD).
- aps: Compile and install all applications by invoking the
bin target in every applications subdirectory.
- ins: Compile and install all utility programs.
- pkg: Invoke the bin target in the apps
subdirectory.
- scr: Synonym for allsys.
- tst: Synonym for bintest.
- bindbg : (specific)
Compile all executables with sources in $(CODEDIR) in debug mode
and install them in the $(BINDBGD).
- app: Compile and install the application in debug mode. The
include path will be augmented with the name of the applications
subdirectory thereby allowing an application to maintain a set of
include files specific to it.
- aps: Compile and install all applications in debug mode by
invoking the bindbg target in every applications subdirectory.
- bintest : (specific)
Compile and install test programs.
- tst: Invoke the bintest/% pattern rule for each test
program in $(CODEDIR). Delete the intermediate object library
which may be produced for template instantiations created from a
templates file.
- docsys : (general/specific)
Compile and install documentation. Generally this invokes the
docscan and docextr targets in the current directory as
controlled by the DOCEXTR variable in makedefs. Specific
makefiles may then do additional document compilations:
- app: (none)
- aps: (none)
- chk: (none)
- doc: Compile all *.texi, *.latex and *.tex
files in $(CODEDIR) into *.ps POSTSCRIPT files
and install them in the corresponding $AIPSDOCS subdirectory.
Files included by the *.texi, *.latex or *.tex
files will be obtained from the corresponding .dir subdirectory.
Any LATEX-related .bib bibliography files contained in
this directory will be processed by BIBTEX.
Plain-text .text files are simply copied to the $AIPSDOCS
subdirectory, as are .txt, .html, .htm,
.gif, and .jpg files.
Any <!
Date> meta-markups in .html and .htm
files are parsed to record the time of installation.
- ftn: (none)
- imp: (none)
- ins: (none)
- pkg: (none)
- scr: (none)
- top: Recurse into the doc subdirectory.
- tst: (none)
- docscan : (general/specific)
Scan C++ sources building the database used by the document
extractor. The general rule does nothing. Specific makefiles behave as
follows:
- app: (none)
- aps: (none)
- chk: (none)
- doc: (none)
- ftn: (none)
- imp: Run cxx2html in -scan mode for each header file
then recurse into all but test subdirectories.
- ins: (none)
- pkg: Recurse into the implement subdirectory.
- scr: (none)
- top: Recurse into all package subdirectories.
- tst: (none)
- docextr : (general/specific)
Extract documentation from C++ sources. The general rule does
nothing. Specific makefiles behave as follows:
- app: (none)
- aps: (none)
- chk: (none)
- doc: (none)
- ftn: (none)
- imp: Run cxx2html for each header file to extract
documentation from the C++ sources and install it in the
corresponding subdirectory of $AIPSDOCS. Copy any .gif
files to the same place. Then recurse into all but test
subdirectories.
- ins: (none)
- pkg: Recurse into the implement subdirectory.
- scr: (none)
- top: Recurse into all package subdirectories.
- tst: (none)
- The implement makefile includes the system dependency lists and so may
start slowly as it checks to see whether the list is up-to-date (regardless
of whether the particular target uses it or not). Inclusion of the
dependency list can be circumvented by setting the NODEP variable
(to anything). This causes the makefile to start considerably faster.
NODEP is set automatically if gmake (p) is invoked from a
directory which does not reside under $AIPSROOT, that is, a
programmer invokation. However, system-oriented targets may also be
invoked from a programmer directory, and this would cause the dependency
analysis to be circumvented, and the dependency list to be ignored. This
may be legitimate if the target invoked does not actually use the
dependency list, for example chkout, cleancode or
cleansys. In fact, the code distribution system sets NODEP
explicitly when it invokes the top-level makefile for these recursive
targets for the system (see inhale (p)). However, NODEP must
not be set for an invokation of the implement makefile for a target which
does use the dependency list. A proper resolution of this problem would
require the facility for a makefile to examine its target list, but this is
not currently possible.
- If the AIPS++ RCS source code repositories are present in an
installation all AIPS++ makefiles access them via a symbolic link
$AIPSROOT/rcs which is usually set to point to slave.
Therefore, the slave RCS repositories are normally the ones consulted.
However, it is possible to reset the rcs ``switch'' to master
to cause gmake (p) to checkout and/or rebuild AIPS++ from the
master repositories. exhale (p) uses this mechanism when
constructing a new base release. However, it requires good bandwidth to
the master and is only feasible in Socorro.
The following command suffices to clean up the AIPS++ system and rebuild it
in its entirety
cd $AIPSCODE
gmake cleansys allsys
To just compile and install the documentation:
cd $AIPSCODE
gmake docsys
This would recursively compile all POSTSCRIPT documents from the
*.latex, *.tex and *.texi files in the
$AIPSCODE/doc directory tree and install them in the corresponding
$AIPSDOCS subdirectory. ASCII, *.html, *.ps
etc. documents will also be copied across. The document extractor would then
be invoked on the C++ sources (if enabled). Note, however, that no
documents are printed via docsys.
The GNU Make manual.
The GNU manual page for gmake.
The unix manual page for ranlib(1).
AIPS++ variable names (§1.2).
gmake (p), GNU make.
makedefs (p), AIPS++ makefile definitions.
updatelib (p), update an AIPS++ object library.
Next: mkinst
Up: System generation
Previous: Template instantiation
  Contents
  Index
Please send questions or comments about AIPS++ to aips2-request@nrao.edu.
Copyright © 1995-2000 Associated Universities Inc.,
Washington, D.C.
Return to AIPS++ Home Page
2006-10-15