2022-12-17 17:22:51 +00:00
|
|
|
SHELL = /bin/bash
|
|
|
|
|
|
|
|
SRC_DIR = ./src
|
|
|
|
INC_DIR = ./include
|
|
|
|
OBJ_DIR = ./obj
|
|
|
|
|
|
|
|
HEADERS = $(wildcard $(INC_DIR)/*.hpp)
|
|
|
|
SRC_FILES = $(wildcard $(SRC_DIR)/*.cpp)
|
|
|
|
OBJ_FILES = $(addprefix $(OBJ_DIR)/,$(notdir $(SRC_FILES:.cpp=.o)))
|
|
|
|
|
|
|
|
CXXFLAGS += -Wall -std=c++2a -fopenmp -O3 -Ofast -march=native
|
|
|
|
|
|
|
|
all: bin/raytracer
|
|
|
|
|
|
|
|
$(OBJ_DIR)/%.o: src/%.cpp
|
|
|
|
$(CXX) $(CXXFLAGS) -c -o $@ $^
|
|
|
|
|
|
|
|
bin/raytracer: $(OBJ_FILES)
|
|
|
|
@mkdir -p $(OBJ_DIR)
|
|
|
|
$(CXX) $(CXXFLAGS) -o $@ $^
|
|
|
|
|
2023-12-03 20:20:49 +00:00
|
|
|
.PHONY: randsampl
|
|
|
|
randsampl: CXXFLAGS += -DRANDOM_SAMPLING
|
|
|
|
randsampl: bin/raytracer
|
|
|
|
|
2022-12-17 17:22:51 +00:00
|
|
|
.PHONY: debug
|
|
|
|
debug: CXXFLAGS += -O0 -g
|
|
|
|
debug: clean bin/raytracer
|
|
|
|
|
|
|
|
.PHONY: clean
|
|
|
|
clean:
|
2023-12-03 20:20:49 +00:00
|
|
|
$(RM) obj/*.o
|
|
|
|
$(RM) bin/raytracer
|