LF Fortran 95

The AUTOMAKE Configuration File

The AUTOMAKE configuration file is used to specify the compile and link procedures, and other details required by AUTOMAKE. It consists of a series of records of the form

keyword=value

or

keyword
Where

keyword is an alphanumeric keyword name

value is the string of characters assigned to the keyword.

The keyword name may be preceded by spaces if required. Any record with a '#', '!' or '* ' as the first non blank character is treated as a comment. A '^' appearing at the end of a line indicates a continuation of the command to the next line.

The keywords which may be inserted in the configuration file are:

LF95

Equivalent to specifying the default LF95 compile and link commands.

COMPILE=@lf95 -c %fi -mod %mo
LINK=@lf95 %ob -out %ex -mod %mo

The LF95 keyword should appear in any automake.fig file that is to be used with LF95.

FILES=

Specifies the names of files which are candidates for re-compilation. The value field should contain a single filename optionally including wild-cards. For example,

FILES=*.f90

You can also have multiple FILES= specifications, separated by AND keywords.

FILES=F90\*.F90
AND
FILES=F77\*.FOR
AND
...

Note that, with each new FILES= line. the default COMPILE= is used, unless a new COMPILE= value is specified after the FILES= line and before AND.

Note also that, if multiple FILES= lines are specified, then the %RF place marker cannot be used in any COMPILE= lines.

COMPILE=

Specifies the command to be used to compile a source file. The command may contain place markers, which are expanded as necessary before the command is executed.

For example, below are two separate compile commands:

COMPILE=@lf95 -c %fi

COMPILE=@lf95 -c @%rf -I %id

The string '%fi' in the first example is a place marker which expands to the full name of the file to be compiled. The string '@%rf' in the second example first example is a place marker which expands to a response file containing the names of the files which need to be compiled.

The first example will cause the compiler to be invoked separately for each file that need to be updated. The second example will only require one invocation of the compiler to compile all the necessary files.

The following table is a complete list of place markers and their meanings:

COMPILE= Place Markers

Place Marker

Meaning

%SD

expands to the name of the directory containing the source file - including a trailing '\ '.

%SF

expands to the source file name, excluding the directory and extension.

%SE

expands to the source file extension--including a leading '. '. For example is the file to be compiled is 'f:\source\main.for ', %SD expands to 'f:\source\ ', %SF to 'main ', and %SE to '.for '.

%OD

expands to the name of the directory containing object code, as specified using the OBJDIR= command (see below), including a trailing '\ '.

%OE

expands to the object file extension, as specified using the OBJEXT= command (see below), including a leading '. '.

%ID

expands to the INCLUDE file search list (as specified using INCLUDE= (see below))

%MO

expands to the name of directory containing modules (as specified using MODULE= (see below))

%RF

expands to the name of a response file, created by AUTOMAKE, containing a list of source files. If %RF is present, the compiler is invoked only once.

%FI

is equivalent to %SD%SF%SE

It is possible to invoke the compiler using a command file (batch file, shell script etc.). However, on PCs, it is necessary to preface the batch file name with 'CALL ' or 'COMMAND/C '. For example

COMPILE=CALL fcomp %fi

Note that with LF95 the -c option should usually be used in a COMPILE= line, unless updating a library.

TARGET=

Specifies the name of the program or library file which is to be built from the object code. Note that you will also have to tell the linker the name of the target file. You can do this using a %EX place marker (which expands to the file name specified using TARGET=).

TARGET=f:\execs\MYPROG.EXE

If there is no TARGET= keyword, AUTOMAKE will update the program object code, but will not attempt to re-link.

LINK=

Specifies a command which may be used to update the program or library file once the object code is up to date:

LINK=@lf95 %ob -out %ex -mod %mo'

LINK=@lf95 %od*%oe -out %ex -mod %mo'

LINK=@lf95 %rf -out %ex -mod %mo'

You could use a batch file called 'l.bat ' by specifying

LINK=CALL L

The following place markers are allowed in the command specified using LINK= .

LINK= Place Markers

Place Marker

Meaning

%OD

expands to the name of the directory containing object code, specified using the OBJDIR= command, including a trailing '\ '.

%OE

expands to the object file extension, as specified using the OBJEXT= command, including a leading '. '.

%OB

expands to a list of object files corresponding to source files specified using all FILES= commands.

%EX

expands to the executable file name, as specified using TARGET= .

%MO

expands to the name of directory containing modules (as specified using MODULE= )

%RF

expands to the name of a response file, created by AUTOMAKE, containing a list of object files.

%LI

expands to a list of all library files specified using LIBRARY=

%LL

