HS=`echo *.hs`

all:V: Main
clean:V: 
	rm -f Main
	rm -f *.o *.hi *~

Main: $HS
	ghc --make Main.hs

FUNSOUT=16

test:VQ: 
	rm -f Main
	ghc --make Main.hs
	if ./Main > /dev/null && [ `./Main | grep '^f.*{$' | wc -l ` -eq $FUNSOUT ]
	then
	  echo "Passed `expr $FUNSOUT / 2` tests" >&2
	else
          echo "Test failed" >&2
	  exit 1
        fi
