[Tinyos-2-commits] CVS: tinyos-2.x/tools/tinyos/ncc ncc.in, 1.7, 1.8
John Regehr
regehr at users.sourceforge.net
Fri May 30 21:32:04 PDT 2008
Update of /cvsroot/tinyos/tinyos-2.x/tools/tinyos/ncc
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv27788
Modified Files:
ncc.in
Log Message:
now we call deputy through nesc-compile, not from here
Index: ncc.in
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tools/tinyos/ncc/ncc.in,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** ncc.in 6 Mar 2008 03:40:24 -0000 1.7
--- ncc.in 31 May 2008 04:32:00 -0000 1.8
***************
*** 85,89 ****
elsif (/^-safe$/) {
$safe = 1;
! $strip = 1;
}
elsif (/^-fnesc-cfile=(.*)/){
--- 85,89 ----
elsif (/^-safe$/) {
$safe = 1;
! $_ = "-fnesc-safe";
}
elsif (/^-fnesc-cfile=(.*)/){
***************
*** 140,155 ****
}
- my $cpp;
- my $deputyasmexe;
- my $gcc;
-
- if(defined $safe) {
- my $safe_home = $TOSDIR."/lib/safe";
- push @new_args, "-fnesc-include=${safe_home}/include/annots_stage1";
- push @new_args, "-fnesc-genprefix=#include \"${safe_home}/include/annots_stage2.h\"";
- }
-
if ($safe) {
if (($target eq "mica2") or ($target eq "micaz")) {
$mcu = "avr";
--- 140,147 ----
}
if ($safe) {
+ my $safe_home = $ENV{'TOSDIR'}."/lib/safe";
+
if (($target eq "mica2") or ($target eq "micaz")) {
$mcu = "avr";
***************
*** 163,207 ****
}
- my $deputy_include = $ENV{'DEPUTY_HOME'}."/include";
-
- push @new_args, "-DSAFE_TINYOS";
- push @new_args, "-conly";
push @new_args, "-fnesc-deputy";
- if (!defined $appfilename) {
- $appfilename="build/${target}/app.c";
- }
- if (!defined $exefilename) {
- $exefilename="build/${target}/main.exe";
- }
-
- $appfilename =~ m/^((.*\/)?)[^\/]+$/;
- my $directory = $1;
-
- # Might be useful to keep this app.c somewhere...
- # This could probably be avoided by using the deputy script
- # instead of the executable directly...
- $cpp = "${mcu}-gcc -E -DSAFE_TINYOS $appfilename -o ${directory}deputy-in.c -I${safe_home}/include";
-
- # Not worrying about racing protection, for now...
- # --checksnescatomic racing.txt
- $deputyasmexe = "deputy-${mcu} --FLIDs --out ${directory}deputy-out.c ${directory}deputy-in.c";
-
$failfile = "${TOSDIR}/lib/safe/${mcu}/fail.c";
! my $gccflags;
! if (($target eq "mica2") or ($target eq "micaz")) {
! $gccflags = ("-mmcu=atmega128 -Os -fdollars-in-identifiers " .
! "-finline-limit=1000000 -Winline " .
! "--param inline-unit-growth=1000000 " .
! "--param large-function-growth=1000000");
! }
! elsif($target eq "telosb"){
! $gccflags = "-Os -mdisable-hwmul -mmcu=msp430x1611";
! }
!
! $gcc = ("${mcu}-gcc $gccflags -I${deputy_include} ${directory}deputy-out.c " .
! "$failfile -o $exefilename $libs");
!
}
--- 155,169 ----
}
push @new_args, "-fnesc-deputy";
$failfile = "${TOSDIR}/lib/safe/${mcu}/fail.c";
! my $deputy_args = "-I${safe_home}/include " .
! "--FLIDs " .
! "--envmachine " .
! "-DSAFE_TINYOS " .
! "--nolib";
! push @new_args, "-fnesc-deputy-args=$deputy_args";
! push @new_args, "$failfile";
}
***************
*** 335,360 ****
print STDERR join(' ', @new_args), "\n" if $verbose;
!
! if ($safe) {
!
! # nescc runs and puts in annotations like COUNT etc...
! system(@new_args)==0 or die "Couldn't execute nescc\n";
!
! # cpp changes annotations into attributes for deputy
! print STDERR "${cpp}\n" if $verbose;
! system($cpp)==0 or die "gcc preprocess error!\n";
!
! # deputy inserts the checks
! print STDERR "${deputyasmexe}\n" if $verbose;
! system($deputyasmexe)==0 or die "deputy error!\n";
!
! print STDERR "${gcc}\n" if $verbose;
! system($gcc)==0 or die "cil error!\n";
!
! } else {
! exec @new_args;
! print STDERR "Couldn't execute nescc\n";
! exit 2;
! }
sub extractarg {
--- 297,303 ----
print STDERR join(' ', @new_args), "\n" if $verbose;
! exec @new_args;
! print STDERR "Couldn't execute nescc\n";
! exit 2;
sub extractarg {
More information about the Tinyos-2-commits
mailing list