all:	tsp.nn \
	tsp.frp \
	tsp.greedy \
	tsp.pqgreedy \
	artigo.pdf
	
prof.all:	prof.nn \
		prof.frp \
		prof.greedy \
		prof.pqgreedy

tsp.nn: nn/nn.hs nn/toureval_nn.hs point.io/Point.hs
	ghc -o tsp.nn point.io/Point.hs \
		nn/nn.hs \
		nn/toureval_nn.hs

tsp.frp: frp/frp.hs frp/toureval_frp.hs point.io/Point.hs nn/nn.hs kdtree/KDTree.hs
	ghc -o tsp.frp point.io/Point.hs \
		kdtree/KDTree.hs \
		nn/nn.hs \
		frp/frp.hs \
		frp/toureval_frp.hs

tsp.greedy: greedy/greedy.hs greedy/toureval_greedy.hs point.io/Point.hs
	ghc -o tsp.greedy point.io/Point.hs \
		greedy/greedy.hs \
		greedy/toureval_greedy.hs

tsp.pqgreedy: pqgreedy/pqgreedy.hs pqgreedy/toureval_pqgreedy.hs point.io/Point.hs greedy/greedy.hs kdtree/KDTree.hs
	ghc -o tsp.pqgreedy point.io/Point.hs \
		kdtree/KDTree.hs \
		greedy/greedy.hs \
		pqgreedy/pqgreedy.hs \
		pqgreedy/toureval_pqgreedy.hs

artigo.pdf: doc/artigo.tex
	pdflatex doc/artigo.tex

#com geração de profile
prof.nn: nn/nn.hs nn/toureval_nn.hs point.io/Point.hs
	ghc -prof -auto-all -o prof.nn point.io/Point.hs \
		nn/nn.hs \
		nn/toureval_nn.hs

prof.frp: frp/frp.hs frp/toureval_frp.hs point.io/Point.hs nn/nn.hs kdtree/KDTree.hs
	ghc -prof -auto-all -o prof.frp point.io/Point.hs \
		kdtree/KDTree.hs \
		nn/nn.hs \
		frp/frp.hs \
		frp/toureval_frp.hs

prof.greedy: greedy/greedy.hs greedy/toureval_greedy.hs point.io/Point.hs
	ghc -prof -auto-all -o prof.greedy point.io/Point.hs \
		greedy/greedy.hs \
		greedy/toureval_greedy.hs

prof.pqgreedy: pqgreedy/pqgreedy.hs pqgreedy/toureval_pqgreedy.hs point.io/Point.hs greedy/greedy.hs kdtree/KDTree.hs
	ghc -prof -auto-all -o prof.pqgreedy point.io/Point.hs \
		kdtree/KDTree.hs \
		greedy/greedy.hs \
		pqgreedy/pqgreedy.hs \
		pqgreedy/toureval_pqgreedy.hs
