
# Build settings for tsp_cuda standalone
# EDIT THESE SETTINGS IF NECESSARY!

# Location of the NVCC compiler for your machine
NVCC := /usr/local/cuda/bin/nvcc

# Location of the NVCC include directory for your machine
CUDA_INCLUDE_DIR := -I/usr/local/cuda/include

# Location of the NVCC lib directory for your machine
CUDA_LIB_DIR := -L/usr/local/cuda/lib64

# You don't need to modify this
# Fermi architecture: compute_20 and sm_20
# Tesla architecture: compute_1X and sm_1X where X is 1,2,or 3
GPU_ARCH := --gpu-architecture compute_11
GPU_CODE := --gpu-code sm_11,sm_12,sm_13,sm_20

######### END EDIT SECTION!  DO NOT MODIFY BELOW! ########

CUDA_FLAGS := --compiler-options -fPIC
CUDA_LIB := -lcudart
INSTALL_PREFIX :=
BUILD_DIR := build
RM := rm -rf
default: all

MAIN += \
./$(BUILD_DIR)/tsp_cuda

MAIN_OBJS += \
./$(BUILD_DIR)/src/main.o

OBJS += \

CPP_DEPS += \

./$(BUILD_DIR)/src/%.o: ./src/%.cu
	mkdir -p ./$(BUILD_DIR)/src/
	$(NVCC) $(CUDA_FLAGS) $(CUDA_INCLUDE_DIR) $(GPU_ARCH) $(GPU_CODE) -M "$<" -odir $(@D) -o "$(@:%.o=%.d)"
	$(NVCC) $(CUDA_FLAGS) $(CUDA_INCLUDE_DIR) $(GPU_ARCH) $(GPU_CODE) -c "$<" -o "$@"

# All target.
all: $(MAIN) 

# Build main program.
$(MAIN): $(MAIN_OBJS) $(OBJS)
	mkdir -p $(BUILD_DIR)
	$(NVCC) $(MAIN_OBJS) $(OBJS) $(CUDA_LIB_DIR) $(CUDA_LIB) -o "$@" 

# Clean up any generated files.
clean:
	@echo 'Cleaning'
	$(RM) $(MAIN) $(OBJS) $(MAIN_OBJS) $(CPP_DEPS) $(GEN_SRCS)
	
# Including any generated dependencies.
ifneq ($(strip $(CPP_DEPS)),)
-include $(CPP_DEPS)
endif

	
