Mercurial > hg > Game > Cerium
view example/fft/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 | 4cf85b48ab9e |
children |
line wrap: on
line source
include ./Makefile.def SRCS_TMP = $(wildcard *.cc) SRCS_EXCLUDE = # 除外するファイルを書く SRCS = $(filter-out $(SRCS_EXCLUDE),$(SRCS_TMP)) OBJS = $(SRCS:.cc=.o) TASK_DIR = ppe CUDA_TASK_DIR = cuda TASK_SRCS_TMP = $(wildcard $(TASK_DIR)/*.cc) TASK_SRCS_EXCLUDE = TASK_SRCS = $(filter-out $(TASK_DIR)/$(TASK_SRCS_EXCLUDE),$(TASK_SRCS_TMP)) $(wildcard $(CUDA_TASK_DIR)/*.cc) TASK_OBJS = $(TASK_SRCS:.cc=.o) CUDA_SRCS_TMP = $(wildcard $(CUDA_TASK_DIR)/*.cu) CUDA_SRCS_EXCLUDE = # 除外するファイルを書く CUDA_SRCS = $(filter-out $(CUDA_TASK_DIR)/$(CUDA_SRCS_EXCLUDE),$(CUDA_SRCS_TMP)) CUDA_OBJS = $(CUDA_SRCS:.cu=.ptx) CFLAGS += -D__CERIUM_CUDA__ -DGPU LIBS += `sdl-config --libs` -lCudaManager -F/Library/Frameworks -framework CUDA INCLUDE += -I$(CUDA_PATH) NVCC = nvcc NVCCFLAGS = -ptx -arch=sm_20 .SUFFIXES: .cc .o .cu .ptx .cc.o: $(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@ .cu.ptx: $(NVCC) $(NVCCFLAGS) $< -o $@ all: $(TARGET) $(CUDA_OBJS) $(TARGET): $(OBJS) $(TASK_OBJS) $(CUDA_OBJS) $(CC) -o $@ $(OBJS) $(TASK_OBJS) $(LIBS) link: $(CC) -o $(TARGET) $(OBJS) $(TASK_OBJS) $(LIBS) debug: $(TARGET) sudo ppu-gdb ./$(TARGET) clean: rm -f $(TARGET) $(OBJS) $(TASK_OBJS) $(CUDA_OBJS) rm -f *~ \#* rm -f cuda/*~ cuda/\#*