📄 ncc.1
字号:
.TH ncc 1 "April 27, 2004".LO 1.SH NAMEncc - nesC compiler for TinyOS.SH SYNOPSIS\fBncc\fR [\fB-target=\fIpc|mica|mica2|mica2dot|...\fR] [\fB-tossim\fR] [\fB-board=\fImicasb|basicsb|micawb|...\fR] [\fB-tosdir=\fIdir\fR] [\fB-nostdinc\fR] [\fB--version\fR] [\fB-print-tosdir\fR] [\fB-print-platforms\fR] [\fB-print-target\fR] [any nescc option] [any gcc option] \fIfiles\fR....SH DESCRIPTION\fBncc\fR is an extension to \fBnescc\fR that knows how to compile nesCapplications for a TinyOS environment. If invoked on regular C files, itbehaves like \fBgcc\fR. When invoked on a nesC component orinterface (\fB.nc\fR extension) file it compiles and links (except if theusual \fB-c\fR, \fB-S\fR, \fB-E\fR or \fB-fsyntax-only\fR options are used)that component with the other files specified on the command line.\fBncc\fR just invokes \fBnescc\fR with extra options based on the selected platform and sensorboard(s). And \fBnescc\fR itself justinvokes \fBgcc\fR. Thus, for a full understanding of possible \fBncc\fRoptions you should read the \fBnescc\fR and \fBgcc\fR man pages..SH OPTIONS\fBncc\fR accepts all \fBgcc\fR and \fBnescc\fR options, and some additional TinyOS specific options:.TP\fB-target=\fIX\fR Specify the target architecture for this compilation. If \fB-tossim\fR isalso specified, the compilation uses the tossim environment and produces alocally executable file. The default target is specified in the\fB.default-platform\fR file in your TinyOS directory (see \fB-tosdir\fRoption), and defaults to \fBmica\fR if that file is absent. A platform that is not in the TinyOS distribution can be usedif its directory is specified with an explicit -I directive (the platformname is taken from the directory's name, platform directories arerecognised by the presence of a \fB.platform\fR file)..TP\fB-tosdir=\fIdir\fR Specify the location of TinyOS. This location can also be specified withthe \fBTOSDIR\fR environment variable. If the variable and the option are bothgiven, \fBncc\fR uses the value specified with the option. If neither theenvironment variable or option are specified, ncc uses its compiled-inTinyOS directory..TP\fB-tosscheduler=\fIcomponent,unique-string,interface-name,interface-definition,run-event,post-command\fR By default, nesC compiles uses of \fBtask void\fR \fItaskname\fR\fB() ...\fR to \fBvoid\fR \fItaskname\fR\fB()\fR, and \fBpost\fR \fItaskname\fR\fB()\fR to \fBTOS_post\fR\fB(\fR\fItaskname\fR\fB)\fR..IPWith this option, each task gets its own \fIinterface-definition\fR interface, the task implementation is transformed into a \fIrun-event event\fR and posts becomes a call to the \fIpost-command\fR command. This per-task interface is automatically connected to the parameterised \fIinterface-name\fR interface of scheduler \fIcomponent\fR component. The parameter id for the connection is chosen with \fBunique\fR("\fIunique-string\fR")..IPIf this option is not set explicity, its parameters are assigned by default as follows:.IP-tosscheduler=\fITinySchedulerC,TinySchedulerC.TaskBasic,TaskBasic,TaskBasic,runTask,postTask\fR.TP\fB-tossim\fRCompile for the TOSSIM environment rather than a native platform. Everydirectory in the search path will be duplicated, with the first copy having\fB/sim\fR appended to it..TP\fB-print-tosdir\fRPrint the TinyOS directory to be used and exit, taking into account the\fB-tosdir\fR option and \fBTOSDIR\fR environment variable. No compilationoccurs when \fB-print-tosdir\fR is used..TP\fB-print-platforms\fRPrint the valid TinyOS platforms, including those made available byexplicit \fB-I\fR directives (see \fB-target\fR option)..TP\fB-print-target\fRPrint the name of the selected target. Most useful when \fB-target\fR is notspecified..TP\fB-nostdinc\fRDo not automatically include the TinyOS directories in the search path. Seethe discussion of search paths below for more details..TP\fB-board=\fIY\fRSpecify one (or more) sensor boards. This effects the search path andpreprocessor symbols. The set of boards is set by the TinyOS distribution(see the \fBtos/sensorboards\fR directory). As with targets, a sensorboarddirectory can be made available via an explicit \fB-I\fR directive(sensorboard directories are recognised by the presence of a \fB.sensor\fRfile)..TP\fB--version\fRPrint the version of \fBncc\fR, \fBnescc\fR and of the gcc compilerused for the selected target..SH EXAMPLESIf you wish to compile a component Bar.nc to a C file, you can do:.IPncc -c -o /dev/null -fnesc-cfile=Bar.c Bar.nc.SH SEARCH PATH\fBncc\fR performs the following substitutions on the directoriesspecified with the \fB-I\fR option: \fB%T\fR is replaced by the TinyOSdirectory, \fB%p\fR is replaced by the selected target, \fB%P\fR isreplaced by the target's platform directory, \fB%%\fR is replaced by\fB%\fR.Except when \fB-nostdinc\fR is specified, the search path for nesCcomponents is as follows, where \fItosdir\fR is the TinyOS directoryrequested and \fItarget\fR is the selected target:.IP *The current directory.IP *\fB-I\fR directives (in option order).IP *%T/sensorboards/\fIboardname\fR, for each\fB-board=\fIboardname\fR option specified (in option order) -except if the sensorboard was found via an explicit -I directive.IP *%T/platform/%p - except if the platform was found via anexplicit -I directive.IP *Additional directories requested by the selected target (e.g.,%T/platform/avrmote for the mica target).IP *%T/interfaces.IP *%T/system.IP *%T/lib.IP *\fBNESCPATH\fR environment variable directories (note that %T and %psubsitution is not performed on these directories)..PPWhen \fB-nostdinc\fR is specified, the search path is simply:.IP *The current directory.IP *\fB-I\fR directives.IP *\fBNESCPATH\fR environment variable directories.SH PREPROCESSOR SYMBOLSIn addition to the preprocessor symbols defined by \fBgcc\fR and\fBnescc\fR, \fBncc\fR defines:.TP\fBPLATFORM_\fItarget\fR where \fItarget\fR is the selected target name, converted to upper case.TP\fBBOARD_\fIboardname\fR for each \fB-board=\fIboardname\fR option (theboardname is converted to upper case).SH ENVIRONMENT VARIABLES.TP.B TOSDIRIf the \fB-tosdir=\fIdir\fR option is not used, the \fBTOSDIR\fRenvironment variable specifies the location of TinyOS..SH SEE ALSO.IR gcc (1),platform-specific gcc,.IR nescc (1).SH NOTES\fBncc\fR is built over \fBnescc\fR, which handles the non-TinyOS-specificfunctionality of \fBncc\fR. Users of nesC in a non-TinyOS context mayprefer to use \fBnescc\fR (see the source code of ncc and nescc fordetails).
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -