-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
35 lines (29 loc) · 1.29 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
SHELL := /bin/bash
# Borrowed from https://stackoverflow.com/questions/18136918/how-to-get-current-relative-directory-of-your-makefile
curr_dir := $(patsubst %/,%,$(dir $(abspath $(lastword $(MAKEFILE_LIST)))))
# Borrowed from https://stackoverflow.com/questions/2214575/passing-arguments-to-make-run
rest_args := $(wordlist 2, $(words $(MAKECMDGOALS)), $(MAKECMDGOALS))
$(eval $(rest_args):;@:)
charts := $(shell ls $(curr_dir)/charts | xargs -I{} echo -n "charts/{}")
targets := $(shell ls $(curr_dir)/hack | grep '.sh' | sed 's/\.sh//g')
$(targets):
@$(curr_dir)/hack/[email protected] $(rest_args)
help:
#
# Usage:
#
# * [dev] `make generate`, generate README file.
# - `make generate charts/hello-world` only generate docs under charts/hello-world directory.
#
# * [dev] `make lint`, check style and security.
# - `LINT_DIRTY=true make lint` verify whether the code tree is dirty.
# - `make lint charts/hello-world` only verify the code under charts/hello-world directory.
#
# * [dev] `make test`, execute unit testing.
# - `make test charts/hello-world` only test the code under charts/hello-world directory.
#
# * [ci] `make ci`, execute `make generate`, `make lint` and `make test`.
#
@echo
.DEFAULT_GOAL := ci
.PHONY: $(targets) charts $(charts) docs