targets := thermometer pid
OPTIONS_GHC := -O -threaded

.PHONY: all hscolour
all: $(targets)

%: %.hs
	ghc $(OPTIONS_GHC) --make $@

hscolour: $(targets:=.hs.xhtml) hscolour.css

%.hs.xhtml: %.hs
	{ echo '<?xml version="1.0" encoding="utf-8"?>' ; HsColour -css $^ \
		| sed -e 's#<html>#<html xmlns="http://www.w3.org/1999/xhtml">#' ; } > $@

hscolour.css:
	HsColour -print-css > $@

