$TOSDIR = $ENV{"TOSDIR"} if defined($ENV{"TOSDIR"});
$nescc = "@nescc_prefix@/bin/nescc";
$tossim = 0;
+$is_tos_1 = 0;
+$with_scheduler_flag = 1;
# Support platform directory renaming for 2.x
if (-d "$TOSDIR/platform") {
$platform = "platform";
+ $is_tos_1 = 1;
}
else {
$platform = "platforms";
}
+my $exeflag=0;
+my $libs = "";
+
# Have fun with the arguments
for ($i = 0; $i <= $#ARGV; $i++) {
$TOSDIR = $1;
$strip = 1;
}
+ elsif (/^-tosscheduler=(.*)/) {
+ $scheduler = $1;
+ $strip = 1;
+ }
elsif (/^-nostdinc$/) {
$nostdinc = 1;
}
$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;
}
}
}
+if (!defined $scheduler && !$is_tos_1) {
+ $scheduler = "TinySchedulerC,TinySchedulerC.TaskBasic,TaskBasic,TaskBasic,runTask,postTask";
+}
+
if ($print_target) {
print $target, "\n";
exit 0;
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;
}
}
$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;
+if(!$is_tos_1) {
+ unshift @new_args, "-fnesc-scheduler=$scheduler";
+}
# old nesdoc: set the default topdir based on TOSDIR
my ($tosparent) = ($TOSDIR =~ m!^(.*)/.*?$!);
print STDERR join(' ', @new_args), "\n" if $verbose;
-
exec @new_args;
print STDERR "Couldn't execute nescc\n";
exit 2;
$rep = "%" if $char eq "%";
$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;