annotate example/Miller_Rabin/Makefile.cell @ 1716:c12df61ded45 draft

fix gpu profile. not work yet
author Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
date Tue, 15 Oct 2013 17:21:10 +0900
parents 9d37fa6bc1da
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
1242
9d37fa6bc1da add Miller_Rabin
Daichi Toma <amothic@gmail.com>
parents:
diff changeset
1 include ./Makefile.def
9d37fa6bc1da add Miller_Rabin
Daichi Toma <amothic@gmail.com>
parents:
diff changeset
2
9d37fa6bc1da add Miller_Rabin
Daichi Toma <amothic@gmail.com>
parents:
diff changeset
3 ABIBIT=32
9d37fa6bc1da add Miller_Rabin
Daichi Toma <amothic@gmail.com>
parents:
diff changeset
4 CFLAGS += -m$(ABIBIT) -D__CERIUM_CELL__
9d37fa6bc1da add Miller_Rabin
Daichi Toma <amothic@gmail.com>
parents:
diff changeset
5
9d37fa6bc1da add Miller_Rabin
Daichi Toma <amothic@gmail.com>
parents:
diff changeset
6 SRCS_TMP = $(wildcard *.cc)
9d37fa6bc1da add Miller_Rabin
Daichi Toma <amothic@gmail.com>
parents:
diff changeset
7 SRCS_EXCLUDE = # 除外するファイルを書く
9d37fa6bc1da add Miller_Rabin
Daichi Toma <amothic@gmail.com>
parents:
diff changeset
8 SRCS = $(filter-out $(SRCS_EXCLUDE),$(SRCS_TMP))
9d37fa6bc1da add Miller_Rabin
Daichi Toma <amothic@gmail.com>
parents:
diff changeset
9 OBJS = $(SRCS:.cc=.o)
9d37fa6bc1da add Miller_Rabin
Daichi Toma <amothic@gmail.com>
parents:
diff changeset
10
9d37fa6bc1da add Miller_Rabin
Daichi Toma <amothic@gmail.com>
parents:
diff changeset
11 TASK_DIR = ppe
9d37fa6bc1da add Miller_Rabin
Daichi Toma <amothic@gmail.com>
parents:
diff changeset
12 TASK_SRCS_TMP = $(wildcard $(TASK_DIR)/*.cc)
9d37fa6bc1da add Miller_Rabin
Daichi Toma <amothic@gmail.com>
parents:
diff changeset
13 TASK_SRCS_EXCLUDE =
9d37fa6bc1da add Miller_Rabin
Daichi Toma <amothic@gmail.com>
parents:
diff changeset
14 TASK_SRCS = $(filter-out $(TASK_DIR)/$(TASK_SRCS_EXCLUDE),$(TASK_SRCS_TMP))
9d37fa6bc1da add Miller_Rabin
Daichi Toma <amothic@gmail.com>
parents:
diff changeset
15 TASK_OBJS = $(TASK_SRCS:.cc=.o)
9d37fa6bc1da add Miller_Rabin
Daichi Toma <amothic@gmail.com>
parents:
diff changeset
16
9d37fa6bc1da add Miller_Rabin
Daichi Toma <amothic@gmail.com>
parents:
diff changeset
17 LIBS += -lCellManager -lspe2 -lpthread -Wl,--gc-sections
9d37fa6bc1da add Miller_Rabin
Daichi Toma <amothic@gmail.com>
parents:
diff changeset
18
9d37fa6bc1da add Miller_Rabin
Daichi Toma <amothic@gmail.com>
parents:
diff changeset
19 .SUFFIXES: .cc .o
9d37fa6bc1da add Miller_Rabin
Daichi Toma <amothic@gmail.com>
parents:
diff changeset
20
9d37fa6bc1da add Miller_Rabin
Daichi Toma <amothic@gmail.com>
parents:
diff changeset
21 .cc.o:
9d37fa6bc1da add Miller_Rabin
Daichi Toma <amothic@gmail.com>
parents:
diff changeset
22 $(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@
9d37fa6bc1da add Miller_Rabin
Daichi Toma <amothic@gmail.com>
parents:
diff changeset
23
9d37fa6bc1da add Miller_Rabin
Daichi Toma <amothic@gmail.com>
parents:
diff changeset
24 all: $(TARGET) speobject
9d37fa6bc1da add Miller_Rabin
Daichi Toma <amothic@gmail.com>
parents:
diff changeset
25
9d37fa6bc1da add Miller_Rabin
Daichi Toma <amothic@gmail.com>
parents:
diff changeset
26 $(TARGET): $(OBJS) $(TASK_OBJS)
9d37fa6bc1da add Miller_Rabin
Daichi Toma <amothic@gmail.com>
parents:
diff changeset
27 $(CC) $(CFLAGS) -o $@ $(OBJS) $(TASK_OBJS) $(LIBS)
9d37fa6bc1da add Miller_Rabin
Daichi Toma <amothic@gmail.com>
parents:
diff changeset
28
9d37fa6bc1da add Miller_Rabin
Daichi Toma <amothic@gmail.com>
parents:
diff changeset
29 speobject:
9d37fa6bc1da add Miller_Rabin
Daichi Toma <amothic@gmail.com>
parents:
diff changeset
30 cd spe; $(MAKE) ABIBIT=$(ABIBIT)
9d37fa6bc1da add Miller_Rabin
Daichi Toma <amothic@gmail.com>
parents:
diff changeset
31
9d37fa6bc1da add Miller_Rabin
Daichi Toma <amothic@gmail.com>
parents:
diff changeset
32 run:
9d37fa6bc1da add Miller_Rabin
Daichi Toma <amothic@gmail.com>
parents:
diff changeset
33 ./$(TARGET) -cpu 6
9d37fa6bc1da add Miller_Rabin
Daichi Toma <amothic@gmail.com>
parents:
diff changeset
34
9d37fa6bc1da add Miller_Rabin
Daichi Toma <amothic@gmail.com>
parents:
diff changeset
35 link:
9d37fa6bc1da add Miller_Rabin
Daichi Toma <amothic@gmail.com>
parents:
diff changeset
36 $(CC) -o $(TARGET) $(OBJS) $(TASK_OBJS) $(LIBS)
9d37fa6bc1da add Miller_Rabin
Daichi Toma <amothic@gmail.com>
parents:
diff changeset
37
9d37fa6bc1da add Miller_Rabin
Daichi Toma <amothic@gmail.com>
parents:
diff changeset
38 debug: $(TARGET)
9d37fa6bc1da add Miller_Rabin
Daichi Toma <amothic@gmail.com>
parents:
diff changeset
39 sudo ppu-gdb ./$(TARGET)
9d37fa6bc1da add Miller_Rabin
Daichi Toma <amothic@gmail.com>
parents:
diff changeset
40
9d37fa6bc1da add Miller_Rabin
Daichi Toma <amothic@gmail.com>
parents:
diff changeset
41 clean:
9d37fa6bc1da add Miller_Rabin
Daichi Toma <amothic@gmail.com>
parents:
diff changeset
42 rm -f $(TARGET) $(OBJS) $(TASK_OBJS)
9d37fa6bc1da add Miller_Rabin
Daichi Toma <amothic@gmail.com>
parents:
diff changeset
43 rm -f *~ \#*
9d37fa6bc1da add Miller_Rabin
Daichi Toma <amothic@gmail.com>
parents:
diff changeset
44 rm -f ppe/*~ ppe/\#*
9d37fa6bc1da add Miller_Rabin
Daichi Toma <amothic@gmail.com>
parents:
diff changeset
45 cd spe; $(MAKE) clean