266
|
1 include ./Makefile.def
|
|
2
|
|
3 SRCS_TMP = $(wildcard *.cc)
|
|
4 SRCS_EXCLUDE = # 除外するファイルを書く
|
|
5 SRCS = $(filter-out $(SRCS_EXCLUDE),$(SRCS_TMP))
|
|
6 OBJS = $(SRCS:.cc=.o)
|
|
7
|
|
8 TASK_DIR = ppe
|
|
9 CUDA_TASK_DIR = cuda
|
|
10
|
|
11 TASK_SRCS_TMP = $(wildcard $(TASK_DIR)/*.cc)
|
|
12 TASK_SRCS_EXCLUDE =
|
|
13 TASK_SRCS = $(filter-out $(TASK_DIR)/$(TASK_SRCS_EXCLUDE),$(TASK_SRCS_TMP)) $(wildcard $(CUDA_TASK_DIR)/*.cc)
|
|
14 TASK_OBJS = $(TASK_SRCS:.cc=.o)
|
|
15
|
|
16 CUDA_SRCS_TMP = $(wildcard $(CUDA_TASK_DIR)/*.cu)
|
|
17 CUDA_SRCS_EXCLUDE = # 除外するファイルを書く
|
|
18 CUDA_SRCS = $(filter-out $(CUDA_TASK_DIR)/$(CUDA_SRCS_EXCLUDE),$(CUDA_SRCS_TMP))
|
|
19 CUDA_OBJS = $(CUDA_SRCS:.cu=.ptx)
|
|
20
|
|
21 CFLAGS += -D__CERIUM_CUDA__
|
|
22 LIBS += `sdl-config --libs` -lCudaManager -F/Library/Frameworks -framework CUDA
|
|
23
|
|
24 INCLUDE += -I$(CUDA_PATH)
|
|
25
|
|
26 NVCC = nvcc
|
|
27 NVCCFLAGS = -ptx -arch=sm_20
|
|
28
|
|
29 .SUFFIXES: .cc .o .cu .ptx
|
|
30
|
|
31 .cc.o:
|
|
32 $(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@
|
|
33
|
|
34 .cu.ptx:
|
|
35 $(NVCC) $(NVCCFLAGS) $< -o $@
|
|
36
|
|
37 all: $(TARGET) $(CUDA_OBJS)
|
|
38
|
|
39 $(TARGET): $(OBJS) $(TASK_OBJS) $(CUDA_OBJS)
|
|
40 $(CC) -o $@ $(OBJS) $(TASK_OBJS) $(LIBS)
|
|
41
|
|
42 link:
|
|
43 $(CC) -o $(TARGET) $(OBJS) $(TASK_OBJS) $(LIBS)
|
|
44
|
|
45 debug: $(TARGET)
|
|
46 sudo ppu-gdb ./$(TARGET)
|
|
47
|
|
48 clean:
|
|
49 rm -f $(TARGET) $(OBJS) $(TASK_OBJS) $(CUDA_OBJS)
|
|
50 rm -f *~ \#*
|
|
51 rm -f cuda/*~ cuda/\#*
|