34 lines
656 B
Makefile
34 lines
656 B
Makefile
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 $@ $^
|
|
|
|
.PHONY: randsampl
|
|
randsampl: CXXFLAGS += -DRANDOM_SAMPLING
|
|
randsampl: bin/raytracer
|
|
|
|
.PHONY: debug
|
|
debug: CXXFLAGS += -O0 -g
|
|
debug: clean bin/raytracer
|
|
|
|
.PHONY: clean
|
|
clean:
|
|
$(RM) obj/*.o
|
|
$(RM) bin/raytracer
|