-
Notifications
You must be signed in to change notification settings - Fork 7
/
Makefile
40 lines (28 loc) · 1.24 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
28
29
30
31
32
33
34
35
36
37
38
39
40
################################################################################
STACK:=stack $(STACK_ARGS) --install-ghc --local-bin-path ./out/bin
HASKELL_FILES := $(shell find . -name "*.hs" -not -path '*.stack-work*' | grep 'src\|test')
PROJECT_BIN_DIR:=./out/bin
PROJECT_BIN=$(PROJECT_BIN_DIR)/etc-plain-example
STACK:=stack $(STACK_ARGS) --local-bin-path ./out/bin
################################################################################
$(PROJECT_BIN): $(HASKELL_FILES)
$(STACK) build --copy-bins --local-bin-path $(PROJECT_BIN_DIR) --test --no-run-tests --bench --no-run-benchmarks --haddock --no-haddock-deps --pedantic
build: $(PROJECT_BIN) ## Build library and example binaries
.PHONY: build
test: $(PROJECT_BIN) ## Execute test suites
$(STACK) test --dump-logs
.PHONY: test
bench: $(PROJECT_BIN)
$(STACK) bench --dump-logs
.PHONY: bench
clean: ## Clean built artifacts
rm -f $(PROJECT_BIN_DIR)/*
rm -f out/*
rm -rf tmp/*
stack clean
.PHONY: clean
################################################################################
help: ## Display this message
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
.PHONY: help
.DEFAULT_GOAL := help