-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
29 lines (23 loc) · 837 Bytes
/
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
.PHONY: _tasks
_tasks: .tasks
.PHONY: s start
s start: stop # start app
@run build env=dev # tasks can be run directly from other tasks
@echo "starting app"
.PHONY: stop
stop: # stop app
@echo "stopping app"
.PHONY: b build
b build: lint # build app for environment [vars: env]
@[[ -n $(env) ]] && echo "buiding app for $(env)" || echo "error: missing env"
.PHONY: t test
t test: # run all tests or specific tests [vars: name1, name2, etc.]
@run build env=test
@[[ -n $(@) ]] && echo "running tests $(@)" || echo "running all tests"
.PHONY: l lint
l lint: # lint all files or specific file [vars: file]
@[[ -n $(1) ]] && echo "linting file $(1)" || echo "linting all files"
.PHONY: .tasks
.tasks:
@grep -E "^([a-zA-Z0-9 _-]+:[a-zA-Z0-9 _-]*#)" $(MAKEFILE_LIST) \
| sed -Ee "s/^/\t/" -e "s/[ ]*:[a-zA-Z0-9 _-]*#[ ]*/ · /"