User`s guide

Chapter 9. Programming tools 89
make
compiles the source codes func1.c and func2.c, and links them with
the NAG library, producing an executable file myprog.
The line .c.: in the example specifies that .c files should be compiled
into .o files using the command on the following tabulated line:
$(CC) -c $(OPTS) $<
The symbol $(CC) is already defined by the make system, but you could
have redefined it to the appropriate compiler in the beginning of the
makefile. The symbol $(OPTS) was defined as follows:
OPTS= -O
Therefore, this symbol is replaced by the string -O, which means code
optimization. The symbol $< refers to the actual .c file. Thus, if we
need to produce the file func1.o, the symbol $< will be replaced by the
filename func1.c.
The dependencies and compiler options for the executable program
myprog are introduced by the lines
myprog: $(OBJECTS)
$(CC) $(LDFLAGS) $(OBJECTS) $(LIBS) -o $@
Here we specify that the program myprog depends on the files defined
by the symbol $(OBJECTS) (e.g., the files func1.o and func2.o). The
compilation command used the default linker options, which are given
by the symbol $(LDFLAGS). The symbol $(LIBS) is replaced by the
string -lnag, which means that the NAG library will be linked with our
program. The symbol $@ refers to the name of the target file, here the
name is myprog.
The command
make clean
can be used to clean up the directory, that is, to remove all the executable
and object files and a possible core file.
You find more information on the make system with the command
man make
9.2 Program Browser
The Program Browser, Xbrowse, provides an interactive environment
in which to view and edit Cray Fortran 90, FORTRAN 77 as its subset
and Cray Standard C codes. Cross-reference information is given about
aspects of the code being browsed and is updated when the code is