packages feed

HXQ-0.7.4: Makefile

hxml = hxml-0.2
options = -O2 -fvia-C

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

# on-the-fly compiler: unstable; use xquery instead
hxqc:   XQueryParser.hs XQueryCompiler.hs XQueryInterpreter.hs XQuery.hs HXQ.hs
	ghc $(options) -i$(hxml) -package ghc --make HXQ.hs -o hxqc

# generate the XQuery parser using happy
XQueryParser.hs: XQueryParser.y
	happy -g -a -c XQueryParser.y

test1:	XQueryParser.hs
	ghc $(options) -i$(hxml) --make Test1.hs -o test1
	./test1

test2:	XQueryParser.hs
	ghc $(options) -i$(hxml) --make Test2.hs -o test2
	time ./test2 +RTS -H20m -M20m

# get in the ghci interpreter and load HXQ
ghci:   XQueryParser.hs
	ghci -fth -i$(hxml) XQuery.hs

# heap profile of a simple XQuery against dblp.xml
profile: XQueryParser.hs
	ghc -O2 -i$(hxml) -prof -auto-all --make profile.hs -o a
	./a +RTS -hy -p -H20m
	hp2ps -color a.hp

# create the cabal distribution
cabal:	clean XQueryParser.hs
	runhaskell Setup.lhs configure --ghc --user --prefix=$(HOME)
	runhaskell Setup.lhs build
	runhaskell Setup.lhs sdist

clean:
	/bin/rm -f *~ data/*~ *.o *.hi $(hxml)/*.o $(hxml)/*.hi XQueryParser.hs *.stat *.prof *.ps *.aux *.hp hxq hxqc test1 test2 Temp.hs a.out a