Command switches for stand-alone tools, Neuron c compiler – Echelon Neuron C User Manual

Page 227

Advertising
background image

Neuron C Programmer’s Guide

215

Important: Specify the

scriptfile

script file in such a way that it does not

overwrite the default script file, or any other script file you want to preserve. The
- -mkscript command allows for constant command flow tracking, and thus

overwrites existing files without warning.

- -warning

text

(Display

text

as a warning)

This command is only useful in script files. It displays the message

text

, and

indicates the message as a warning. The - -mkscript

command automatically

inserts a - -warning command into the generated script if the tool that executed

the monitored command stream failed to complete without error.
When using the machine-generated script file, a warning states that the script
was machine-generated, and based on a possible erroneous command stream.

Command Switches for Stand-alone Tools

The most useful and common command switches are documented in this section

for each of the stand-alone tools.

Neuron C Compiler

The Neuron C compiler is named ncc.exe. You can run the stand-alone compiler

from the command prompt to produce a Neuron assembly source file. The

compiler command line contains the name of the executable file, then zero or
more optional command switches, and finally the file name to compile.

Example:
C:\>NCC mycode.nc

The most interesting switches are the -D (- -define) and -I (- -include) switches.

You can use the -D switch to define a symbol from the command line, which can

then be tested from the program using the #ifdef and #ifndef directives.

You can use the -I (- -include) switch to specify a directory containing include

files. You can specify additional include directories with additional -I switches.
The search order corresponds to the order of the switches, if you specify more

than one -I switch.

Example:

C:\>ncc -DVERSION5 -I..\include -Id:\include mycode.nc

When run for a filename with a .nc extension, the Neuron C compiler uses

Neuron C rules for code generation. Libraries and custom system images cannot
contain Neuron C code. To compile a pure C file, and use pure C rules for code

generation, the filename must end with a .c extension as shown in the command

line example below:

Example:
C:\>ncc -I..\include mycode.c

As a final, complete example, to compile myfile.nc with a myinc.h include file in a
subdirectory named myincs, and to define the OPTION1 symbol for conditional

compilation purposes, run the command shown below:

Example:

Advertising