Created
March 18, 2019 06:36
-
-
Save HirotoShioi/7378d921931fd3c5470095bbaa177211 to your computer and use it in GitHub Desktop.
Makefile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PROJECT_NAME = <enter your project name here> | |
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 ghci $(PROJECT_NAME):lib $(PROJECT_NAME):test:$(PROJECT_NAME)-test | |
test-ghcid: ## Run ghcid on test suites | |
@ghcid --command "stack ghci $(PROJECT_NAME):lib $(PROJECT_NAME):test:$(PROJECT_NAME)-test --ghci-options=-fobject-code" | |
.PHONY: stylish-haskell ghci ghcid runtest test-ghcid test-ghci help |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment