YHC_BASE_PATH=/home/stepcut/n-heptane/projects/haskell/yhc/inst

test: SimpleTest.yca yca2swf
	./yca2swf SimpleTest.yca --dump-core --dump-stg
#	gflashplayer test.swf

SimpleTest.yca: SimpleTest.hs
	YHC_BASE_PATH=$(YHC_BASE_PATH) $(YHC_BASE_PATH)/bin/yhc $<  --no-bytecode --showcore --linkcore

%.ycr : %.hs
	YHC_BASE_PATH=$(YHC_BASE_PATH) $(YHC_BASE_PATH)/bin/yhc $< --no-bytecode --core --showcore -c

viewcore: SimpleTest.yca
	YHC_BASE_PATH=$(YHC_BASE_PATH) $(YHC_BASE_PATH)/bin/yhc --viewcore $<

showtype: SimpleTest.hs
	YHC_BASE_PATH=$(YHC_BASE_PATH) $(YHC_BASE_PATH)/bin/yhc --showtype $<

yca2swf: Main.hs STG.hs Core2Stg.hs Stg2Swf.hs
	ghc --make -cpp -fasm -i../../libraries/core -i../../libraries/general -i../../compiler -i../../../depends/play -i../../../depends/uniplate Main.hs -o yca2swf

force:
	ghc --make -no-recomp -cpp -fasm -i../../libraries/core -i../../libraries/general -i../../compiler -i../../../depends/play -i../../../depends/uniplate Main.hs -o yca2swf

clean:
	rm -f yca2swf *.hi *.hbc

.PHONY: showcore clean
