29 lines
1.1 KiB
Makefile
29 lines
1.1 KiB
Makefile
# This really ought to be `/usr/bin/env bash`, but nix flakes don't like that.
|
|
SHELL := /bin/sh
|
|
|
|
.PHONY: hoogle format haddock usage
|
|
|
|
usage:
|
|
@echo "usage: make <command> [OPTIONS]"
|
|
@echo
|
|
@echo "Available commands:"
|
|
@echo " hoogle -- Start local hoogle"
|
|
@echo " format -- Format the project"
|
|
@echo " haddock -- Generate Haddock docs for project"
|
|
|
|
hoogle:
|
|
hoogle generate --local=haddock --database=hoo/local.hoo
|
|
hoogle server --local -p 8081 >> /dev/null &
|
|
hoogle server --local --database=hoo/local.hoo -p 8082 >> /dev/null &
|
|
|
|
FORMAT_EXTENSIONS := -o -XQuasiQuotes -o -XTemplateHaskell -o -XTypeApplications -o -XImportQualifiedPost -o -XPatternSynonyms -o -XOverloadedRecordDot
|
|
format:
|
|
find -name '*.hs' -not -path './dist-*/*' | xargs fourmolu $(FORMAT_EXTENSIONS) -m inplace
|
|
git ls-tree -r HEAD --full-tree --name-only | grep -E '.*\.nix' | xargs nixfmt
|
|
git ls-tree -r HEAD --full-tree --name-only | grep -E '.*\.cabal' | xargs cabal-fmt -i
|
|
|
|
format_check:
|
|
find -name '*.hs' -not -path './dist-*/*' | xargs fourmolu $(FORMAT_EXTENSIONS) -m check
|
|
|
|
haddock:
|
|
cabal haddock --haddock-html --haddock-hoogle --builddir=haddock
|