#!/usr/bin/make

# This makefile was written to test the output of the molphy components
# It was written for the Debian GNU/Linux distribution by
# Andreas Tille <tille@debian.org>

all: comparetests protml nucml njdist
	@echo All tests successfully done!

protml: test4.ptn test5.ptn test15.ptn test15.cns
	protml -e test4.ptn > test4.tpl
	@comparetests test4.tpl
	protml test4.ptn test4.tpl > test4.ml
	@comparetests test4.ml
	protml -e test5.ptn | tee test5.tpl | protml -b test5.ptn - > test5.ml
	@comparetests test5.tpl
	@comparetests test5.ml
	protml -ef test15.ptn test15.cns > test15.tpl
	@comparetests test15.tpl
	protml -fb test15.ptn test15.tpl > test15.ml
	@comparetests test15.ml
	protml -sf test7.ptn > test7.mls
	@comparetests test7.mls
	protml -qf -n3 test7.ptn > test7.tpl
	@comparetests test7.tpl
	protml -fb test7.ptn test7.tpl > test7.mlq
	@comparetests test7.mlq
	@echo All $@ successfully done!

nucml: test6.nuc
	nucml -s test6.nuc > test6.mls
	@comparetests test6.mls
	nucml -q -n3 test6.nuc > test6.tplq
	@comparetests  test6.tplq
	nucml -b -topt test6.nuc test6.tplq > test6.mlq
	@comparetests  test6.mlq
	nucml -e -t30.58 -n10 test6.nuc > test6.tpl
	@comparetests  test6.tpl
	nucml -b -t30.58 test6.nuc test6.tpl > test6.ml
	@comparetests  test6.ml
	@echo All $@ successfully done!

njdist: test4.ptn test15.tree
	protml -D test4.ptn > test4.dis
	@comparetests  test4.dis
	njdist test4.dis > test4.nj
	@comparetests  test4.nj
	protml -D test5.ptn | njdist -w > test5.nj
	@comparetests  test5.nj
	protml -D test15.ptn > test15.dis
	@comparetests  test15.dis
	njdist test15.dis > test15.nj
	@comparetests  test15.nj
	njdist -o 18 test15.dis > test15.njo
	@comparetests  test15.njo
	njdist -o 18 -T test15.tree test15.dis > test15.njo
	@comparetests  test15.tree
	@echo All $@ successfully done!

clean:
	rm -f *.comp *.test
	rm -f protml.eps protml.tre
	rm -f nucml.eps nucml.tre
	rm -f njdist.eps njdist.tpl

proper:
	make clean
	rm -f test4.tpl test4.ml test5.tpl test5.ml test15.tpl test15.ml test7.mls test7.tpl test7.mlq
	rm -f test6.mls test6.tplq test6.mlq test6.tpl test6.ml
	rm -f test4.dis test4.nj test5.nj test15.dis test15.nj test15.njo test15.tree.tre
