Getting Started Documentation Glish Learn More Programming Contact Us
Version 1.9 Build 1556
News FAQ
Search Home


next up previous contents index
Next: makedefs adjuncts Up: System generation Previous: gmake

Subsections



makedefs

Installation-specific definitions used by the AIPS++ makefiles.

Synopsis

makedefs

Description

The makedefs file is a GNU makefile which defines variables and rules common to all AIPS++ makefiles. It contains comments addressed to AIPS++ managers who must construct and maintain a site-specific version and as such is intended to be self-documenting. However, the following notes are provided as a general overview.

Default definitions

The AIPS++ makedefs files contain definitions used by the AIPS++ makefiles for object libraries, include directories and paths, compiler options and the like.

Every AIPS++ makefile includes the default makedefs file at an early stage via a sequence similar to the following:

   # AIPS++ fundamentals.
   #---------------------
   AIPSROOT := $(word 1, $(AIPSPATH))
   AIPSARCH := $(AIPSROOT)/$(word 2, $(AIPSPATH))
   include $(AIPSARCH)/makedefs

(see §1.2 for AIPS++ variable names).

The default makedefs guarantees to supply a definition for every primary variable used by the AIPS++ makefiles to control compilations. While the default values supplied for some of these are unlikely to be correct, they are provided as an indication of what may need to be redefined in the site-specific makedefs file for each architecture.

The default makedefs file also defines many other variables, such as directory locations, which are applicable to all AIPS++ installations and do not need to be redefined.

Site-specific definitions

While $AIPSARCH/makedefs contains generic definitions of variables used in the AIPS++ makefiles, a number of these have no sensible defaults and must be redefined on a site-wide basis for each architecture in $AIPSSITE/makedefs1.1.3 describes the AIPS++ system directory structure). The default file includes the site-specific file and definitions made in the latter override those of the former.

Part of the process of installing AIPS++ involves defining the site-specific makedefs (p[*]) file. The installation utility, configure (p[*]), provides a template version tailored for each architecture and requires the installer to carefully read through the default makedefs file and make the appropriate redefinitions. configure then uses testdefs (p[*]) to ensure that all of the definitions are sensible.

As an example, the default makedefs file contains the following definitions for the location of the X11 windowing system's include files and libraries:

   X11ROOT  := /usr/local/X11
   X11INCD   = $(X11ROOT)/include
   X11LIB    = -L$(X11ROOT)/lib -lX11

Note that X11ROOT is defined as a ``simply expanded'' variable in GNU make. These are defined using ``:='' and are evaluated immediately. On the other hand, X11INCD and X11LIB are defined as ``recursively expanded'' variables expressed in terms of X11ROOT. Recursively expanded variables are defined using ``='' and are evaluated when used. This construct allows the site-specific makedefs files to redefine X11ROOT without necessarily needing to redefine the other two.

As an example, supposing that X11 was installed locally in /usr/X11 with include files and libraries in the usual include and lib subdirectories, then the site-specific makedefs need only make the following redefinition:

   X11ROOT  := /usr/X11

Note that all variable definitions in the site-specific makedefs files should be ``simply expanded''. In general the site-specific files should not redefine any more than is necessary; this is particularly the case for AIPS++ consortium installations which are continually evolving. For example, if at some later time an AIPS++ application was written which used the Athena widget set, then the default value of X11LIB might be reset to

   X11LIB    = -L$(X11ROOT)/lib -lXaw -lX11

and in the above example the change to the default value of X11LIB would have effect without any changes required to the site-specific makedefs. On the other hand, if the site-specific makedefs file had redefined X11LIB then it would have to be amended to add the Xaw library.

System versus programmer usage

As described in the entry for makefiles (p[*]), the AIPS++ makefiles serve the dual purpose of directing both system and programmer compilations. These programmer-oriented definitions are only of interest in AIPS++ development systems and may safely be ignored in production line installations.

System and programmer oriented variables and rules mostly reside together in the makefiles without conflict. To help resolve the few cases where conflicts can occur makedefs sets a variable, MAKEMODE, to either ``system'' or ``programmer'' depending on whether the gmake (p[*]) was initiated from a system or programmer directory. It is currently used to choose the default target and to circumvent certain time consuming system dependency analyses which are not required for programmer compilations.

Other variables defined within makedefs

The default makedefs defines a collection of variables which are not permitted to be redefined in the site-specific makedefs. Of these, one group may be redefined on the gmake (p[*]) command line. These mainly define the location of AIPS++ directories and although there are rare occasions when the AIPS++ code distribution system needs to reset them, this should never be necessary in normal usage.

A second small group of ``immutable'' variables defined at the start of makedefs are used mainly for job control and syntactic purposes in the AIPS++ makefiles. These are not permitted to be redefined even on the gmake command line.

Rules defined in makedefs

A cursory glance through $AIPSARCH/makedefs will be sufficient to show that it contains much more than just default variable definitions. In fact, it is a self-contained GNU makefile and can be, and is, invoked by itself by some parts of the AIPS++ build system. However, these ``nether'' sections of makedefs can safely be ignored by AIPS++ system managers.

Since it is included by all AIPS++ makefiles, makedefs is the appropriate place to define the many rules which are common to all of them. It would be very difficult if not impossible to understand the functioning of any of the AIPS++ makefiles without reference to makedefs.

The main pattern rule defined within makedefs is that for checking out source code (if the AIPS++ installation includes RCS repositories). Apart from that, makedefs contains many static rules; their definitions fall into several categories (refer to the GNU make manual for an explanation of how rules are written):

Organized by category, makedefs (p[*]) declares and possibly lists dependencies and defines rules for the following targets (see also makefiles (p[*])):

The makefile targets are discussed in detail elsewhere (§10.6).

Notes

Files

$AIPSARCH/makedefs
...defaults values.

$AIPSSITE/makedefs
...site-specific values for each architecture.

See also

The GNU make manual.
The GNU manual page for gmake.
AIPS++ variable names (§1.2).
configure (p[*]), the AIPS++ installation script.
gmake (p[*]), GNU make.
makedefs adjuncts (p[*]), Per-sourcefile makedefs definitions.
makefiles (p[*]), GNU makefiles used to rebuild AIPS++.
testdefs (p[*]), test makedefs definitions.

Author

Original: 1992/05/01 by Mark Calabretta, ATNF


next up previous contents index
Next: makedefs adjuncts Up: System generation Previous: gmake   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