Everything
2.4.1 Command line operation

The compilation driver (ccrl) identifies the extension of the input file, and then starts the compiler, assembler, and linker. Alphabetical extensions are not case sensitive.

-

If the input file has the extension .s or .asm, the compilation driver assumes it is an assembly language file, and starts the assembler.

-

If the input file has the extension .c, the compilation driver assumes it is a C source file, and starts the compiler.

-

If the input file has the extension .cpp, .cc, or .cp, the compilation driver assumes that it is a C++ source file, and starts the compiler.

-

If the input file has the extension .obj, the compilation driver assumes that it is an object file, and starts the linker.

If the input file has an extension other than the above, the compilation driver assumes that the file is a C source file, and starts the compiler.

You can specify the language standard of C source files and C++ source files by using the -lang option.

(1)

Specification format

Enter the following on the command line.

>ccrl[Δoption]...Δfilefileoption]...
>asrl[Δoption]...Δfilefileoption]...
>rlink[{Δfileoption}...]

 

option: Option name

file: File name

[ ]: Can be omitted

...: Pattern in preceding [ ] can be repeated

{ }: Select from items delimited by the pipe symbol ("|")

Δ: One or more spaces

[, ...]: The preceding pattern can be repeated by delimiting each with a comma.

[: ...]: The preceding pattern can be repeated by delimiting each with a colon.

string := A: string is replaced with A.

string := A | B | C: string is replaced with any one of A, B, or C.

 

The following points should be noted when entering a command.

-

The specification formats of options depend on the command that is used.
See "2.5.1 Compile options", "2.5.2 Assemble options" and "2.5.3 Link options" for cautions about options of each command.

-

A file name supported by Windows can be specified.
To specify a file name, specify a relative path or an absolute path beginning with a drive name.
"-" cannot be also used at the beginning of a file name because it is regarded as the option specification.
"(" and ")" cannot be also used for a file name because they are regarded as the part of link options.

-

The length that can be specified for a file name depends on Windows (up to 259 characters).

-

Uppercase characters and lowercase characters are not distinguished for the alphabet of a file name.

-

Two or more files can be specified as input.
Files which have different types (C source file and assembly source file or object file, and the like) can be mixed.
Note that two or more files having the same source file name except for the extension cannot be specified (even when they are stored in separate folders).
In this case, even if there is an error in one file, processing of the remaining files will continue if processing is possible.
The generated object files are not deleted after linking.

(2)

Example of operations

The examples of operations on the command line are shown below.

Remark

See "2.5 Option" for details about each option.

(a)

Performing compilation, assembly, and linking by one command

C source file "file1.c" is compiled by ccrl, and then assembly source file "file1.asm" is generated.

Next, assembly source file "file1.asm" and "file2.asm" are assembled by asrl, and then object file "file1.obj" and "file2.obj" are generated.

The assemble list files are output to the current folder.

Finally, object file "file1.obj", "file2.obj", and "file3.obj" are linked by rlink, and then link map file "sample.map" and load module file "sample.abs" are generated.

>ccrl file1.c file2.asm file3.obj -asmopt=-prn_path -lnkopt=-list -osample.abs -cpu=S2 -dev=dr5f100pj.dvf

Remark

In the ccrl command line, use the -asmopt option to specify an option dedicated to asrl; to specify an option dedicated to rlink, use the -lnkopt option.

(b)

Performing compilation and assembly by one command, and linking separately

C source file "file1.c" is compiled by ccrl, and then assembly source file "file1.asm" is generated.

Next, assembly source file "file1.asm" and "file2.asm" are assembled by asrl, and then object file "file1.obj" and "file2.obj" are generated.

The assemble list files are output to the current folder.

>ccrl -c file1.c file2.asm -asmopt=-prn_path -cpu=S2 -dev=dr5f100pj.dvf

Remark

In the ccrl command line, use the -asmopt option to specify an option dedicated to asrl.

 

Object file "file1.obj", "file2.obj", and "file3.obj" are linked by rlink, and then link map file "sample.map" and load module file "sample.abs" are generated.

>rlink file1.obj file2.obj file3.obj -output=sample.abs -list

(c)

Performing compilation, assembly, and linking separately

C source file "file1.c" is compiled by ccrl, and then assembly source file "file1.asm" is generated.

>ccrl -S file1.c -cpu=S2 -dev=dr5f100pj.dvf

 

Assembly source file "file1.asm" and "file2.asm" are assembled by asrl, and then object file "file1.obj" and "file2.obj" are generated.

Assemble list files are also output.

>asrl file1.asm -prn_path -cpu=S2 -dev=dr5f100pj.dvf
>asrl file2.asm -prn_path -cpu=S2 -dev=dr5f100pj.dvf

 

Object file "file1.obj", "file2.obj", and "file3.obj" are linked by rlink, and then link map file "sample.map" and load module file "sample.abs" are generated.

>rlink file1.obj file2.obj file3.obj -output=sample.abs -list