Skip to content

Instantly share code, notes, and snippets.

@svrana
Last active February 15, 2023 17:34
Show Gist options
  • Save svrana/111a09be0b2b70116426d7f5795f325c to your computer and use it in GitHub Desktop.
Save svrana/111a09be0b2b70116426d7f5795f325c to your computer and use it in GitHub Desktop.
Makefile boilerplate
SHELL := bash
.ONESHELL:
.SHELLFLAGS := -eu -o pipefail -c
.DELETE_ON_ERROR:
MAKEFLAGS += --warn-undefined-variables
MAKEFLAGS += --no-builtin-rules
DATE := $(shell date +"%a %b %d %T %Y")
UNAME_S := $(shell uname -s | tr A-Z a-z)
##@ Section 1
.PHONY: help
help: ## Show this help
@awk 'BEGIN {FS = ":.*##"; printf "\nUsage:\n make \033[36m<target>\033[0m\n"} /^[a-zA-Z_0-9-]+:.*?##/ { printf " \033[36m%-15s\033[0m %s\n", $$1, $$2 } /^##@/ { printf "\n\033[1m%s\033[0m\n", substr($$0, 5) } ' $(MAKEFILE_LIST)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment