VERSION=2.3

all: match

%: %.o
	c++ $^ -o $@ $(LDFLAGS)

.cc.o:
#	c++ -c $< -o $@ -Wall -g $(CFLAGS)
	c++ -O4 -c $< -o $@ -Wall -g $(CFLAGS)

match: match.o series.o config.o normalize.o floatnan.o
match.o: match.cc config.hh series.hh normalize.hh floatnan.hh
series.o: series.cc series.hh floatnan.hh
config.o: config.cc config.hh floatnan.hh
normalize.o: normalize.cc normalize.hh series.hh floatnan.hh
floatnan.o: floatnan.cc floatnan.hh

clean: 
	rm -f *.o match *~ match.exe match.log *.new xmatch score_matrix

tar:
	sed '/\S/ ! d;s/^/Match-${VERSION}\//' ../manifest > ../manifest.tmp
	tar -cz -C ../.. -f ../match-${VERSION}.tgz -T ../manifest.tmp

check-manifest:
	cd .. && find . -type f | sed 's/^.\///' | grep -v ,v | sort > manifest.tmp
	sort ../manifest > ../manifest.tmp1
	diff ../manifest.tmp1 ../manifest.tmp; true
	pwd | grep 'Match-${VERSION}/' > /dev/null || (echo version mismatch; false)

