Makefile: append branch name to EXENAME if not manually set

This commit is contained in:
James R 2022-08-11 01:09:19 -07:00
parent 5ebcf86d7d
commit 607fe240bb
2 changed files with 15 additions and 6 deletions

View file

@ -183,6 +183,19 @@ include Makefile.d/detect.mk
sources:= sources:=
makedir:=../make makedir:=../make
exe:=ringracers
# append branch name by default
ifndef EXENAME
branch:=$(shell git symbolic-ref -q --short HEAD)
# not a detached HEAD
ifdef branch
exe:=$(exe)_$(branch)
endif
endif
# -DCOMPVERSION: flag to use comptime.h # -DCOMPVERSION: flag to use comptime.h
opts:=-DCOMPVERSION -g opts:=-DCOMPVERSION -g
libs:= libs:=
@ -236,7 +249,7 @@ bin:=../bin
endif endif
# default EXENAME (usually set by platform) # default EXENAME (usually set by platform)
EXENAME?=ringracers EXENAME?=$(exe)
DBGNAME?=$(EXENAME).debug DBGNAME?=$(EXENAME).debug
exe:=$(bin)/$(EXENAME) exe:=$(bin)/$(EXENAME)

View file

@ -2,11 +2,7 @@
# Mingw, if you don't know, that's Win32/Win64 # Mingw, if you don't know, that's Win32/Win64
# #
ifndef MINGW64 exe:=$(exe)$(if $(MINGW64),64).exe
EXENAME?=ringracers.exe
else
EXENAME?=ringracers64.exe
endif
# disable dynamicbase if under msys2 # disable dynamicbase if under msys2
ifdef MSYSTEM ifdef MSYSTEM