summaryrefslogtreecommitdiff
path: root/Makefile
blob: 52d8e7ec7bbef846be22b8246ce041cb9a563197 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
ifeq ($(shell uname),Darwin)
	CXX = g++-9
else
	CXX = g++
endif
CXXFLAGS = -Wall -Wextra -O2 -std=c++17 -fwrapv -pthread

TARGET = competition

SOURCES := $(wildcard *.cpp)
HEADERS := $(wildcard *.h)

.PHONY: all clean

all: $(TARGET)

clean:
	rm -f $(TARGET) *.o


competition: $(SOURCES:.cpp=.o)
	$(CXX) $(CXXFLAGS) $^ -o $@

%.o: %.cpp $(HEADERS)
	$(CXX) $(CXXFLAGS) -c -o $@ $<