mirror of
https://github.com/MartinOpat/cuda-based-raytrace.git
synced 2025-06-07 02:13:10 +02:00
loaded data using netcdfcxx
This commit is contained in:
38
Makefile
Normal file
38
Makefile
Normal file
@@ -0,0 +1,38 @@
|
||||
# Compiler and flags
|
||||
NVCC = nvcc
|
||||
CXXFLAGS = -I./src -I./hurricanedata -std=c++17 $(shell nc-config --cxx4flags) $(shell nc-config --cxx4libs)
|
||||
|
||||
# Directories
|
||||
SRC_DIR = src
|
||||
BUILD_DIR = build
|
||||
|
||||
# Files
|
||||
TARGET = $(BUILD_DIR)/main
|
||||
SRC_FILES := $(shell find $(SRC_DIR) -type f \( -name '*.cu' -o -name '*.cpp' \))
|
||||
OBJ_FILES = $(patsubst $(SRC_DIR)/%.cu,$(BUILD_DIR)/%.o,$(SRC_FILES))
|
||||
|
||||
# Default target
|
||||
all: $(TARGET)
|
||||
|
||||
# Build the main target
|
||||
$(TARGET): $(OBJ_FILES) | $(BUILD_DIR)
|
||||
$(NVCC) $(CXXFLAGS) -o $@ $^
|
||||
|
||||
# Compile object files
|
||||
$(BUILD_DIR)/%.o: $(SRC_DIR)/%.cu
|
||||
@mkdir -p $(dir $@)
|
||||
$(NVCC) $(CXXFLAGS) -c $< -o $@
|
||||
|
||||
# Debug build
|
||||
debug: CXXFLAGS += -g
|
||||
debug: clean all
|
||||
|
||||
# Clean build directory
|
||||
clean:
|
||||
rm -rf $(BUILD_DIR)/*
|
||||
|
||||
# Create build directory if it doesn't exist
|
||||
$(BUILD_DIR):
|
||||
mkdir -p $(BUILD_DIR)
|
||||
|
||||
.PHONY: all clean debug
|
||||
Reference in New Issue
Block a user