CXX=g++ -std=c++14 -Wall -Wextra -Werror -g -O0 -I googletest

HEADERS=$(wildcard preserves*.hpp)

test: all
	./m

all: m

m: main.cpp $(HEADERS) googletest.a
	$(CXX) -o $@ main.cpp googletest.a

googletest.a: googletest/src/gtest-all.o googletest/src/gtest_main.o
	ar r $@ $^
	ranlib $@

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

clean:
	rm -f m
	rm -f *.o

veryclean: clean
	rm -f googletest.a
	rm -f googletest/src/*.o