changeset 329:7839cb3e928f

add task/config/tasks.xml lib/tasks.xml
author aaa
date Fri, 12 Jun 2009 15:29:27 +0900
parents bd3690d8cd7c
children 71ca8637fcc1
files bin/cerium example/task_config/tasks.xml lib/tasks.xml
diffstat 3 files changed, 131 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/bin/cerium	Fri Jun 12 02:15:06 2009 +0900
+++ b/bin/cerium	Fri Jun 12 15:29:27 2009 +0900
@@ -2,6 +2,8 @@
 
 use strict;
 
+use XML::LibXML;
+
 my $command = shift;
 my $main = "main.cc";
 my $task_config = "tasks.xml";
@@ -184,6 +186,10 @@
 }
 
 sub make {
+
+    return if ( ! -e $task_config );
+    my $xml = XML::LibXML->new();
+    my @nodes = $doc->findnodes('//surface');
 }
 
 __END__
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/example/task_config/tasks.xml	Fri Jun 12 15:29:27 2009 +0900
@@ -0,0 +1,76 @@
+<!-- Cerium Task Configuration 
+     CPU_PPE = 0, // default                                                   
+     CPU_SPE = 1,
+     SPE_ANY = CPU_SPE,
+     SPE_0 = 2,
+     SPE_1 = 3,
+     SPE_2 = 4,
+     SPE_3 = 5,
+     SPE_4 = 6,
+     SPE_5 = 7,
+  -->
+
+<directory>
+  <path> Task </path>
+  <task name="Hello">
+    <target>
+      <path> spe </path>
+      <cpu> SPE_ANY </cpu>
+      <cc cc:compiler="spu-g++"/>
+    </target>
+    
+    <target>
+      <path> ppe </path>
+      <cpu> CPU_PPE </cpu>
+      <cc cc:compiler="ppu-g++"/>
+    </target>
+    
+    <target>
+      <path> macosx </path>
+      <cpu> CPU_PPE </cpu>
+      <cc cc:compiler="mac-g++"/>
+    </target>
+
+    <target name="linux">
+      <path> linux </path>
+      <cpu> CPU_PPE </cpu>
+      <cc cc:compiler="linux-g++"/>
+    </target>
+
+    <source> Hello.cc </source>
+  </task>
+
+</directory>
+
+<directory>
+  <path> ${CERIUM}/Renderer/Task </path>
+  <task name="Hello">
+    <target name="cell">
+      <path> spe </path>
+      <cpu> SPE_ANY </cpu>
+      <cc cc:compiler="spu-g++"/>
+    </target>
+    
+    <target name="cell">
+      <path> ppe </path>
+      <cpu> CPU_PPE </cpu>
+      <cc cc:compiler="ppu-g++"/>
+    </target>
+    
+    <target name="macosx">
+      <path> macosx </path>
+      <cpu> CPU_PPE </cpu>
+      <cc cc:compiler="mac-g++"/>
+    </target>
+
+    <target name="linux">
+      <path> linux </path>
+      <cpu> CPU_PPE </cpu>
+      <cc cc:compiler="linux-g++"/>
+    </target>
+    
+    <source> Hello.cc </source>
+    
+  </task>
+
+</directory>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lib/tasks.xml	Fri Jun 12 15:29:27 2009 +0900
@@ -0,0 +1,49 @@
+<!-- Cerium Task Configuration 
+    CPU_PPE = 0, // default                                                   
+    CPU_SPE = 1,
+    SPE_ANY = CPU_SPE,
+    SPE_0 = 2,
+    SPE_1 = 3,
+    SPE_2 = 4,
+    SPE_3 = 5,
+    SPE_4 = 6,
+    SPE_5 = 7,
+-->
+
+<cc name="spu-g++"> 
+  <compiler>
+    <command> spu-g++ </command>
+    <flag> -O9 -g -Wall -fno-exceptions -fno-rtti </flag>
+    <flag> -I../${CERIUM}/include/TaskManager -I. -I.. </flag>
+  </compiler>
+  <linker>
+    <command> spu-g++ </command>
+    <flag> -L../${CERIUM}/TaskManager -lspemanager </flag>  
+  </linker>
+</cc>
+
+<cc name="ppu-g++"> 
+  <compiler>
+    <command> g++ </command>
+    <flag> -g -Wall -O9 </flag>
+    <flag> -I${CERIUM}/include/TaskManager -I. -I.. </flag>
+  </compiler>
+  <linker>
+    <command> g++ </command>
+    <flag> -L${CERIUM}/TaskManager </flag>
+    <flag> -lCellManager -lspe2 -lpthread -Wl,--gc-sections </flag>
+  </linker>
+</cc>
+
+<cc name="mac-g++"> 
+  <compiler>
+    <command> g++ </command>
+    <flag> -g -Wall -O9 </flag>
+    <flag> -I${CERIUM}/include/TaskManager -I. -I.. </flag>
+  </compiler>
+  <linker>
+    <command> g++ </command>
+    <flag> -L${CERIUM}/TaskManager </flag>
+    <flag> ${CERIUM}/TaskManager -lFifoManager `sdl-config --libs` </flag>
+  </linker>
+</cc>