raytracer/Makefile

30 lines
566 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: debug
debug: CXXFLAGS += -O0 -g
debug: clean bin/raytracer
.PHONY: clean
clean:
$(RM) -r obj/*.o
$(RM) bin/*