Mercurial > hg > Game > Cerium
annotate example/word_count/Makefile.cuda @ 2005:4d1bc8cd3a62 draft
fix Makefile(CUDA PATH)
author | Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 27 May 2014 14:23:44 +0900 |
parents | 273de551f726 |
children |
rev | line source |
---|---|
1941
f19885ea776d
add wordcount for cuda. fix CudaScheduler. add makefile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
1 include ./Makefile.def |
f19885ea776d
add wordcount for cuda. fix CudaScheduler. add makefile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
2 |
f19885ea776d
add wordcount for cuda. fix CudaScheduler. add makefile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
3 SRCS_TMP = $(wildcard *.cc) |
f19885ea776d
add wordcount for cuda. fix CudaScheduler. add makefile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
4 SRCS_EXCLUDE = # 除外するファイルを書く |
f19885ea776d
add wordcount for cuda. fix CudaScheduler. add makefile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
5 SRCS = $(filter-out $(SRCS_EXCLUDE),$(SRCS_TMP)) |
f19885ea776d
add wordcount for cuda. fix CudaScheduler. add makefile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
6 OBJS = $(SRCS:.cc=.o) |
f19885ea776d
add wordcount for cuda. fix CudaScheduler. add makefile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
7 |
f19885ea776d
add wordcount for cuda. fix CudaScheduler. add makefile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
8 TASK_DIR = ppe |
f19885ea776d
add wordcount for cuda. fix CudaScheduler. add makefile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
9 CUDA_TASK_DIR = cuda |
f19885ea776d
add wordcount for cuda. fix CudaScheduler. add makefile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
10 |
f19885ea776d
add wordcount for cuda. fix CudaScheduler. add makefile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
11 TASK_SRCS_TMP = $(wildcard $(TASK_DIR)/*.cc) |
f19885ea776d
add wordcount for cuda. fix CudaScheduler. add makefile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
12 TASK_SRCS_EXCLUDE = |
f19885ea776d
add wordcount for cuda. fix CudaScheduler. add makefile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
13 TASK_SRCS = $(filter-out $(TASK_DIR)/$(TASK_SRCS_EXCLUDE),$(TASK_SRCS_TMP)) $(wildcard $(CUDA_TASK_DIR)/*.cc) |
f19885ea776d
add wordcount for cuda. fix CudaScheduler. add makefile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
14 TASK_OBJS = $(TASK_SRCS:.cc=.o) |
f19885ea776d
add wordcount for cuda. fix CudaScheduler. add makefile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
15 |
f19885ea776d
add wordcount for cuda. fix CudaScheduler. add makefile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
16 CUDA_SRCS_TMP = $(wildcard $(CUDA_TASK_DIR)/*.cu) |
f19885ea776d
add wordcount for cuda. fix CudaScheduler. add makefile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
17 CUDA_SRCS_EXCLUDE = # 除外するファイルを書く |
f19885ea776d
add wordcount for cuda. fix CudaScheduler. add makefile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
18 CUDA_SRCS = $(filter-out $(CUDA_TASK_DIR)/$(CUDA_SRCS_EXCLUDE),$(CUDA_SRCS_TMP)) |
f19885ea776d
add wordcount for cuda. fix CudaScheduler. add makefile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
19 CUDA_OBJS = $(CUDA_SRCS:.cu=.ptx) |
f19885ea776d
add wordcount for cuda. fix CudaScheduler. add makefile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
20 |
f19885ea776d
add wordcount for cuda. fix CudaScheduler. add makefile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
21 CFLAGS += -D__CERIUM_CUDA__ |
f19885ea776d
add wordcount for cuda. fix CudaScheduler. add makefile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
22 LIBS += `sdl-config --libs` -lCudaManager -F/Library/Frameworks -framework CUDA |
f19885ea776d
add wordcount for cuda. fix CudaScheduler. add makefile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
23 |
2005
4d1bc8cd3a62
fix Makefile(CUDA PATH)
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
1960
diff
changeset
|
24 INCLUDE += -I$(CUDA_PATH) |
1941
f19885ea776d
add wordcount for cuda. fix CudaScheduler. add makefile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
25 |
2005
4d1bc8cd3a62
fix Makefile(CUDA PATH)
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
1960
diff
changeset
|
26 NVCC = nvcc |
1941
f19885ea776d
add wordcount for cuda. fix CudaScheduler. add makefile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
27 NVCCFLAGS = -ptx -arch=sm_20 |
f19885ea776d
add wordcount for cuda. fix CudaScheduler. add makefile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
28 |
f19885ea776d
add wordcount for cuda. fix CudaScheduler. add makefile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
29 .SUFFIXES: .cc .o .cu .ptx |
f19885ea776d
add wordcount for cuda. fix CudaScheduler. add makefile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
30 |
f19885ea776d
add wordcount for cuda. fix CudaScheduler. add makefile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
31 .cc.o: |
f19885ea776d
add wordcount for cuda. fix CudaScheduler. add makefile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
32 $(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@ |
f19885ea776d
add wordcount for cuda. fix CudaScheduler. add makefile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
33 |
f19885ea776d
add wordcount for cuda. fix CudaScheduler. add makefile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
34 .cu.ptx: |
f19885ea776d
add wordcount for cuda. fix CudaScheduler. add makefile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
35 $(NVCC) $(NVCCFLAGS) $< -o $@ |
f19885ea776d
add wordcount for cuda. fix CudaScheduler. add makefile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
36 |
f19885ea776d
add wordcount for cuda. fix CudaScheduler. add makefile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
37 all: $(TARGET) $(CUDA_OBJS) |
f19885ea776d
add wordcount for cuda. fix CudaScheduler. add makefile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
38 |
f19885ea776d
add wordcount for cuda. fix CudaScheduler. add makefile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
39 $(TARGET): $(OBJS) $(TASK_OBJS) $(CUDA_OBJS) |
f19885ea776d
add wordcount for cuda. fix CudaScheduler. add makefile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
40 $(CC) -o $@ $(OBJS) $(TASK_OBJS) $(LIBS) |
f19885ea776d
add wordcount for cuda. fix CudaScheduler. add makefile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
41 |
f19885ea776d
add wordcount for cuda. fix CudaScheduler. add makefile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
42 link: |
f19885ea776d
add wordcount for cuda. fix CudaScheduler. add makefile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
43 $(CC) -o $(TARGET) $(OBJS) $(TASK_OBJS) $(LIBS) |
f19885ea776d
add wordcount for cuda. fix CudaScheduler. add makefile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
44 |
f19885ea776d
add wordcount for cuda. fix CudaScheduler. add makefile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
45 debug: $(TARGET) |
f19885ea776d
add wordcount for cuda. fix CudaScheduler. add makefile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
46 sudo ppu-gdb ./$(TARGET) |
f19885ea776d
add wordcount for cuda. fix CudaScheduler. add makefile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
47 |
f19885ea776d
add wordcount for cuda. fix CudaScheduler. add makefile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
48 clean: |
f19885ea776d
add wordcount for cuda. fix CudaScheduler. add makefile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
49 rm -f $(TARGET) $(OBJS) $(TASK_OBJS) $(CUDA_OBJS) |
f19885ea776d
add wordcount for cuda. fix CudaScheduler. add makefile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
50 rm -f *~ \#* |
f19885ea776d
add wordcount for cuda. fix CudaScheduler. add makefile
Shohei KOKUBO <e105744@ie.u-ryukyu.ac.jp>
parents:
diff
changeset
|
51 rm -f cuda/*~ cuda/\#* |