Getting Started | Documentation | Glish | Learn More | Programming | Contact Us |
Version 1.9 Build 1556 |
|
Use of the AIPS++ makefiles for code development.
makefile
makefile.{app,aps,chk,doc,ftn,imp,pkg,scr,tst}
The AIPS++ code development 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 (p). 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''.
Programmer-oriented variables:
Rules for programmer-oriented targets look for source files first in the programmer directory and if not found search the corresponding subdirectory of $AIPSCODE which is referred to below as $(CODEDIR). This means that programmers can compile code in their own workspace without having to copy source files from $(CODEDIR), thereby minimizing the number of files that need to be present in the programmer's workspace and reducing the possibility that these may be ``stale''.
Certain variables are defined in makedefs (p) for the exclusive use of programmer-oriented rules and may be redefined as necessary on the gmake (p) command line. These are:
The default makedefs sets this to $PGMRARCH if that directory exists (but the site-specific makedefs may redefine it).
Output is left in the current directory if $PGMRINCD is blank.
The default makedefs sets this to $PGMRARCH/aux if that directory exists (but the site-specific makedefs may redefine it).
Output is left in the current directory if $PGMRAUXD is blank.
The default makedefs sets this to $PGMRARCH/lib if that directory exists (but the site-specific makedefs may redefine it).
Output is left in the current directory if $PGMRLIBD is blank.
The default makedefs sets this to $PGMRARCH/bin if that directory exists (but the site-specific makedefs may redefine it).
Output is left in the current directory if $PGMRBIND is blank.
The default makedefs sets this to $PGMRARCH/ptrepository as a suggestion and for the convenience of the site-specific makedefs in setting compiler options. However, the site-specific makedefs may redefine it or simply ignore it, and PGMRPTRD is not used directly by any of the makefiles.
Defaults to a compiler-specific directory if blank.
These variables may be printed with the show_prg target. The *FLAGS variables are the subject of a convention for setting alternate programmer compilation flags described in the section on 11.3.
Programmer-oriented targets:
The programmer-oriented targets are as follows; note that where targets are defined in terms of a gmake (p) variable, for example $(SUBDIRS), it, and all other variables, may be printed via the show_all target:
Note that since this target has the potential to delete much more than was possibly desired by the programmer it is advisable to do a dry run using
gmake -n cleanest
before using it.
The include path will be augmented with current directory (i.e. -I.) and of the corresponding system directory, $(CODEDIR), in that order. This allows an application to maintain a set of include files specific to it.
The executable will be linked against the library list specified by $(PGMRLIBS) in which private programmer libraries are listed before system libraries (see above).
The executable will be left in $(PGMRBIND).
This rule may be used in conjunction with update_mylib to update several library modules in one invokation of gmake (p) without updating the library for each one. For example,
gmake Bloggs Boggle update_mylib
Note that this is not the same as
gmake Bloggs.o Boggle.o update_mylib
Which may cause the object modules to be compiled even if the library modules are up-to-date with respect to their sources.
The executable will be linked against the library list specified by $(PGMRLIBS) in which private programmer libraries are listed before system libraries (see above).
The executable will be left in $(PGMRBIND).
Included files will be searched for in the corresponding .dir subdirectory of the current directory and of $(CODEDIR) in that order. Any LATEX-related .bib bibliography files contained in these directories will be processed by BIBTEX.
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 (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.
The mylib target for the implement makefile rebuilds a programmer's private library in its entirety, including all object modules generated from sources in $(CODEDIR). To rebuild only the modules with sources in the programmer's directory the following would suffice:
cd $HOME/aips++/code/aips/implement gmake
This is the recommended way of updating a private libarary.
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.
mkinst (p), Generate template instantiation files from a list.
updatelib (p), update an AIPS++ object library.