hxml = hxml-0.2
options = -O

xquery: XQueryParser.hs XQueryCompiler.hs XQueryInterpreter.hs XQuery.hs Main.hs
	ghc $(options) -i$(hxml) --make Main.hs -o xquery

XQueryParser.hs: XQueryParser.y
	happy -g -c XQueryParser.y

run:	xquery
	./xquery

test1:	xquery
	ghc -O -ihxml-0.2 --make Test1.hs -o test1
	./test1

test2:	xquery
	ghc -O -ihxml-0.2 --make Test2.hs -o test2
	./test2

ghci:   XQueryParser.hs
	ghci -fth -i$(hxml) XQuery.hs XQueryCompiler.hs XQueryInterpreter.hs XQueryParser.hs

clean:
	/bin/rm -f *~ *.o *.hi $(hxml)/*.o $(hxml)/*.hi XQueryParser.hs *.stat *.prof *.ps *.aux *.hp xquery test1 test2

