Created
February 5, 2021 18:35
-
-
Save grampelberg/0881cc2f6a744c39b61ea1a00b5339ec to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SHELL := bash | |
.ONESHELL: | |
.SHELLFLAGS := -eu -o pipefail -c -x | |
.DELETE_ON_ERROR: | |
MAKEFLAGS += --warn-undefined-variables | |
MAKEFLAGS += --no-builtin-rules | |
MKFILE_PATH := $(abspath $(lastword $(MAKEFILE_LIST))) | |
CURRENT_DIR := $(notdir $(patsubst %/,%,$(dir $(MKFILE_PATH)))) | |
.PHONY: bootstrap | |
bootstrap: | |
@# Bootstrap the local dependencies | |
.PHONY: help | |
help: | |
@# Output all targets available. | |
@ echo "usage: make [target] ..." | |
@ echo "" | |
@eval "echo \"$$(grep -h -B1 $$'^\t@#' $(MAKEFILE_LIST) \ | |
| sed 's/@#//' \ | |
| awk \ | |
-v NO_COLOR="$(NO_COLOR)" \ | |
-v OK_COLOR="$(OK_COLOR)" \ | |
-v RS="--\n" \ | |
-v FS="\n" \ | |
-v OFS="@@" \ | |
'{ split($$1,target,":"); $$1=""; print OK_COLOR target[1] NO_COLOR $$0 }' \ | |
| sort \ | |
| awk \ | |
-v FS="@@" \ | |
-v OFS="\n" \ | |
'{ CMD=$$1; $$1=""; print CMD $$0 }')\"" | |
.DEFAULT_GOAL := help |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment