aboutsummaryrefslogtreecommitdiff
path: root/Makefile
blob: 14220de0c16b1a4deb11f63f00e316b8cbda6df5 (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
CXX = g++
CXXFLAGS = -Wall -Wextra -std=c++11 -fwrapv
ifneq ($(DEBUG),)
	CXXFLAGS += -g
else
	CXXFLAGS += -O2
endif
BIN = main

.PHONY: all clean remake

all: $(BIN)

clean:
	rm -rf $(BIN) *.o *.dSYM

remake: clean all


$(BIN): $(patsubst %.cpp,%.o,$(wildcard *.cpp))
	$(CXX) -o $@ $^

%.o: %.cpp $(wildcard *.h)
	$(CXX) $(CXXFLAGS) -c -o $@ $<