toytracer/Makefile

25 lines
634 B
Makefile

CXX = g++
CXXFLAGS = -std=c++20 -Wall -Wextra -Wno-unused-parameter -march=native -O3 -flto -fopenmp
DEPS = util.h vec3.h color.h ray.h camera.h hittable.h hittable_list.h sphere.h material.h lodepng.h moving_sphere.h bvh.h aabb.h texture.h aarect.h box.h
OBJ = main.o material.o vec3.o lodepng.o sphere.o moving_sphere.o bvh.o aarect.o box.o hittable_list.o hittable.o
TARGET = toytracer
all: $(TARGET) run
run: $(TARGET)
time -f '%E elapsed %M Kb memory' ./$(TARGET)
eog image.png
%.o: %.cpp $(DEPS)
$(CXX) $(CXXFLAGS) -c -o $@ $<
$(TARGET): $(OBJ)
$(CXX) $(CXXFLAGS) -o $@ $^
clean:
$(RM) $(TARGET) $(OBJ) image.png