summaryrefslogtreecommitdiff
path: root/Makefile
blob: 2be8c3cd9fb05297c38f0b2cf7d8bec0e410a428 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
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 $@ $<