# There's only one '$' in the awk script, but we have to double-money # it for make. PN = $(shell grep 'name:' *.cabal | awk '{ print $$2 }') BIN = dist/build/$(PN)/$(PN) DOCTESTS_BIN = dist/build/doctests/doctests SRCS = $(shell find src/ -name '*.hs') .PHONY : test publish_doc doc dist hlint $(BIN): $(PN).cabal $(SRCS) runghc Setup.hs configure --user runghc Setup.hs build $(DOCTESTS_BIN): $(SRCS) test/Doctests.hs runghc Setup.hs configure --user --enable-tests runghc Setup.hs build profile: $(PN).cabal $(SRCS) runghc Setup.hs configure --user --enable-executable-profiling runghc Setup.hs build clean: runghc Setup.hs clean rm -f dist/ rm -f *.prof rm -rf .hpc test: $(BIN) $(DOCTESTS_BIN) runghc Setup.hs test doc: $(SRCS) runghc Setup.hs configure --user --flags=${FLAGS} runghc Setup.hs hscolour --all runghc Setup.hs haddock --all \ --haddock-options="--ignore-all-exports" hlint: hlint --ignore="Use camelCase" \ --ignore="Redundant bracket" \ --color \ src