• Aucun résultat trouvé

Compiling Programs

Dans le document Host System (Page 25-30)

2. 1 Commands for Program Development

2.2 Compiling Programs

following example, the VAXELN Pascal compiler compiles the source

$ EPASCAL/DEaUG MYFILE

This command generates the object module file MYFILE.OBJ.

2.2.1 EPASCAL Command

The syntax for the EP ASCAL command and its qualifiers follows:

$ EP ASCAL[ {/ command-qualifier} . .. ] source-file-spec [ {

{~

} file-spec / positional-qualifier}

[ {

{~

} file-spec [ {/positional-qualifier} ] } ... ] ] command-qualifier

A command qualifier, which can appear after the EP ASCAL command or after a file specification. In many cases, the default settings for the EP ASCAL command are sufficient for compiling source files. However, by specifying the command with qualifiers, you can precisely control the compilation. For example, you can tell the VAXELN Pascal compiler to include debugger information in the object module by specifying the /DEBUG qualifier with the EP ASCAL command.

source-file-spec

A standard VAX/VMS file specification that represents the source file to be compiled. If you do not specify a file type, the compiler uses the default file type PAS. If you enter a command without a file specification, the operating system prompts you for a file:

$ EPASCAL I RETURN I

_File:

file-spec

A standard VAX/VMS file specification that designates an object library or object module whose exported declarations are to be included during compilation. Libraries have the default file type aLB and object modules have the default file type OBJ. You can specify up to eight object libraries in a command; you can specify any number of object modules. Separate multiple file specifications with commas or plus signs.

The first library and first module file specifications you specify must be followed by the /LIBRARY and /MODULE qualifiers, respectively.

Subsequent files can be listed without the qualifier; a positional qualifier affects the files that follow it up to the next file preceding a positional qualifier. For example:

$ EPASCAL PROG+ELN$:RTLOBJECT/LIBRARY+ELN$:RTL+NEWLIB+DEFS/MODULE+BASIC_DEFS This command line includes six file specifications - a source file cation, three object library specifications, and two object module specifi-cations. PROG is the source file being compiled. The /LIBRARY qualifier affects the object libraries specified by ELN$:RTLOBJECT, ELN$:RTL, and NEWLIB. The /MODULE qualifier affects the object modules specified by DEFS and BASIC_DEFS.

positional-qualifier

The qualifier /LIBRARY or /MODULE.

You can specify another name for an object file or listing file by including a file specification with the /OBJECT or /LIST qualifier. For example, the following command generates the listing file MYFILELIST.LIS and the object file MYFILE.OBJ:

$ EPASCAL/DEBUG/LIST-MYFlLELIST MYFlLE

The following example compiles the source file MYFILE.P AS and gener-ates the object file MYOBJECTFILE.OBJ:

$ EPASCAL/DEBUG/OBJECT-MYOBJECTFlLE MYFlLE

For more information about the EPASCAL-command and its qualifiers, see the V AXELN Pascal Language Reference Manual or use the HELP facility:

$ HELP EPASCAL

2.2.2 CC Command

The syntax for the CC command and its qualifiers follows:

$ CC[/ qualifier ... ] file-spec-list[/ qualifier ... ] /qualifier

Specifies an action to be performed by the compiler or a special input file property. You can specify multiple qualifiers. In many cases, the default settings for the CC command are sufficient for compiling source files.

However, by specifying the command with qualifiers, you can precisely control the compilation. For example, you can tell the VAX C compiler to include debugger information in the object module by specifying the /DEBUG qualifier with the CC command.

You can append qualifiers to the CC command or to individual file specifications. If you include a qualifier in a list of files to be concatenated, the qualifier affects all the files in the list.

You can use the /LIBRARY qualifier with one or more input files that are part of a list of files separated by plus signs (+). This qualifier indicates that the file is a text library that can contain source text.

For more information about the CC command and its qualifiers, see the V AXELN C Run-Time Library Reference Manual or the VAX C User's Guide, or use the HELP facility:

$ HELP cc file-spec-list

Specifies one or more source files to be compiled. Separate the file specifications with commas (,) or plus signs (+). If you separate source file specifications with commas, the programs are compiled separately. If you separate source file specifications with plus signs, the files are joined and compiled as one program. If you enter a command without a file specification, the operating system prompts you for a file:

$ cc I RETURN I _File:

The default file type for VAX C source files is C. If a file specification is qualified with /LIBRARY, the default file type is TLB.

You can specify another name for an object file or listing file by including a file specification with the jOBJECT or jLIST qualifier. For example, the following command generates the listing file MYFILELIST.LIS and the object file MYFILE.OBJ:

$ CC/DEBUG/LIST=MYFlLELIST MYFlLE

The following example compiles the source file MYFILE.P AS and gener-ates the object file MYOBJECTFILE.OBJ:

$ CC/DEBUG/OBJECT=MYOBJECTFILE MYFlLE

For more information about specifying file specifications with the CC command, see the V AXELN C Run-Time Library Reference Manual and the VAX C User's Guide.

2.2.3 FORTRAN Command

The syntax for the FORTRAN command and its qualifiers follows:

$ FORTRAN[j qualifier ... ] file-spec-list[j qualifier . .. ] jqualifier

Specifies an action to be performed by the compiler or a special input file property. You can specify multiple qualifiers. In many cases, the default settings for the FORTRAN command are sufficient for compiling source files. However, by specifying the command with qualifiers, you can precisely control the compilation. For example, you can tell the VAX FORTRAN compiler to include debugger information in the object module by specifying the jDEBUG qualifier with the FORTRAN command.

NOTE

When you use the jDEBUG qualifier with the FORTRAN command, you should also use the jNOOPTIMIZE qualifier.

You can append qualifiers to the FORTRAN command or to individual file specifications. If you include a qualifier in a list of files to be concatenated, the qualifier affects all the files in the list.

You can use the jLIBRARY qualifier with one or more input files that are part of a list of files separated by plus signs ( +). This qualifier indicates that the file is a text library that can contain source text.

For more information about the FORTRAN command and its qualifiers, file specifications with commas, the programs are compiled separately. If you separate source file specifications with plus signs, the files are joined and compiled as one program. If you enter a command without a file specification, the operating system prompts you for a file:

$ FORTRAN I RET I

]ile:

The default file type for VAX FORTRAN source files is FOR. If a file specification is qualified with /LIBRARY, the default file type is OLB.

You can specify another name for an object file or listing file by including a file specification with the /OBJECT or /LIST qualifier. For example, the following command generates the listing file MYFILELIST.LIS and the object file MYFILE.OBJ:

$ FORTRAN/DEBUG/LIST-MYFILELIST MYFILE

The following example compiles the source file MYFILE.FOR and gener-ates the object file MYOBJECTFILE.OBJ:

$ FORTRAN/DEBUG/OBJECT-MYOBJECTFILE MYFILE

For more information about specifying file specifications with the FORTRAN command, see the VAX FORTRAN User's Guide.

Dans le document Host System (Page 25-30)