📄 ncc manual page.mht
字号:
From: <óé Microsoft Internet Explorer 5 ±£′?>
Subject: ncc Manual Page
Date: Wed, 1 Aug 2007 15:18:10 +0800
MIME-Version: 1.0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Content-Location: http://www.tinyos.net/tinyos-1.x/doc/nesc/ncc.html
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>ncc Manual Page</TITLE>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2900.2180" name=3DGENERATOR></HEAD>
<BODY>
<H3>NAME</H3>
<BLOCKQUOTE>ncc - nesC compiler for TinyOS </BLOCKQUOTE>
<H3>SYNOPSIS</H3>
<BLOCKQUOTE>ncc [<B>-target=3Dpc|mica|mica2|mica2dot|...</B>]=20
[<B>-tosdir=3D</B><U>dir</U>] [<B>-print-tosdir</B>] =
[<B>-print-platforms</B>]=20
[<B>-nostdinc</B>] [<B>-board=3Dmicasb|basicsb|micawb|...</B>]=20
[<B>-docdir=3D</B><U>dir</U>] [<B>-topdir=3D</B><U>dir</U>] =
[<B>-graphviz=3Dy|n</B>]=20
[<B>-fnesc-nido-tosnodes=3D</B><U>n</U>] =
[<B>-fnesc-cfile=3D</B><U>file</U>]=20
[<B>-fnesc-no-inline</B> [<B>-Wnesc-</B><U>xxx</U>] [any gcc option]=20
<U>files</U>... </BLOCKQUOTE>
<H3>DESCRIPTION</H3>
<BLOCKQUOTE>ncc is an extension to gcc that knows how to compile nesC=20
applications. If invoked on regular C files, it behaves exactly like =
gcc. When=20
invoked on a nesC component or interface (.nc extension) file it =
compiles and=20
links (except if the usual <B>-c</B>, <B>-S</B>, <B>-E</B> or=20
<B>-fsyntax-only</B> options are used) that component with the other =
files=20
specified on the command line.=20
<P>The additional options recognized by ncc over gcc are:=20
<P><B>-target=3DX</B>=20
<BLOCKQUOTE>specify the target architecture for this compilation. If =
pc is=20
specified, the compilation uses the tossim environment and produces =
a=20
locally executable file. The default target is mica, the possible =
targets=20
are set by the TinyOS distribution (see the tos/platforms =
directory). A=20
platform that is not in the TinyOS distribution can be used if its =
directory=20
is specified with an explicit -I directive (the platform name is =
taken from=20
the directory's name, platform directories are recognised by the =
presence of=20
a <CODE>.platform</CODE> file). =
</BLOCKQUOTE><B>-tosdir=3D</B><U>dir</U>
<BLOCKQUOTE>specify the location of TinyOS. This location can also be=20
specified with the `TOSDIR' environment variable. If the variable =
and the=20
option are both given, ncc uses the value specified with the option. =
If=20
neither the environment variable or option are specified, ncc uses =
its=20
compiled-in TinyOS directory.</BLOCKQUOTE><B>-print-tosdir</B>
<BLOCKQUOTE>print the TinyOS directory to be used and exit, taking =
into=20
account the -tosdir option and `TOSDIR' environment variable. No =
compilation=20
occurs when -print-tosdir is =
used.</BLOCKQUOTE><B>-print-platforms</B>
<BLOCKQUOTE>print the valid TinyOS platforms, including those made =
available=20
by explicit -I directives (see -target discussion=20
above).</BLOCKQUOTE><B>-nostdinc</B>
<BLOCKQUOTE>do not automatically include the TinyOS directories in the =
search path. See the discussion of search paths below for more=20
details.</BLOCKQUOTE><B>-board=3DY</B>
<BLOCKQUOTE>specify one (or more) sensor boards. This effects the =
search=20
path and preprocessor symbols. The set of boards is set by the =
TinyOS=20
distribution (see the tos/sensorboards directory). As with targets, =
a=20
sensorboard directory can be made available via an explicit -I =
directive=20
(sensorboard directories are recognised by the presence of a=20
<CODE>.sensor</CODE> file).</BLOCKQUOTE><B>-docdir=3D</B><U>dir</U>
<BLOCKQUOTE>generate documentation for the compiled component in =
directory=20
<U>dir</U>.</BLOCKQUOTE><B>-topdir=3Ddir</B>
<BLOCKQUOTE>specify directory paths that should be stripped from the =
source=20
file names when generating "package names" for the documentation =
files. The=20
directory above TOSDIR is automatically added, so this option is =
only needed=20
for directories outside the main TinyOS distribution.=20
</BLOCKQUOTE><B>-graphviz=3Dy|n</B>
<BLOCKQUOTE>explicitly enable or disable the use of the graphviz tool =
in the=20
generated documentation. Without this option, graphviz is enabled =
iff the=20
`dot' program is found in the current path. Use of graphviz requires =
`dot'.=20
The documentation generation tool checks the version of `dot', and =
enables=20
client-side image maps, if supported.=20
</BLOCKQUOTE><B>-fnesc-tossim-tosnodes=3D</B><U>n</U>
<BLOCKQUOTE>specify the maximum number of nodes that can be simulated =
in the=20
tossim environment.</BLOCKQUOTE><B>-fnesc-cfile=3Dfile</B>
<BLOCKQUOTE>specify a file in which to save the C code generated when=20
compiling a component. Note: if you specify two components on the =
command=20
line, then the C code from the second one will overwrite the C code =
from the=20
first.</BLOCKQUOTE>There are a number of warnings specific to nesC, =
specified=20
with <B>-Wnesc-X</B>, where X is (all these warnings are off by =
default):=20
<BLOCKQUOTE>
<LI><B>fnptr</B>: Warn when function pointers are used (use of =
function=20
pointers is deprecated in nesC and leads to inaccurate data race =
detection).=20
<LI><B>async</B>: Warn when interrupt handlers call commands or =
events not=20
annotated with <B>async</B>.=20
<LI><B>data-race</B>: Warn about potential data races.=20
<LI><B>combine</B>: Warn when configuration wiring leads to =
"fan-out" and=20
the function return type does not have a combining function defined. =
<LI><B>docstring</B>: Warn when unexpected documentation strings =
(starting=20
with /**) are seen.=20
<LI><B>all</B>: Turns on <B>fnptr</B>, <B>async</B>, <B>combine</B> =
and=20
<B>data-race</B>.=20
<LI><B>error</B>: Turns the <B>fnptr</B>, <B>async</B>, =
<B>combine</B> and=20
<B>data-race</B> warnings into errors. </LI></BLOCKQUOTE>
<P>When compiling a nesC component, the nesC compiler recognizes the =
gcc C=20
language (<B>-f...</B>) and warning (<B>-W...</B>) options. The =
<B>-S</B>,=20
<B>-c</B> and <B>-o</B> options work as usual, the <B>-x</B> option =
accepts=20
<B>nesc</B>. Directories can be added to nesC's search path with =
<B>-I</B>=20
(see the search path discussion below).=20
<P>If you wish to compile a component Bar.nc to a C file, you can do:=20
<P>
<BLOCKQUOTE>ncc -c -o /dev/null -fnesc-cfile=3DBar.c Bar.nc=20
</BLOCKQUOTE></BLOCKQUOTE>
<H3>SEARCH PATH</H3>
<BLOCKQUOTE>ncc performs the following substitutions on the directories=20
specified with the <B>-I</B> option: <B>%T</B> is replaced by the =
TinyOS=20
directory, <B>%p</B> is replaced by the selected target, <B>%%</B> is =
replaced=20
by <B>%</B>.=20
<P>Except when -nostdinc is specified, the search path for nesC =
components is=20
as follows, where <U>tosdir</U> is the TinyOS directory requested and=20
<U>target</U> is the selected target:=20
<OL>
<LI>./=20
<LI><B>-I</B> directives (in option order)=20
<LI>%T/sensorboards/<U>boardname</U>, for each=20
<B>-board=3D</B><U>boardname</U> option specified (in option order) =
- except=20
if the sensorboard was found via an explicit -I directive=20
<LI>%T/platform/%p - except if the platform was found via an =
explicit -I=20
directive=20
<LI>Additional directories requested by the selected target (e.g.,=20
%T/platform/avrmote for the mica target)=20
<LI>%T/interfaces=20
<LI>%T/system=20
<LI>%T/lib=20
<LI>`NESCPATH' environment variable directories (note that %T and %p =
subsitution is not performed on these directories). </LI></OL>When=20
<B>-nostdinc</B> is specified, the search path is simply:=20
<OL>
<LI>./=20
<LI><B>-I</B> directives=20
<LI>`NESCPATH' environment variable directories =
</LI></OL></BLOCKQUOTE>
<H3>PREPROCESSOR SYMBOLS</H3>
<BLOCKQUOTE>ncc defines the following preprocessor symbols:=20
<UL>
<LI>NESC (since v1.1) set to XYZ where x.yz is the nesC version=20
<LI>PLATFORM_<U>target</U> (where <U>target</U> is the selected =
target name,=20
converted to upper case)=20
<LI>BOARD_<U>boardname</U> for each <B>-board=3D</B><U>boardname</U> =
option=20
(the boardname is converted to upper case) </LI></UL></BLOCKQUOTE>
<H3>ENVIRONMENT VARIABLES</H3>
<BLOCKQUOTE>If the -tosdir=3Ddir option is not used, the `TOSDIR' =
environment=20
variable specifies the location of TinyOS.=20
<P>`NESCPATH' is a colon separated list of additional search =
directories for=20
nesC components. </P></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-specific=20
functionality of ncc. Users of nesC in a non-TinyOS context may prefer =
to use=20
nescc (see the source code of ncc and nescc for details). The warnings =
for the=20
new nesC 1.1 features (see <CODE>-Wnesc-all</CODE>) are off by default =
to=20
increase compatibility with nesC 1.0 code. To match the language =
specification=20
in the nesC 1.1 reference manual, you should compile with=20
<CODE>-Wnesc-all</CODE> and <CODE>-Wnesc-error</CODE>. These options =
will become=20
the default in future releases. </BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -