-
Notifications
You must be signed in to change notification settings - Fork 16
/
Makefile
29 lines (23 loc) · 1.07 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
INSTALL_TO := /opt/consul
install-consul: require-VERSION require-INSTALL_TO
wget -q 'https://releases.hashicorp.com/consul/${VERSION}/consul_${VERSION}_linux_amd64.zip'
unzip consul_${VERSION}_linux_amd64.zip
mkdir -p ${INSTALL_TO}
mv consul ${INSTALL_TO}/consul-${VERSION}
chmod +x ${INSTALL_TO}/consul-${VERSION}
echo "installed consul to ${INSTALL_TO}/consul-${VERSION}"
symlink-consul: require-VERSION require-INSTALL_TO
sudo ln -sf ${INSTALL_TO}/consul-${VERSION} ${INSTALL_TO}/consul
build: require-INSTALL_TO
PATH=${INSTALL_TO}/:${PATH} stack build --system-ghc --no-run-tests --no-run-benchmarks
test: require-INSTALL_TO
PATH=${INSTALL_TO}/:${PATH} stack test --system-ghc --bench
doc: require-INSTALL_TO
PATH=${INSTALL_TO}/:${PATH} stack build --system-ghc --no-run-tests --no-run-benchmarks --haddock --haddock-deps --haddock-internal --haddock-hyperlink-source
echo "Haddocks Rendered to:"
PATH=${INSTALL_TO}/:${PATH} stack path --local-doc-root
require-%:
if [ "${${*}}" = "" ]; then \
echo "ERROR: Environment variable not set: \"$*\""; \
exit 1; \
fi