###############################################################################
# Builds both static and dynamically linked versions together
# Adjust location and bindir before running make
###############################################################################
#location = /home/roger/public_html/gppg
#bindir   = /home/roger/bin
###############################################################################
location = /home/roger/WEB/gppg/
bindir = /home/roger/bin
###############################################################################
all: gppg.lhs
	ghc --make gppg.lhs -threaded -rtsopts
	mkdir -p ./linked
	mv gppg  linked
	ghc --make gppg.lhs -optl-static -optl-pthread -static -threaded -rtsopts
	mkdir -p ./static
	mv gppg static
###############################################################################
install:
	mkdir -p $(location)
	rsync -avv cgi/*.py $(location)
	rsync -avv linked/gppg $(location)
	rsync -avv linked/gppg $(bindir)/bin
###############################################################################
clean:
	rm -f *.hi *.o *~ .hgignore~ cgi/*~ cgi/*.pyc Makefile~
###############################################################################
veryclean:
	rm -rf .hgignore~ *.hi *.o *~ static linked cgi/*~ cgi/*.pyc Makefile~
###############################################################################


