2020-06-02 22:06:53 +00:00
|
|
|
CXX = g++
|
|
|
|
|
2020-06-07 10:10:51 +00:00
|
|
|
CXXFLAGS = -std=c++20 -Wall -Wextra -Wno-unused-parameter -march=native -Ofast -flto -fopenmp
|
2020-06-02 22:06:53 +00:00
|
|
|
|
2020-06-07 20:25:43 +00:00
|
|
|
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
|
|
|
|
OBJ = main.o material.o vec3.o lodepng.o moving_sphere.o
|
2020-06-02 22:06:53 +00:00
|
|
|
|
2020-06-07 19:47:27 +00:00
|
|
|
TARGET = toytracer
|
2020-06-02 22:06:53 +00:00
|
|
|
|
|
|
|
all: $(TARGET) run
|
|
|
|
|
2020-06-06 22:03:25 +00:00
|
|
|
run: $(TARGET)
|
2020-06-07 19:47:27 +00:00
|
|
|
time -f '%E elapsed' ./$(TARGET)
|
2020-06-07 01:28:59 +00:00
|
|
|
eog image.png
|
2020-06-02 22:06:53 +00:00
|
|
|
|
|
|
|
%.o: %.cpp $(DEPS)
|
|
|
|
$(CXX) $(CXXFLAGS) -c -o $@ $<
|
|
|
|
|
|
|
|
$(TARGET): $(OBJ)
|
|
|
|
$(CXX) $(CXXFLAGS) -o $@ $^
|
|
|
|
|
|
|
|
clean:
|
2020-06-07 10:10:51 +00:00
|
|
|
$(RM) $(TARGET) $(OBJ) image.png
|
2020-06-02 22:06:53 +00:00
|
|
|
|