Skip to content

Instantly share code, notes, and snippets.

@raybird
Created December 14, 2019 12:28
Show Gist options
  • Save raybird/a8271b97fd6a8d6cb618ae94ebf38b00 to your computer and use it in GitHub Desktop.
Save raybird/a8271b97fd6a8d6cb618ae94ebf38b00 to your computer and use it in GitHub Desktop.
makefile sample
TAG=$(shell git describe --tags --abbrev=0 | sed -Ee 's/^v|-.*//')
COMMIT=$(shell git rev-list -1 HEAD)
DATE=$(shell date '+%Y-%m-%d %H:%M:%S')
# HELP
# This will output the help for each task
# thanks to https://marmelab.com/blog/2016/02/29/auto-documented-makefile.html
.PHONY: help
help: ## This help.
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?## / {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)
.DEFAULT_GOAL := help
hello: ## hello.
echo hello
local: log ## local test.
git branch
log:
git log --pretty=format:"%Creset %s" ${GITTAGHEAD}..@
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment