-
Notifications
You must be signed in to change notification settings - Fork 48
/
Makefile
42 lines (34 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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
.PHONY: build repl test release help
.DEFAULT_GOAL = help
PROJECT_NAME ?= $(shell grep "^name" docker.cabal | cut -d " " -f17)
VERSION ?= $(shell grep "^version:" docker.cabal | cut -d " " -f14)
RESOLVER ?= $(shell grep "^resolver:" stack.yaml | cut -d " " -f2)
GHC_VERSION ?= $(shell stack ghc -- --version | cut -d " " -f8)
ARCH=$(shell uname -m)
## Run build
build:
@stack build
## Run repl
repl:
@stack repl
## Run tests. Example RUN_INTEGRATION_TESTS=1 make test
test:
@RUN_INTEGRATION_TESTS=1 stack test
## Cut new release
release:
@stack build --haddock
@stack sdist
@echo "\n\nDone. Now run: \n\nstack upload <path_to_tarball>\n"
@echo "\nAnd: \n\ngit tag ${VERSION} && git push --tags\n"
## Show help screen.
help:
@echo "Please use \`make <target>' where <target> is one of\n\n"
@awk '/^[a-zA-Z\-0-9_]+:/ { \
helpMessage = match(lastLine, /^## (.*)/); \
if (helpMessage) { \
helpCommand = substr($$1, 0, index($$1, ":")-1); \
helpMessage = substr(lastLine, RSTART + 3, RLENGTH); \
printf "%-30s %s\n", helpCommand, helpMessage; \
} \
} \
{ lastLine = $$0 }' $(MAKEFILE_LIST)