-
Notifications
You must be signed in to change notification settings - Fork 41
/
Makefile
57 lines (51 loc) · 1.46 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
.PHONY: help install pre-build build bump-patch bump-minor bump-major version bootstrap bootstrap-branch expand deploy clean deploy-spoke black pycodestyle
.DEFAULT_GOAL := help
WS=ignored/testing/$(ENV_NUMBER)
FACTORY_VENV=${WS}/factory
PUPPET_VENV=${WS}/puppet
include Makefile.CI
include Makefile.Project
include Makefile.Puppet
include Makefile.CodeQuality
include Makefile.Test
help: help-prefix help-targets
help-prefix:
@echo Usage:
@echo ' make <target>'
@echo ' make <VAR>=<value> <target>'
@echo ''
@echo Available targets
HELP_TARGET_MAX_CHAR_NUM = 25
help-targets:
@awk '/^[a-zA-Z\-\_0-9]+:/ \
{ \
helpMessage = match(lastLine, /^## (.*)/); \
if (helpMessage) { \
helpCommand = substr($$1, 0, index($$1, ":")-1); \
helpMessage = substr(lastLine, RSTART + 3, RLENGTH); \
helpGroup = match(helpMessage, /^@([^ ]*)/); \
if (helpGroup) { \
helpGroup = substr(helpMessage, RSTART + 1, index(helpMessage, " ")-2); \
helpMessage = substr(helpMessage, index(helpMessage, " ")+1); \
} \
printf "[ %s| %-$(HELP_TARGET_MAX_CHAR_NUM)s %s\n", \
helpGroup, helpCommand, helpMessage; \
} \
} \
{ lastLine = $$0 }' \
$(MAKEFILE_LIST) \
| sort -t'|' -sk1,1 \
| awk -F '|' ' \
{ \
cat = $$1; \
if (cat != lastCat || lastCat == "") { \
if ( cat == "0" ) { \
print "Targets:" \
} else { \
gsub("_", " ", cat); \
printf "%s ] \n", cat; \
} \
} \
print " " $$2 \
} \
{ lastCat = $$1 }'