CXX = g++ CXXFLAGS = -Wall -Wextra -O3 -std=c++17 -fwrapv -flto TARGET = main .PHONY: all clean all: $(TARGET) clean: rm -f $(TARGET) *.o main: $(patsubst %.cpp,%.o,$(wildcard *.cpp)) $(CXX) $(CXXFLAGS) $^ -o $@ $(LDFLAGS) %.o: %.cpp $(wildcard *.h) $(CXX) $(CXXFLAGS) -c -o $@ $<