CXXFLAGS = -g -ggdb -O0 -Wall

all: ataxx

%: %.cc
	g++ ${CXXFLAGS} -o $@ $<

%-tut: %.cc
	tutg++ ${CXXFLAGS} -o $@ $<

%.cc.gcovw: %.cc *.test.in
	rm -f ataxx.cc.gc*
	tutg++ ${CXXFLAGS} --coverage -o ataxx $<
	for file in ataxx*.test.in; do ./ataxx < $$file > /dev/null || true; done
	/usr/local/kurssit/ohj1e/gcovw.sh $<

ataxx-style: ataxx.cc
	/home/kurssit/style/style -c/usr/local/kurssit/ohj1e/ohj1e.style $< -w -v1 -s

test-naamio: naamio.in naamio.out ataxx
	./ataxx < naamio.in > test-naamio.out
	diff naamio.out test-naamio.out || true

test-urhomatti: urhomatti.in urhomatti.out urhomatti.replay ataxx
	./ataxx < urhomatti.in > urhomatti-test.out
	./ataxx < uudestaan.replay > urhomatti-test2.out
	./ataxx < urhomatti.replay > urhomatti-test3.out
	
	diff urhomatti.out urhomatti-test.out || true
	diff urhomatti.replay uudestaan.replay || true
	diff urhomatti-test3.out urhomatti-test2.out || true
	diff urhomatti-test.out urhomatti-test2.out || true
