2021-09-29 22:31:00 +00:00
|
|
|
# (c) 2019-2021 Thomas Bernard
|
2019-10-05 19:59:42 +00:00
|
|
|
# For GNU Make
|
|
|
|
|
2021-09-29 22:31:00 +00:00
|
|
|
# CI_COMMIT_TAG / CI_COMMIT_BRANCH / CI_COMMIT_SHORT_SHA are gitlab-ci
|
|
|
|
# predefined variables
|
|
|
|
# see https://docs.gitlab.com/ee/ci/variables/predefined_variables.html
|
|
|
|
ifneq ($(CI_COMMIT_TAG),)
|
|
|
|
GITREF = $(CI_COMMIT_TAG)
|
|
|
|
else
|
|
|
|
ifneq ($(CI_COMMIT_BRANCH),)
|
|
|
|
GITREF = $(CI_COMMIT_BRANCH)-$(CI_COMMIT_SHORT_SHA)
|
|
|
|
else
|
2019-10-05 19:59:42 +00:00
|
|
|
ISGITREPO := $(shell git rev-parse --is-inside-work-tree)
|
|
|
|
ifeq ($(ISGITREPO),true)
|
2021-09-29 22:31:00 +00:00
|
|
|
# <tag> or <branch>-<short commit ref>
|
2020-10-31 09:50:11 +00:00
|
|
|
GITREF := $(shell git describe --exact-match --tags 2> /dev/null || echo "`git rev-parse --abbrev-ref HEAD`-`git rev-parse --short HEAD`" )
|
2021-09-29 22:31:00 +00:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifneq ($(GITREF),)
|
2020-10-31 09:50:11 +00:00
|
|
|
CPPFLAGS += -DMINIUPNPD_GIT_REF=\"$(GITREF)\"
|
2019-10-05 19:59:42 +00:00
|
|
|
endif
|