-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
44 lines (34 loc) · 1.4 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
# A Self-Documenting Makefile: http://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
OS = $(shell uname | tr A-Z a-z)
GOBIN_VERSION = 0.0.10
VANGEN_VERSION = 1.0.0
.PHONY: build
build: vangen ## Build the site
cp -r static/* public/
bin/gobin: bin/gobin-${GOBIN_VERSION}
@ln -sf gobin-${GOBIN_VERSION} bin/gobin
bin/gobin-${GOBIN_VERSION}:
@mkdir -p bin
curl -L https://github.com/myitcv/gobin/releases/download/v${GOBIN_VERSION}/${OS}-amd64 > ./bin/gobin-${GOBIN_VERSION} && chmod +x ./bin/gobin-${GOBIN_VERSION}
bin/vangen: bin/vangen-${VANGEN_VERSION}
@ln -sf vangen-${VANGEN_VERSION} bin/vangen
bin/vangen-${VANGEN_VERSION}: bin/gobin
@mkdir -p bin
GOBIN=bin/ bin/gobin 4d63.com/vangen@v${VANGEN_VERSION}
@mv bin/vangen bin/vangen-${VANGEN_VERSION}
.PHONY: vangen
vangen: bin/vangen ## Build golang files
bin/vangen -out public/golang/
.PHONY: clean
clean: ## Remove built files
rm -rf public/
.PHONY: list
list: ## List all make targets
@${MAKE} -pRrn : -f $(MAKEFILE_LIST) 2>/dev/null | awk -v RS= -F: '/^# File/,/^# Finished Make data base/ {if ($$1 !~ "^[#.]") {print $$1}}' | egrep -v -e '^[^[:alnum:]]' -e '^$@$$' | sort
.PHONY: help
.DEFAULT_GOAL := help
help:
@grep -h -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}'
# Variable outputting/exporting rules
var-%: ; @echo $($*)
varexport-%: ; @echo $*=$($*)