view example/Cuda/Makefile @ 2069:26aa08c9a1de draft default tip

cuda example fix
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 12 Feb 2017 10:04:55 +0900
parents 0e2389a5ac4e
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)

CUDA_SRCS_TMP = $(wildcard *.cu)
CUDA_SRCS_EXCLUDE = # 除外するファイルを書く
CUDA_SRCS = $(filter-out $(CUDA_SRCS_EXCLUDE),$(CUDA_SRCS_TMP))
CUDA_OBJS = $(CUDA_SRCS:.cu=.ptx)

CC += $(ABI)

LIBS = -F/Library/Frameworks -framework CUDA  /Developer/NVIDIA/CUDA-8.0/lib/libcudart_static.a
INCLUDE = -I/usr/local/cuda/include -I.

.SUFFIXES: .cc .o .cu .ptx
.cc.o:
	$(CC) $(CFLAGS) $(INCLUDE) -c $< -o $@
.cu.ptx:
	$(NVCC) $(NVCCFLAGS) $<

all: $(TARGET)

$(TARGET): $(OBJS) $(TASK_OBJS) $(CUDA_OBJS)
	$(CC) -o $@ $(OBJS) $(TASK_OBJS) $(LIBS)

link:
	$(CC) -o $(TARGET) $(OBJS) $(TASK_OBJS) $(LIBS)

debug: $(TARGET)
	sudo lldb ./$(TARGET)

clean:
	rm -f $(TARGET) $(OBJS) $(TASK_OBJS) $(CUDA_OBJS)
	rm -f *~ \#*