-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
66 lines (58 loc) · 1.67 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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
# make config
.DEFAULT_GOAL := help
SHELL := /usr/bin/env bash -euo pipefail
ROOT_DIR:=$(shell dirname $(realpath $(firstword $(MAKEFILE_LIST))))
GIT_SHA_SHORT = $(shell git rev-parse --short=10 HEAD)
## Check production dependencies
check-prod:
./dev/check-required-prod-dependencies.sh
## Check development dependencies
check-dev:
./dev/check-required-dev-dependencies.sh
.PHONY: docs
## Build the docs -- output location is docs/book
docs: check-dev
./docs/mdbook-shim.sh build docs
## Build and live-reload the docs
docs-watch: check-dev
./docs/mdbook-shim.sh watch --open docs
## Get repo back to a clean slate
clean:
rm -rf docs/book
rm -rf docs/bin
rm -rf outputs
rm -rf nginx.conf
# https://gist.github.com/prwhite/8168133#gistcomment-2278355
# https://gist.github.com/prwhite/8168133#gistcomment-2749866
.PHONY: help
help:
@printf "Usage\n\n";
@awk '{ \
if ($$0 ~ /^.PHONY: [a-zA-Z\-_0-9]+$$/) { \
helpCommand = substr($$0, index($$0, ":") + 2); \
if (helpMessage) { \
printf "\033[36m%-30s\033[0m %s\n", \
helpCommand, helpMessage; \
helpMessage = ""; \
} \
} else if ($$0 ~ /^[a-zA-Z\-_0-9.]+:/) { \
helpCommand = substr($$0, 0, index($$0, ":")); \
if (helpMessage) { \
printf "\033[36m%-30s\033[0m %s\n", \
helpCommand, helpMessage; \
helpMessage = ""; \
} \
} else if ($$0 ~ /^##/) { \
if (helpMessage) { \
helpMessage = helpMessage"\n "substr($$0, 3); \
} else { \
helpMessage = substr($$0, 3); \
} \
} else { \
if (helpMessage) { \
print "\n "helpMessage"\n" \
} \
helpMessage = ""; \
} \
}' \
$(MAKEFILE_LIST)