Annotation of embedaddon/miniupnpd/miniupnpd/gitrev.mk, revision 1.1.1.1
1.1 misho 1: # (c) 2019-2021 Thomas Bernard
2: # For GNU Make
3:
4: # CI_COMMIT_TAG / CI_COMMIT_BRANCH / CI_COMMIT_SHORT_SHA are gitlab-ci
5: # predefined variables
6: # see https://docs.gitlab.com/ee/ci/variables/predefined_variables.html
7: ifneq ($(CI_COMMIT_TAG),)
8: GITREF = $(CI_COMMIT_TAG)
9: else
10: ifneq ($(CI_COMMIT_BRANCH),)
11: GITREF = $(CI_COMMIT_BRANCH)-$(CI_COMMIT_SHORT_SHA)
12: else
13: ISGITREPO := $(shell git rev-parse --is-inside-work-tree)
14: ifeq ($(ISGITREPO),true)
15: # <tag> or <branch>-<short commit ref>
16: GITREF := $(shell git describe --exact-match --tags 2> /dev/null || echo "`git rev-parse --abbrev-ref HEAD`-`git rev-parse --short HEAD`" )
17: endif
18: endif
19: endif
20:
21: ifneq ($(GITREF),)
22: CPPFLAGS += -DMINIUPNPD_GIT_REF=\"$(GITREF)\"
23: endif
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>