-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
54 lines (44 loc) · 3.15 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
.PHONY: help build init upgrade-theme
default: help
##@ Getting Started
init: ## Initialize the theme submodule and npm dependencies.
git submodule update --init
npm install
run: ## Servers the site for development.
hugo serve -D --noHTTPCache
run.prod:
hugo serve --minify
build: ## Build the site.
hugo --minify --environment production
##@ Updates
upgrade-theme: ## Upgrade the theme submodule.
git submodule update --remote --merge
FORMATTING_BEGIN_YELLOW = \033[0;33m
FORMATTING_BEGIN_BLUE = \033[36m
FORMATTING_END = \033[0m
help: # Show help for each of the Makefile recipes.
@printf -- "${FORMATTING_BEGIN_BLUE}%s${FORMATTING_END}\n" \
"" \
" ██╗ ██╗ █████╗ ██████╗ ██████╗ ██╗ ██╗ █████╗ ██████╗ ███████╗" \
" ██║ ██║██╔══██╗██╔══██╗██╔══██╗██║ ██║██╔══██╗██╔══██╗██╔════╝" \
" ███████║███████║██████╔╝██║ ██║██║ █╗ ██║███████║██████╔╝█████╗ " \
" ██╔══██║██╔══██║██╔══██╗██║ ██║██║███╗██║██╔══██║██╔══██╗██╔══╝ " \
" ██║ ██║██║ ██║██║ ██║██████╔╝╚███╔███╔╝██║ ██║██║ ██║███████╗" \
" ╚═╝ ╚═╝╚═╝ ╚═╝╚═╝ ╚═╝╚═════╝ ╚══╝╚══╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝" \
" .''. * .| " \
" * :_\/_: | | * ██████╗██╗████████╗██╗ ██╗" \
" .''.: /\ : * |'| * ██╔════╝██║╚══██╔══╝╚██╗ ██╔╝" \
" :_\/_:'.:::. ___ | | * ██║ ██║ ██║ ╚████╔╝ " \
" : /\ :_::::.-' '-. | | .--'| ██║ ██║ ██║ ╚██╔╝ " \
" '..-'|':_.| | || '-__ | | ╚██████╗██║ ██║ ██║ " \
" |' | |. | || | | | ╚═════╝╚═╝ ╚═╝ ╚═╝ " \
" ___| '-' ' \"\" '-' '- " \
" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ [email protected]" \
""
@awk 'BEGIN {\
FS = ":.*##"; \
printf "Usage: ${FORMATTING_BEGIN_BLUE}OPTION${FORMATTING_END}=<value> make ${FORMATTING_BEGIN_YELLOW}<target>${FORMATTING_END}\n"\
} \
/^[a-zA-Z0-9_-]+:.*?##/ { printf " ${FORMATTING_BEGIN_BLUE}%-34s${FORMATTING_END} %s\n", $$1, $$2 } \
/^.?.?##~/ { printf " %-46s${FORMATTING_BEGIN_YELLOW}%-46s${FORMATTING_END}\n", "", substr($$1, 6) } \
/^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)