hxml = hxml-0.2 hxq = XML/HXQ options = -O2 -fvia-C parser = $(hxq)/Parser.hs # xquery interpreter all: $(parser) Main.hs ghc $(options) -i$(hxml) --make Main.hs -o xquery # on-the-fly compiler: unstable; use xquery instead hxqc: $(parser) HXQ.hs ghc $(options) -i$(hxml) -optl-s -package ghc --make HXQ.hs -o hxqc # generate the XQuery parser using happy $(parser): XQueryParser.y happy -g -a -c -o $(parser) XQueryParser.y test1: $(parser) Test1.hs ghc $(options) -i$(hxml) --make Test1.hs -o a.out ./a.out test2: $(parser) Test2.hs ghc $(options) -i$(hxml) --make Test2.hs -o a.out time ./a.out +RTS -H20m testdb: $(parser) TestDB.hs ghc $(options) -i$(hxml) --make TestDB.hs -o a.out ./a.out # get in the ghci interpreter and load HXQ ghci: $(parser) ghci -fth -i$(hxml) Main.hs # heap profile of a simple XQuery against dblp.xml profile: $(parser) profile.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 $(parser) runhaskell Setup.lhs configure --ghc --user --prefix=$(HOME) runhaskell Setup.lhs build runhaskell Setup.lhs sdist clean: /bin/rm -f *~ data/*~ $(hxq)/*~ *.o *.hi $(hxq)/*.o $(hxq)/*.hi $(hxml)/*.o $(hxml)/*.hi $(parser) *.stat *.prof *.ps *.aux *.hp xquery hxqc Temp.hs a.out a