CC=g++ -O -Wall -ansi

OBJ=model.o ntc.o triple.o compare.o
BIN=ntc

all: $(BIN)

$(BIN): $(OBJ)
	$(CC) -o $(BIN) $(OBJ)
	strip $(BIN)

.cc.o:
	$(CC) -c  $<

ntc.o: ntc.cc model.h triple.h compare.h ntc.h

model.o: model.h model.cc triple.h

triple.o: triple.h triple.cc

compare.o: compare.cc compare.h triple.h model.h ntc.h

clean:
	-rm *.o $(BIN) *~ test/Output.* test/*~

check: all \
	001.test \
	002.test \
	003.test \
	004.test \
	005.test \
	006.test \
	007.test \
	008.test \
	009.test \
	010.test \
	011.test \
	012.test \
	013.test \


%.test:
	( ./ntc test/First.$* test/Second.$* && echo yes || echo no ) > test/Output.$* 2>&1
	diff test/Expected.$* test/Output.$*

wc:
	wc -l *.cc *.h test/*
