Files
2026-10-11 19:01:42 +03:00

25 lines
499 B
Makefile

CXX ?= c++
CPPFLAGS += -Isrc
CXXFLAGS ?= -std=c++17 -O2 -Wall -Wextra
DEPFLAGS = -MMD -MP
TARGET := build/renderer
SOURCES := src/main.cpp src/prrpm.cpp src/stb_image_write.cpp
OBJECTS := $(patsubst src/%.cpp,build/%.o,$(SOURCES))
DEPFILES := $(OBJECTS:.o=.d)
.PHONY: all clean
all: $(TARGET)
$(TARGET): $(OBJECTS)
$(CXX) $(LDFLAGS) $^ $(LDLIBS) -o $@
build/%.o: src/%.cpp
@mkdir -p $(dir $@)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) $(DEPFLAGS) -c $< -o $@
-include $(DEPFILES)
clean:
rm -rf build