changeset 260:af07173af3f4

change example
author e065746@localhost.localdomain
date Wed, 03 Jun 2009 20:36:18 +0900
parents 08820e4f8812
children ca13cee5fd7c 6774e3e92539
files example/post_function/Makefile example/post_function/Makefile.cell example/post_function/Makefile.def example/post_function/Makefile.ps3 example/post_function/main.cc example/post_function/spe/Makefile example/renew_task/Makefile example/renew_task/Makefile.cell example/renew_task/Makefile.def example/renew_task/Makefile.ps3 example/renew_task/main.cc example/renew_task/spe/Makefile
diffstat 12 files changed, 96 insertions(+), 107 deletions(-) [+]
line wrap: on
line diff
--- a/example/post_function/Makefile	Wed Jun 03 19:46:30 2009 +0900
+++ b/example/post_function/Makefile	Wed Jun 03 20:36:18 2009 +0900
@@ -8,13 +8,13 @@
 	@echo "Make for Linux"
 	@$(MAKE) -f Makefile.linux
 
-ps3: FORCE
-	@echo "Make for PS3 (Cell)"
-	@$(MAKE) -f Makefile.ps3
+cell: FORCE
+	@echo "Make for CELL (Cell)"
+	@$(MAKE) -f Makefile.cell
 
 FORCE:
 
 clean:
 	@$(MAKE) -f Makefile.macosx clean
 	@$(MAKE) -f Makefile.linux clean
