Skip to content

Commit

Permalink
make: tag=#.#.# - prepends v
Browse files Browse the repository at this point in the history
  • Loading branch information
RandyMcMillan committed Mar 23, 2023
1 parent b04ac90 commit 74b0e8d
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,14 @@ PROJECT_NAME := $(project)
endif
export PROJECT_NAME

ifeq ($(tag),)
TAG :=$(shell git tag --sort=committerdate | grep -E '^v[0-9]' | tail -1)
#TAG :=$(shell git describe --tags `git rev-list --tags --max-count=1`)
else
TAG :=v$(tag)
endif
export TAG

#GIT CONFIG
GIT_USER_NAME := $(shell git config user.name)
export GIT_USER_NAME
Expand Down Expand Up @@ -232,6 +240,13 @@ export PACKAGE_PREFIX
#NOTE: 2 hashes are detected as 1st column output with color
@awk 'BEGIN {FS = ":.*?## "} /^[a-zA-Z_-]+:.*?##/ {printf "\033[36m%-15s\033[0m %s\n", $$1, $$2}' $(MAKEFILE_LIST)

version:
#get the most recent
#@TAG=$(shell git tag --sort=committerdate | grep -E '^v[0-9]' | tail -1)
#@TAG=$(shell git describe --tags `git rev-list --tags --max-count=1`)
#@export TAG
@echo $(TAG)

.PHONY: help
help:## print verbose help
@echo 'make [COMMAND] [EXTRA_ARGUMENTS] '
Expand Down Expand Up @@ -306,6 +321,7 @@ report:## print environment arguments
@echo ' [ARGUMENTS] '
@echo ' args:'
@echo ' - PROJECT_NAME=${PROJECT_NAME}'
@echo ' - TAG=${TAG}'
@echo ' - HOME=${HOME}'
@echo ' - PWD=${PWD}'
@echo ' - PYTHON=${PYTHON}'
Expand Down

0 comments on commit 74b0e8d

Please sign in to comment.