-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
40 lines (36 loc) · 1.08 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
PROJECT_NAME ?= wire-bot
.PHONY: help
## Show help
help:
@echo ''
@echo 'Usage:'
@echo '${YELLOW} make ${RESET} ${GREEN}<target> [options]${RESET}'
@echo ''
@echo 'Targets:'
@echo ''
@awk '/^[a-zA-Z\-\_0-9]+:/ { \
message = match(lastLine, /^## (.*)/); \
if (message) { \
command = substr($$1, 0, index($$1, ":")-1); \
message = substr(lastLine, RSTART + 3, RLENGTH); \
printf " ${YELLOW}%-$(TARGET_MAX_CHAR_NUM)s${RESET} %s\n", command, message; \
} \
} \
{ lastLine = $$0 }' $(MAKEFILE_LIST)
@echo ''
@echo ''
## Start local development server
start:
${INFO} "Starting local development server"
@ npm run start-dev
# COLORS
GREEN := $(shell tput -Txterm setaf 2)
YELLOW := $(shell tput -Txterm setaf 3)
WHITE := $(shell tput -Txterm setaf 7)
NC := "\e[0m"
RESET := $(shell tput -Txterm sgr0)
# Shell Functions
INFO := @bash -c 'printf $(YELLOW); echo "===> $$1"; printf $(NC)' SOME_VALUE
SUCCESS := @bash -c 'printf $(GREEN); echo "===> $$1"; printf $(NC)' SOME_VALUE
# Shell Functions
INFO := @bash -c ' printf $(YELLOW); echo "===> $$1"; printf $(NC)' SOME_VALUE