# The -dc and -arch=sm_20 flags are needed to allow nvcc to link device code # that exists in multiple files. This is apparently only possible since # CUDA 5. CC = nvcc CFLAGS = -g -I. -arch=sm_20 CUSRC = GPUMagneticField.cu GPUMagneticFieldStepper.cu #HUSRC = $(CUSRC:.cu=.hu) HSRC = $(CUSRC:.cu=.h) all: cudatest7 cudatest7: cudatest7.cu $(CUSRC) $(HSRC) $(CC) $(CFLAGS) cudatest7.cu -o $@ -L$(CUDA)/lib64 -lcudart %.o:%.cu $(CC) $(CFLAGS) -c $< clean: rm -f cudatest7 *.o *~ env: @echo "CUSRC=$(CUSRC)" @echo "HUSRC=$(HUSRC)" @echo "HSRC=$(HSRC)"