]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tools/tinyos/ncc/ncc.in
Added functionality for setting the TOS scheduler via flag to ncc. Updated .platform...
[tinyos-2.x.git] / tools / tinyos / ncc / ncc.in
index 2adbaa52bfebf4bb80c0cbd23b578fccce160d43..4c8d908b3f35bc6723db2753451acf928b4a07a3 100644 (file)
@@ -14,10 +14,13 @@ $TOSDIR = "@TOSDIR@";
 $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";
@@ -38,6 +41,10 @@ for ($i = 0; $i <= $#ARGV; $i++) {
            $TOSDIR = $1;
            $strip = 1;
        }
+       elsif (/^-tosscheduler=(.*)/) {
+           $scheduler = $1;
+           $strip = 1;
+       }
        elsif (/^-nostdinc$/) {
            $nostdinc = 1;
        }
@@ -113,6 +120,10 @@ if (!defined $target) {
     }
 }
 
+if (!defined $scheduler && !$is_tos_1) {
+       $scheduler = "TinySchedulerC,TinySchedulerC.TaskBasic,TaskBasic,TaskBasic,runTask,postTask";
+}
+
 if ($print_target) {
     print $target, "\n";
     exit 0;
@@ -202,6 +213,9 @@ do $family_def if -f $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!^(.*)/.*?$!);