-	@$(MAKE) -f Makefile.ps3 clean
\ No newline at end of file
+	@$(MAKE) -f Makefile.cell clean
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/example/post_function/Makefile.cell	Wed Jun 03 20:36:18 2009 +0900
@@ -0,0 +1,39 @@
+include ./Makefile.def
+
+SRCS_TMP = $(wildcard *.cc)
+SRCS_EXCLUDE =  # 除外するファイルを書く
+SRCS = $(filter-out $(SRCS_EXCLUDE),$(SRCS_TMP))
+OBJS = $(SRCS:.cc=.o)
+
+TASK_DIR  = ppe
+TASK_SRCS_TMP = $(wildcard $(TASK_DIR)/*.cc)
+TASK_SRCS_EXCLUDE = 
+TASK_SRCS = $(filter-out $(TASK_DIR)/$(TASK_SRCS_EXCLUDE),$(TASK_SRCS_TMP))
+TASK_OBJS = $(TASK_SRCS:.cc=.o)
+
+LIBS += -lCellManager -lspe2 -lpthread -Wl,--gc-sections 
+
+.SUFFIXES: .cc .o
+
+.cc.o:
+	$(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@
+
+all: $(TARGET) speobject
+
+$(TARGET): $(OBJS) $(TASK_OBJS)
+	$(CC) -o $@ $(OBJS) $(TASK_OBJS) $(LIBS)
+
+speobject:
+	cd spe; $(MAKE)
+
+link:
+	$(CC) -o $(TARGET) $(OBJS) $(TASK_OBJS) $(LIBS)
+
+debug: $(TARGET)
+	sudo ppu-gdb ./$(TARGET) 
+
+clean:
+	rm -f $(TARGET) $(OBJS) $(TASK_OBJS)
+	rm -f *~ \#*
+	rm -f ppe/*~ ppe/\#*
+	cd spe; $(MAKE) clean
--- a/example/post_function/Makefile.def	Wed Jun 03 19:46:30 2009 +0900
+++ b/example/post_function/Makefile.def	Wed Jun 03 20:36:18 2009 +0900
@@ -5,7 +5,7 @@
 #CERIUM = /Users/gongo/Source/Cerium
 
 # ex: linux/ps3
-CERIUM = /home/gongo/Cerium
+CERIUM = ../../../Cerium
 
 CC      = g++
 CFLAGS  = -g -Wall -O9
--- a/example/post_function/Makefile.ps3	Wed Jun 03 19:46:30 2009 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-include ./Makefile.def
-
-SRCS_TMP = $(wildcard *.cc)
-SRCS_EXCLUDE =  # 除外するファイルを書く
-SRCS = $(filter-out $(SRCS_EXCLUDE),$(SRCS_TMP))
-OBJS = $(SRCS:.cc=.o)
-
-TASK_DIR  = ppe
-TASK_SRCS_TMP = $(wildcard $(TASK_DIR)/*.cc)
-TASK_SRCS_EXCLUDE = 
-TASK_SRCS = $(filter-out $(TASK_DIR)/$(TASK_SRCS_EXCLUDE),$(TASK_SRCS_TMP))
-TASK_OBJS = $(TASK_SRCS:.cc=.o)
-
-LIBS += -lCellManager -lspe2 -lpthread -Wl,--gc-sections 
-
-.SUFFIXES: .cc .o
-
-.cc.o:
-	$(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@
-
-all: $(TARGET) speobject
-
-$(TARGET): $(OBJS) $(TASK_OBJS)
-	$(CC) -o $@ $(OBJS) $(TASK_OBJS) $(LIBS)
-
-speobject:
-	cd spe; $(MAKE)
-
-link:
-	$(CC) -o $(TARGET) $(OBJS) $(TASK_OBJS) $(LIBS)
-
-debug: $(TARGET)
-	sudo ppu-gdb ./$(TARGET) 
-
-clean:
-	rm -f $(TARGET) $(OBJS) $(TASK_OBJS)
-	rm -f *~ \#*
-	rm -f ppe/*~ ppe/\#*
-	cd spe; $(MAKE) clean
--- a/example/post_function/main.cc	Wed Jun 03 19:46:30 2009 +0900
+++ b/example/post_function/main.cc	Wed Jun 03 20:36:18 2009 +0900
@@ -8,7 +8,7 @@
 
 static int count = 1;
 
-char *help_str = "Usage: ./post [-cpu spe_num] [-count N]\n\
+const char *usr_help_str = "Usage: ./post [-cpu spe_num] [-count N]\n\
   -count  Number of print \"Hello, World!!\"";
 
 void
@@ -35,10 +35,6 @@
 	if (strcmp(argv[i], "-count") == 0) {
             count = atoi(argv[++i]);
         }
-        if (strcmp(argv[i], "--help") == 0) {
-            printf("%s\n", help_str);
-            return -1;
-        }
     }
 
     return 0;
@@ -57,7 +53,7 @@
 }
 
 int
-cerium_main(int argc, char *argv[])
+TMmain(int argc, char *argv[])
 {
     if (init(argc, argv) < 0) {
 	return -1;
--- a/example/post_function/spe/Makefile	Wed Jun 03 19:46:30 2009 +0900
+++ b/example/post_function/spe/Makefile	Wed Jun 03 20:36:18 2009 +0900
@@ -8,8 +8,8 @@
 
 CC      = spu-g++
 CFLAGS  = -g -Wall -fno-exceptions -fno-rtti #-DDEBUG
-INCLUDE = -I${CERIUM}/include/TaskManager -I. -I..
-LIBS = -L${CERIUM}/TaskManager -lspemanager
+INCLUDE = -I../${CERIUM}/include/TaskManager -I. -I..
+LIBS = -L../${CERIUM}/TaskManager -lspemanager
 
 .SUFFIXES: .cc .o
 
--- a/example/renew_task/Makefile	Wed Jun 03 19:46:30 2009 +0900
+++ b/example/renew_task/Makefile	Wed Jun 03 20:36:18 2009 +0900
@@ -8,13 +8,13 @@
 	@echo "Make for Linux"
 	@$(MAKE) -f Makefile.linux
 
-ps3: FORCE
-	@echo "Make for PS3 (Cell)"
-	@$(MAKE) -f Makefile.ps3
+cell: FORCE
+	@echo "Make for CELL (Cell)"
+	@$(MAKE) -f Makefile.cell
 
 FORCE:
 
 clean:
 	@$(MAKE) -f Makefile.macosx clean
 	@$(MAKE) -f Makefile.linux clean
-	@$(MAKE) -f Makefile.ps3 clean
\ No newline at end of file
+	@$(MAKE) -f Makefile.cell clean
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/example/renew_task/Makefile.cell	Wed Jun 03 20:36:18 2009 +0900
@@ -0,0 +1,39 @@
+include ./Makefile.def
+
+SRCS_TMP = $(wildcard *.cc)
+SRCS_EXCLUDE =  # 除外するファイルを書く
+SRCS = $(filter-out $(SRCS_EXCLUDE),$(SRCS_TMP))
+OBJS = $(SRCS:.cc=.o)
+
+TASK_DIR  = ppe
+TASK_SRCS_TMP = $(wildcard $(TASK_DIR)/*.cc)
+TASK_SRCS_EXCLUDE = 
+TASK_SRCS = $(filter-out $(TASK_DIR)/$(TASK_SRCS_EXCLUDE),$(TASK_SRCS_TMP))
+TASK_OBJS = $(TASK_SRCS:.cc=.o)
+
+LIBS += -lCellManager -lspe2 -lpthread -Wl,--gc-sections 
+
+.SUFFIXES: .cc .o
+
+.cc.o:
+	$(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@
+
+all: $(TARGET) speobject
+
+$(TARGET): $(OBJS) $(TASK_OBJS)
+	$(CC) -o $@ $(OBJS) $(TASK_OBJS) $(LIBS)
+
+speobject:
+	cd spe; $(MAKE)
+
+link:
+	$(CC) -o $(TARGET) $(OBJS) $(TASK_OBJS) $(LIBS)
+
+debug: $(TARGET)
+	sudo ppu-gdb ./$(TARGET) 
+
+clean:
+	rm -f $(TARGET) $(OBJS) $(TASK_OBJS)
+	rm -f *~ \#*
+	rm -f ppe/*~ ppe/\#*
+	cd spe; $(MAKE) clean
--- a/example/renew_task/Makefile.def	Wed Jun 03 19:46:30 2009 +0900
+++ b/example/renew_task/Makefile.def	Wed Jun 03 20:36:18 2009 +0900
@@ -5,7 +5,7 @@
 #CERIUM = /Users/gongo/Source/Cerium
 
 # ex: linux/ps3
-CERIUM = /home/gongo/Cerium
+CERIUM = ../../../Cerium
 
 CC      = g++
 CFLAGS  = -g -Wall -O9
--- a/example/renew_task/Makefile.ps3	Wed Jun 03 19:46:30 2009 +0900
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,39 +0,0 @@
-include ./Makefile.def
-
-SRCS_TMP = $(wildcard *.cc)
-SRCS_EXCLUDE =  # 除外するファイルを書く
-SRCS = $(filter-out $(SRCS_EXCLUDE),$(SRCS_TMP))
-OBJS = $(SRCS:.cc=.o)
-
-TASK_DIR  = ppe
-TASK_SRCS_TMP = $(wildcard $(TASK_DIR)/*.cc)
-TASK_SRCS_EXCLUDE = 
-TASK_SRCS = $(filter-out $(TASK_DIR)/$(TASK_SRCS_EXCLUDE),$(TASK_SRCS_TMP))
-TASK_OBJS = $(TASK_SRCS:.cc=.o)
-
-LIBS += -lCellManager -lspe2 -lpthread -Wl,--gc-sections 
-
-.SUFFIXES: .cc .o
-
-.cc.o:
-	$(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@
-
-all: $(TARGET) speobject
-
-$(TARGET): $(OBJS) $(TASK_OBJS)
-	$(CC) -o $@ $(OBJS) $(TASK_OBJS) $(LIBS)
-
-speobject:
-	cd spe; $(MAKE)
-
-link:
-	$(CC) -o $(TARGET) $(OBJS) $(TASK_OBJS) $(LIBS)
-
-debug: $(TARGET)
-	sudo ppu-gdb ./$(TARGET) 
-
-clean:
-	rm -f $(TARGET) $(OBJS) $(TASK_OBJS)
-	rm -f *~ \#*
-	rm -f ppe/*~ ppe/\#*
-	cd spe; $(MAKE) clean
--- a/example/renew_task/main.cc	Wed Jun 03 19:46:30 2009 +0900
+++ b/example/renew_task/main.cc	Wed Jun 03 20:36:18 2009 +0900
@@ -6,18 +6,11 @@
 
 extern void task_init(void);
 
-const char *help_str = "Usage: ./renew_task";
+const char *usr_help_str = "Usage: ./renew_task";
 
 static int
 init(int argc, char **argv)
 {
-    for (int i = 1; argv[i]; ++i) {
-        if (strcmp(argv[i], "--help") == 0) {
-            printf("%s\n", help_str);
-            return -1;
-        }
-    }
-
     return 0;
 }
 
@@ -36,7 +29,7 @@
 }
 
 int
-cerium_main(int argc, char *argv[])
+TMmain(int argc, char *argv[])
 {
     if (init(argc, argv) < 0) {
 	return -1;
--- a/example/renew_task/spe/Makefile	Wed Jun 03 19:46:30 2009 +0900
+++ b/example/renew_task/spe/Makefile	Wed Jun 03 20:36:18 2009 +0900
@@ -8,8 +8,8 @@
 
 CC      = spu-g++
 CFLAGS  = -g -O9 -Wall -fno-exceptions -fno-rtti #-DDEBUG
-INCLUDE = -I${CERIUM}/include/TaskManager -I. -I..
-LIBS = -L${CERIUM}/TaskManager -lspemanager
+INCLUDE = -I../${CERIUM}/include/TaskManager -I. -I..
+LIBS = -L../${CERIUM}/TaskManager -lspemanager
 
 .SUFFIXES: .cc .o