expands to the name of a response file, created by AUTOMAKE, containing a list of library files (specified using LIBRARY=).

INCLUDE=

May be used to specify the INCLUDE file search list. If no path is specified for an INCLUDEd file, AUTOMAKE looks first in the directory which contains the source file, and after that, in the directories specified using this keyword. The directory names must be separated by semi-colons. For example, on a PC, we might have:

INCLUDE=C:\include;C:\include\sys

Note that the compiler will also have to be told where to look for INCLUDEd files. You can do this using a %ID place marker (which expands to the list of directories specified using INCLUDE).

SYSINCLUDE=

May be used to specify the search list for system INCLUDE files (i.e. any enclosed in angled brackets), as in

#include <stat.h>

If no path is specified, AUTOMAKE looks in the directories specified using this keyword. It does not look in the current directory for system INCLUDE files unless explicitly instructed to. The directory names following SYSINCLUDE= must be separated by semi-colons.

OBJDIR=

May be used to specify the name of the directory in which object files are stored. For example,

OBJDIR=OBJ\

The trailing '\ ' is optional. If OBJDIR= is not specified, AUTOMAKE assumes that source and object files are in the same directory. Note that if source and object files are not in the same directory, the compiler will also have to be told where to put object files. You can do this using a %OD place marker (which expands to the directory specified using OBJDIR ).

OBJEXT=

May be used to specify a non-standard object file extension. For example to specify that object files have the extension '.abc ', specify

OBJEXT=ABC

This option may be useful for dealing with unusual compilers, but more commonly to allow AUTOMAKE to deal with processes other than compilation (for example, you could use AUTOMAKE to ensure that all altered source files are run through a pre-processor prior to compilation).

KEEPOBJDIR

Specifies that the value specified using the OBJDIR= keyword should retain its value until it is explicitly reset. By default the object directory is reset at the start of each compilation phase (i.e. after an AND) to the directory containing the source files. KEEPOBJDIR should be used if object files are in a single directory which is not the same as the source directory.

LIBRARY=

May be used to specify the path name of a library which will be linked into the target file. AUTOMAKE checks the modification time of the library, and forces a re-link if it was created after the target file. Each library must be specified using a separate LIBRARY= keyword.

LIBRARY=Q:\libs\math02.lib

LIBRARY=Q:\libs\graphin.lib

Note that LIBRARY= tells AUTOMAKE about the dependency, but the linker must also be told. In general, the library names must be specified in the LINK= command. You can do this explicitly, or avoid re-typing the names by using a %LI or %LL place marker (see LINK= above).

MODULE=

May be used to specify the name of the directory in which module files are stored.

MODULE=MODS\

The trailing '\ ' is optional. If MODULE= is not specified, AUTOMAKE assumes that source and module files are in the same directory. Note that if source and module files are not in the same directory, the compiler will also have to be told where to put module files. You can do this using a %MO place marker (which expands to the directory specified using MODULE= ).

DEP=

May be used to over-ride the default dependency file name.

DEP=THISPROG.DEP

causes AUTOMAKE to store dependency data in 'thisprog.dep ' instead of 'automake.dep '.

QUITONERROR

Specifies that AUTOMAKE should halt immediately if there is a compilation error.

NOQUITONERROR

Specifies that AUTOMAKE should not halt if there is a compilation error.

MAKEMAKE

Specifies that AUTOMAKE should create a text file called AUTOMAKE.MAK containing dependency information.

DEBUG

Causes AUTOMAKE to write debugging information to a file called AUTOMAKE.DBG .

SCANONLY

Specifies that files in the current section (i.e. since the previous AND ) may be scanned, but not compiled. This may cause files in other sections to be re-compiled. For example, a Fortran 95 module in the current section may be USEd by a file in another section, and the latter may be re-compiled when the module is changed.

COMPILEONLY

Specifies that files in the current section (i.e. since the previous AND ) may be compiled if needed, but should not be included in the list of object files (generated using %RF in the LINK= command) to be linked. This may be useful if the files are part of a library.

LATESCAN

Delays scanning of source files until the last possible moment, and can, in some cases, remove the need for some scans. However this option is NOT compatible with Fortran 90 modules.

CHECK=

May be used to specify a command to be inserted after each compilation. A typical application would be to check for compilation errors. For example, under MS-DOS:

CHECK=IF ERRORLEVEL 2 GOTO QUIT

would cause the update procedure to abort if there is a compilation error.

$INSERT=

specifies that further directives should be read from the specified file. AUTOMAKE returns to read the remainder of the current file after the end of the inserted file.

$INSERT=Q:\prog1\standard.fig

An inserted file may itself contain a $INSERT= keyword, but further nesting is not allowed.