Command Format: f77 -o output source
output - the name of the executable file
source - the name of the Fortran source code file
The -o option tells the f77 utility to tell the link editor to use
the specified name for the output instead of the default a.out.
NOTE: It is not necessary for the -o option to appear after
the f77 command. The filename that appears after the -
o is the name of the output file. For example, f77
source -o output is the same as f77 -o output source.
Sample Session:
$f77 -o hello hello.f
$hello
Hello from main!
Calling function1!
Hello from function1!
Back from function1!
Calling function2!
Hello from function2!
Back from function2!
That's all!
$
Command Format: f77 -c main.f sub1.f sub2.f
-c = Compile, but do not load object files. This option
causes f77 to compile and/or assemble source code
programs and leave the corresponding object programs
in files with filename extensions of .o.
Sample Session:
$f77 -c main.f sub1.f sub2.f
main.f:
MAIN: calling:
sub1.f:
sub1:
sub2.f:
sub2:
$ls a.out *.o
a.out not found
funct1.o
funct2.o
hello.o
main.o
sub1.o
sub2.o
$
The -c options causes the compilation system to suppress the link
edit phase. This produces an object file or files, in this example
(main.o sub1.o sub2.o), that can be link edited at a later time
with the f77 command with no options.
5.15 FORTRAN: Compiling Object Files to Produce an Executable
Module
The command to produce an executable nodule from several object
files is done in the following manner:
Command Format: f77 obj_1 obj_2 obj_3
obj_1 through obj_n - the object files
Three files are created by the compiler. They are identified by
the same filename as the source code but with a different
extension. They have the extensions .IDY, .INT, and .LST.
NOTE: The extensions are uppercase characters. UNIX is case
sensitive.
Sample Session:
$cobol teacher.cob
$ls teacher*
teacher.IDY
teacher.INT
teacher.LST
teacher.cob
$