forked from boschresearch/perun-node
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
33 lines (28 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
# You can set these variables from the command line.
BUILDOPTS =
# Internal variables
__BUILDHELP = (go doc ./build \
| grep -E '^ [[:alnum:]_-]+.*?--.*|^ .*')
__TARGETS = $(shell $(__BUILDHELP) \
| awk 'BEGIN {FS=" -- |^ *?"}; $$1 != "" {print $$1}')
# color definitions for help output
__BLUE = \033[1;34m
__NC = \033[0m
# Put it first so that "make" without argument is like "make help".
help: ## display this help text
@echo -n "Please use 'make $(__BLUE)target$(__NC)' where "
@echo "$(__BLUE)target$(__NC) is one of"
@grep -E '^[[:alnum:]_-]+:.*?## .*$$' $(MAKEFILE_LIST) \
| awk 'BEGIN {FS = ":.*?## "}; \
{printf " $(__BLUE)%-17s$(__NC) %s\n", $$1, $$2}'
@$(__BUILDHELP) \
| awk 'BEGIN {FS=" -- |^ *?"}; \
{gsub(/ /, "", $$1); \
printf " $(__BLUE)%-17s$(__NC) %s\n", $$1, $$2}'
.PHONY: help Makefile
# $(O) is meant as a shortcut for $(BUILDOPTS).
$(__TARGETS): Makefile
go build -o build/build ./build
build/setEnv.sh build/build $@ $(BUILDOPTS) $(0)
rm build/build
@echo "Done building."