-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
27 lines (19 loc) · 1.09 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
PROJECT_NAME = scrapbox
help: ## Print documentation
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
stylish-haskell: ## Apply stylish-haskell on all *.hs files
@find . -type f -name "*.hs" -not -path '.git' -not -path '*.stack-work*' -print0 | xargs -0 stylish-haskell -i
ghci: ## Run repl
@stack ghci $(PROJECT_NAME):lib --haddock-deps --ghci-options=-fobject-code
ghcid: ## Run ghcid
@ghcid --command "stack ghci $(PROJECT_NAME):lib --ghci-options=-fobject-code "
run-test: ## Build & run test
@stack build --fast && \
stack test --fast
test-ghci: ## Run repl on test suites
@stack build $(PROJECT_NAME):lib --fast && \
stack ghci $(PROJECT_NAME):lib $(PROJECT_NAME):test:$(PROJECT_NAME)-test --ghci-options=-fobject-code
test-ghcid: ## Run ghcid on test suites
@stack build $(PROJECT_NAME):lib --fast && \
ghcid --command "stack ghci $(PROJECT_NAME):lib $(PROJECT_NAME):test:$(PROJECT_NAME)-test --ghci-options=-fobject-code"
.PHONY: stylish-haskell ghci ghcid run-test test-ghcid test-ghci help