git.iko.soy/typeable/bloodhound
on 977d2e8 help sign in
129 lines 3.8 kB history raw
1.PHONY : build build-validate ghci test test-rerun test-ghci ghcid ghcid-validate \
2 weeder hlint hlint-watch mod-build
4.DEFAULT_GOAL = help
6stack = STACK_YAML='stack.yaml' stack
7ghc_perf_options = --ghc-options '+RTS -A128M -RTS'
8build = build $(ghc_perf_options)
9ghci = ghci $(ghc_perf_options)
10test = test $(ghc_perf_options)
11stack-8.0 = STACK_YAML="stack-8.0.yaml" stack
12stack-8.2 = STACK_YAML="stack-8.2.yaml" stack
13stack-8.4 = STACK_YAML="stack-8.4.yaml" stack
14stack-8.6 = STACK_YAML="stack-8.6.yaml" stack
15elasticsearch_directory = elasticsearch
17# stack build --ghc-options '+RTS -A128M -RTS'
19## run build
20build:
21 $(stack) $(build)
23## build with validation options (Wall, Werror)
24build-validate:
25 $(stack) build --fast --ghc-options '-Wall -Werror +RTS -A128M -RTS'
27## run ghci
28ghci:
29 $(stack) $(ghci)
31## run tests
32test: echo-warn
33 $(stack) $(test)
35## run tests with forced re-run via "-r"
36test-rerun: echo-warn
37 $(stack) $(test) --test-arguments "-r"
39## run ghci with test stanza
40test-ghci:
41 $(stack) $(ghci) bloodhound:test:bloodhound-tests
43## run ghcid
44ghcid:
45 ghcid -c "$(stack) ghci bloodhound:lib --test --ghci-options='-fobject-code -fno-warn-unused-do-bind' --main-is bloodhound:test:bloodhound-tests"
47## run ghcid with validate options (Werror, etc.)
48ghcid-validate:
49 ghcid -c "$(stack) ghci bloodhound:lib --test --ghci-options='-Werror -fobject-code -fno-warn-unused-do-bind' --main-is bloodhound:test:bloodhound-tests"
51## run weeder
52weeder:
53 weeder . --build
55## run hlint
56hlint:
57 hlint .
59## hlint watch with `sos`
60hlint-watch:
61 sos src/ -c "hlint ." -p "src/(.*)\.hs"
63# mod-build:
64# stack build --ghc-options '+RTS -A128M -RTS'
66echo-warn:
67 @echo "Make certain you have an elasticsearch instance on localhost:9200 !"
69## Test with GHC 8.0 and ES 5.x
70test-8.0:
71 STACK_YAML="stack-8.0.yaml" stack test --fast bloodhound:test:bloodhound-tests --test-arguments="--qc-max-success 500"
73## Test with GHC 8.2 and ES 5.x
74test-8.2:
75 STACK_YAML="stack.yaml" stack test --fast bloodhound:test:bloodhound-tests --test-arguments="--qc-max-success 500"
77## Build with the GHC 8.0 Stack YAML
78build-8.0:
79 $(stack-8.0) $(build)
81## Build with the GHC 8.2 Stack YAML
82build-8.2:
83 $(stack-8.2) $(build)
85## Build with the GHC 8.4 Stack YAML
86build-8.4:
87 $(stack-8.4) $(build)
89## Build with the GHC 8.6 Stack YAML
90build-8.6:
91 $(stack-8.6) $(build)
93## Upload the package to Hackage
94upload:
95 stack upload --no-signature .
97# Create ES5 instance
99## Run test environment
100compose-ES5:
101 @LOCAL_USER_ID=${LOCAL_USER_ID} docker-compose -f docker-compose.yml --project-directory $(elasticsearch_directory) up
103## Run test environment in detach mode
104compose-ES5-detach-up:
105 @LOCAL_USER_ID=${LOCAL_USER_ID} docker-compose -f docker-compose.yml --project-directory $(elasticsearch_directory) up -d
107## Close test environment if run on detach mode
108compose-ES5-detach-down:
109 @LOCAL_USER_ID=${LOCAL_USER_ID} docker-compose -f docker-compose.yml --project-directory $(elasticsearch_directory) down
111## build the docker compose images
112compose-build:
113 @LOCAL_USER_ID=${LOCAL_USER_ID} docker-compose -f docker-compose.yml --project-directory $(elasticsearch_directory) build
115## Spawn bash shell in ES5 test container
116ES5-shell:
117 @LOCAL_USER_ID=${LOCAL_USER_ID} docker-compose -f docker-compose.yml --project-directory $(elasticsearch_directory) exec elasticsearch1 bash
119help:
120 @echo "Please use \`make <target>' where <target> is one of\n\n"
121 @awk '/^[a-zA-Z\-\_0-9]+:/ { \
122 helpMessage = match(lastLine, /^## (.*)/); \
123 if (helpMessage) { \
124 helpCommand = substr($$1, 0, index($$1, ":")); \
125 helpMessage = substr(lastLine, RSTART + 3, RLENGTH); \
126 printf "%-30s %s\n", helpCommand, helpMessage; \
127 } \
128 } \
129 { lastLine = $$0 }' $(MAKEFILE_LIST)