📄 ncc.html
字号:
<html><head><title>ncc Manual Page</title></head><body><h3>NAME</h3><blockquote>ncc - nesC compiler for TinyOS</blockquote><h3>SYNOPSIS</h3><blockquote>ncc [<b>-target=pc|mica|mica2|mica2dot|...</b>][<b>-tosdir=</b><u>dir</u>][<b>-print-tosdir</b>][<b>-print-platforms</b>][<b>-nostdinc</b>][<b>-board=micasb|basicsb|micawb|...</b>][<b>-docdir=</b><u>dir</u>][<b>-topdir=</b><u>dir</u>][<b>-graphviz=y|n</b>][<b>-fnesc-nido-tosnodes=</b><u>n</u>][<b>-fnesc-cfile=</b><u>file</u>][<b>-fnesc-no-inline</b>[<b>-Wnesc-</b><u>xxx</u>][any gcc option]<u>files</u>...</blockquote><h3>DESCRIPTION</h3><blockquote>ncc is an extension to gcc that knows how to compile nesC applications. Ifinvoked on regular C files, it behaves exactly like gcc. When invoked on anesC component or interface (.nc extension) file it compiles and links(except if the usual <b>-c</b>, <b>-S</b>, <b>-E</b> or<b>-fsyntax-only</b> options are used) that component with the other filesspecified on the command line.<p>The additional options recognized by ncc over gcc are:<p><b>-target=X</b> <blockquote> specify the target architecturefor this compilation. If pc is specified, the compilation uses the tossimenvironment and produces a locally executable file. The default target ismica, the possible targets are set by the TinyOS distribution (see the tos/platforms directory). A platform that is not in the TinyOS distributioncan be used if its directory is specified with an explicit -I directive(the platform name is taken from the directory's name, platform directoriesare recognised by the presence of a <code>.platform</code> file).</blockquote><b>-tosdir=</b><u>dir</u><blockquote> specify the location of TinyOS. Thislocation can also be specified with the `TOSDIR' environment variable. If thevariable and the option are both given, ncc uses the value specified withthe option. If neither the environment variable or option are specified,ncc uses its compiled-in TinyOS directory.</blockquote><b>-print-tosdir</b><blockquote> print the TinyOS directory to be used andexit, taking into account the -tosdir option and `TOSDIR' environmentvariable. No compilation occurs when -print-tosdir is used.</blockquote><b>-print-platforms</b><blockquote> print the valid TinyOS platforms,including those made available by explicit -I directives (see -target discussion above).</blockquote><b>-nostdinc</b><blockquote> do not automatically include the TinyOSdirectories in the search path. See the discussion of search paths belowfor more details.</blockquote><b>-board=Y</b><blockquote> specify one (or more) sensor boards. Thiseffects the search path and preprocessor symbols. The set of boards is setby the TinyOS distribution (see the tos/sensorboardsdirectory). As with targets, a sensorboard directory can be madeavailable via an explicit -I directive (sensorboard directories arerecognised by the presence of a <code>.sensor</code> file).</blockquote><b>-docdir=</b><u>dir</u><blockquote> generate documentation for thecompiled component in directory <u>dir</u>.</blockquote><b>-topdir=dir</b><blockquote> specify directory paths that should bestripped from the source file names when generating "package names"for the documentation files. The directory above TOSDIR isautomatically added, so this option is only needed for directoriesoutside the main TinyOS distribution.</blockquote><b>-graphviz=y|n</b><blockquote> explicitly enable or disable the use of thegraphviz tool in the generated documentation. Without this option, graphvizis enabled iff the `dot' program is found in the current path. Use ofgraphviz requires `dot'. The documentation generation tool checks theversion of `dot', and enables client-side image maps, if supported.</blockquote><b>-fnesc-tossim-tosnodes=</b><u>n</u><blockquote> specify the maximumnumber of nodes that can be simulated in the tossimenvironment.</blockquote><b>-fnesc-cfile=file</b><blockquote> specify a file in which to save the Ccode generated when compiling a component. Note: if you specify twocomponents on the command line, then the C code from the second one willoverwrite the C code from the first.</blockquote>There are a number of warnings specific to nesC, specified with <b>-Wnesc-X</b>, where X is (all these warnings are off by default):<blockquote><li><b>fnptr</b>: Warn when function pointers are used (use of functionpointers is deprecated in nesC and leads to inaccurate data racedetection).<li><b>async</b>: Warn when interrupt handlers call commands or events notannotated with <b>async</b>.<li><b>data-race</b>: Warn about potential data races.<li><b>combine</b>: Warn when configuration wiring leads to "fan-out" andthe function return type does not have a combining function defined.<li><b>docstring</b>: Warn when unexpected documentation strings (startingwith /**) are seen.<li><b>all</b>: Turns on <b>fnptr</b>, <b>async</b>, <b>combine</b> and<b>data-race</b>.<li><b>error</b>: Turns the <b>fnptr</b>, <b>async</b>, <b>combine</b> and<b>data-race</b> warnings into errors.</blockquote><p>When compiling a nesC component, the nesC compiler recognizes the gcc Clanguage (<b>-f...</b>) and warning (<b>-W...</b>) options. The <b>-S</b>,<b>-c</b> and <b>-o</b> options work as usual, the <b>-x</b> option accepts<b>nesc</b>. Directories can be added to nesC's search path with <b>-I</b>(see the search path discussion below).<p>If you wish to compile a component Bar.nc to a C file, you can do:<p><blockquote>ncc -c -o /dev/null -fnesc-cfile=Bar.c Bar.nc</blockquote></blockquote><h3>SEARCH PATH</h3><blockquote>ncc performs the following substitutions on the directories specified withthe <b>-I</b> option: <b>%T</b> is replaced by the TinyOS directory,<b>%p</b> is replaced by the selected target, <b>%%</b> is replaced by<b>%</b>.<p>Except when -nostdinc is specified, the search path for nesC components isas follows, where <u>tosdir</u> is the TinyOS directory requested and<u>target</u> is the selected target:<ol><li>./<li><b>-I</b> directives (in option order)<li>%T/sensorboards/<u>boardname</u>, for each<b>-board=</b><u>boardname</u> option specified (in option order) -except if the sensorboard was found via an explicit -I directive<li>%T/platform/%p - except if the platform was found via anexplicit -I directive<li>Additional directories requested by the selected target (e.g.,%T/platform/avrmote for the mica target)<li>%T/interfaces<li>%T/system<li>%T/lib<li>`NESCPATH' environment variable directories (note that %T and %psubsitution is not performed on these directories).</ol>When <b>-nostdinc</b> is specified, the search path is simply:<ol><li>./<li><b>-I</b> directives<li>`NESCPATH' environment variable directories</ol></blockquote><h3>PREPROCESSOR SYMBOLS</h3><blockquote>ncc defines the following preprocessor symbols:<ul><li>NESC (since v1.1) set to XYZ where x.yz is the nesC version<li>PLATFORM_<u>target</u> (where <u>target</u> is the selected target name,converted to upper case)<li>BOARD_<u>boardname</u> for each <b>-board=</b><u>boardname</u> option (theboardname is converted to upper case)</ul></blockquote><h3>ENVIRONMENT VARIABLES</h3><blockquote>If the -tosdir=dir option is not used, the `TOSDIR' environment variablespecifies the location of TinyOS.<p>`NESCPATH' is a colon separated list of additional search directories fornesC components.</blockquote><h3>SEE ALSO</h3><blockquote>gcc(1), avr-gcc(1)</blockquote><h3>NOTES</h3>ncc is built over nescc, which handles the non-TinyOS-specificfunctionality of ncc. Users of nesC in a non-TinyOS context mayprefer to use nescc (see the source code of ncc and nescc fordetails).The warnings for the new nesC 1.1 features (see <code>-Wnesc-all</code>)are off by default to increase compatibility with nesC 1.0 code. To matchthe language specification in the nesC 1.1 reference manual, you shouldcompile with <code>-Wnesc-all</code> and <code>-Wnesc-error</code>. Theseoptions will become the default in future releases.</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -