X-Git-Url: https://oss.titaniummirror.com/gitweb/?a=blobdiff_plain;f=tools%2Ftinyos%2Fncc%2Fncc.in;h=b1fee5cec0c51ee8ec6bafcf3759295c7d93471c;hb=4bd1b84d4b3f740cdf859ac6e0a2acdedd972164;hp=4c8d908b3f35bc6723db2753451acf928b4a07a3;hpb=9d1bd142b64b7dc0d68382c29b9e0e6464106778;p=tinyos-2.x.git diff --git a/tools/tinyos/ncc/ncc.in b/tools/tinyos/ncc/ncc.in index 4c8d908b..b1fee5ce 100644 --- a/tools/tinyos/ncc/ncc.in +++ b/tools/tinyos/ncc/ncc.in @@ -26,6 +26,9 @@ else { $platform = "platforms"; } +my $exeflag=0; +my $libs = ""; + # Have fun with the arguments for ($i = 0; $i <= $#ARGV; $i++) { @@ -79,10 +82,22 @@ for ($i = 0; $i <= $#ARGV; $i++) { $strip = 1; push @includes, $file; } + elsif (/^-fnesc-cfile=(.*)/){ + $appfilename=$1; + } + elsif (/^-o$/){ + $exeflag=1; + } + elsif (/^-l/) { + $libs = $libs . " " . $_; + } elsif (/^--version$/) { $print_version = 1; } - } + } elsif ($exeflag) { + $exefilename =$_; + $exeflag=0; + } push @new_args, $_ if !$strip; } @@ -133,6 +148,15 @@ if ($print_target) { foreach $dir (@includes) { if ($dir =~ m!/$target/?$! && -f "$dir/.platform") { $platform_def = "$dir/.platform"; + # Check to see if the platform is a member of a family + if (-f "$dir/.family") { + $family_def = "$dir/.family"; + } + else { + if (-f "$dir/../.family") { + $family_def = "$dir/../.family"; + } + } last; } } @@ -209,7 +233,11 @@ $platform_dir = $platform_def; $platform_dir =~ s!/\.platform$!!; push @includes, $platform_dir unless $nostdinc; do $platform_def; -do $family_def if -f $family_def; +if (-f $family_def) { + $family_dir = $family_def; + $family_dir =~ s!/\.family$!!; + do $family_def +} unshift @new_args, "-DPLATFORM_\U$target"; push @new_args, @opts; @@ -249,7 +277,6 @@ foreach $idir (@includes) { print STDERR join(' ', @new_args), "\n" if $verbose; - exec @new_args; print STDERR "Couldn't execute nescc\n"; exit 2; @@ -277,6 +304,7 @@ sub idir_subst { $rep = $TOSDIR if $char eq "T"; $rep = $target if $char eq "p"; $rep = $platform_dir if $char eq "P"; + $rep = $family_dir if $char eq "F"; &fail("unknown include-path substitution %" . $char) if !$rep; substr($idir, $idx, 2) = $rep; $idx += length $rep;