Makefile: Fail target version when not a git repository
This commit is contained in:
10
Makefile
10
Makefile
@@ -54,7 +54,8 @@ RM_F = $(RM) -f
|
|||||||
RM_RF = $(RM) -rf
|
RM_RF = $(RM) -rf
|
||||||
|
|
||||||
RUNTIME ?= dotnet
|
RUNTIME ?= dotnet
|
||||||
VERSION = $(shell git name-rev --name-only --tags --no-undefined HEAD 2>/dev/null || echo git-`git rev-parse --short HEAD`)
|
# Only for use in target version:
|
||||||
|
VERSION := $(shell git name-rev --name-only --tags --no-undefined HEAD 2>/dev/null || (c=$$(git rev-parse --short HEAD 2>/dev/null) && echo git-$$c))
|
||||||
|
|
||||||
# Detect target platform for dependencies if not given by the user
|
# Detect target platform for dependencies if not given by the user
|
||||||
ifndef TARGETPLATFORM
|
ifndef TARGETPLATFORM
|
||||||
@@ -133,8 +134,11 @@ test: all
|
|||||||
############# LOCAL INSTALLATION AND DOWNSTREAM PACKAGING ##############
|
############# LOCAL INSTALLATION AND DOWNSTREAM PACKAGING ##############
|
||||||
#
|
#
|
||||||
version: VERSION mods/ra/mod.yaml mods/cnc/mod.yaml mods/d2k/mod.yaml mods/ts/mod.yaml mods/modcontent/mod.yaml mods/all/mod.yaml
|
version: VERSION mods/ra/mod.yaml mods/cnc/mod.yaml mods/d2k/mod.yaml mods/ts/mod.yaml mods/modcontent/mod.yaml mods/all/mod.yaml
|
||||||
@sh -c '. ./packaging/functions.sh; set_engine_version $(VERSION) .'
|
ifeq ($(VERSION),)
|
||||||
@sh -c '. ./packaging/functions.sh; set_mod_version $(VERSION) mods/ra/mod.yaml mods/cnc/mod.yaml mods/d2k/mod.yaml mods/ts/mod.yaml mods/modcontent/mod.yaml mods/all/mod.yaml'
|
$(error Unable to determine new version (requires git or override of variable VERSION))
|
||||||
|
endif
|
||||||
|
@sh -c '. ./packaging/functions.sh; set_engine_version "$(VERSION)" .'
|
||||||
|
@sh -c '. ./packaging/functions.sh; set_mod_version "$(VERSION)" mods/ra/mod.yaml mods/cnc/mod.yaml mods/d2k/mod.yaml mods/ts/mod.yaml mods/modcontent/mod.yaml mods/all/mod.yaml'
|
||||||
|
|
||||||
install:
|
install:
|
||||||
ifeq ($(RUNTIME), mono)
|
ifeq ($(RUNTIME), mono)
|
||||||
|
|||||||
Reference in New Issue
Block a user