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


next up previous contents index
Next: executive - Tool Up: misc - Module Previous: ftptest - Function


make - Function



Package utility
Module misc


Function for a production system


Synopsis
make(target, args, makefile, Execute, script, debug) include "make.g"



Description

make

make implements a production system. A production system makes a product or products according to some well-specified rules. It is of very widespread applicability but it's best suited to automating a set of steps that must be carried out in sequence but with some variation if, for example, a given product is sometimes available and sometimes not. The principle is familiar to users of the Unix make system, on which make is built. make keeps track of which files have changed and knows to remake dependent products.

make needs a makefile that specifies the production rules.

.SUFFIXES: .image .ms .fits

.fits.ms :
	glish include 'ms.g';m:=fitstoms('$@', '$<');m.done();

.ms.image :
	glish include 'imager.g';myimgr:=imager('$<');myimgr.advise(takeadvice=T,fieldofview='2arcmin');myimgr.makeimage('observed','$@');myimgr.done();

clean:
	shell rm -rf *.fits *.ms *.image

data:
	shell cp ${AIPSROOT}/data/demo/3C273XC1.fits .

By using this makefile, make knows how to make the image, 3C273XC1.image, from the MeasurementSet, 3C273XC1.ms, and it knows how to make the MeasurementSet from the original FITS file. The glish commands are:

include 'make.g';
make('clean');
make('data');
make('3C273XC1.image');

The arguments allowed are:

    -D <VARIABLE>
        define <VARIABLE> to be 1

    -I <DIR>
        Specify a directory in which to search for makefiles
        and included makefiles.

    -d flags
        Turn on debugging, and specify which portions of make are to
        print debugging information.  Flags is one or more of the following:

           A       Print all possible debugging information; equivalent to
                   specifying all of the debugging flags.

           d       Print debugging information about directory searching and
                   caching.

           g1      Print the input graph before making anything.

           g2      Print the input graph after making everything, or before
                   exiting on error.

           m       Print debugging information about making targets,
                   including modification dates.

           s       Print debugging information about suffix-transformation
                   rules.

           t       Print debugging information about target list
                   maintenance.

           v       Print debugging information about variable assignment.

    -e      Specify that environmental variables override macro assignments
            within makefiles.

If a script is specified, then make generates the commands and writes these to the script file. If the argument execute is set to T then the commands are also executed. If one of the command fails then the make is terminated at that point.



Arguments

target   Target to be constructed
    Allowed: String
args   Arguments
    Allowed: String
makefile   Makefile to be used
    Allowed: File name
    Default: 'makefile'
Execute   Execute commands
    Allowed: Bool
    Default: T
script   Name of script file to be written
    Allowed: String
debug   Write debugging information?
    Allowed: Bool
    Default: F


Returns
Bool


Example
include 'make.g';
make('clean');
make('data');
make('3C273XC1.image');





next up previous contents index
Next: executive - Tool Up: misc - Module Previous: ftptest - Function   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