@@ -5,6 +5,7 @@ MONO_VERSION:= $(shell mono --version | awk '/version/ { print $$5 }')
55MIN_NUGET_VERSION: = "2.16.0"
66NUGET_VERSION: = $(shell nuget help 2> /dev/null | awk '/Version:/ { print $$3; exit 0}')
77GreaterVersion = $(shell printf '% s\n' $(1 ) $(2 ) | sort -t. -k 1,1nr -k 2,2nr -k 3,3nr -k 4,4nr | head -n 1)
8+ PROGRAM_VERSION = $(shell git describe --tags --exact-match 2> /dev/null)
89
910# Directories
1011DEBUG_DIR := bin_debug
@@ -157,11 +158,31 @@ $(MAC_BUILD_RESULT): all-release
157158
158159 @echo $(COLOR_RED)Creating $(COLOR_CYAN)$(MAC_BUILD_RESULT)$(COLOR_END)
159160 @hdiutil create $(MAC_BUILD_RESULT) -volname "OpenBVE" -fs HFS+ -srcfolder "mac/OpenBVE.app"
161+ @echo Renaming final output file
162+ ifeq (, $(PROGRAM_VERSION ) )
163+ @echo This is a $(COLOR_BLUE)Daily build$(COLOR_END)
164+ @echo Final filename: $(COLOR_RED)OpenBVE-$$(date '+%F').dmg$(COLOR_END)
165+ @mv macbuild.dmg OpenBVE-$$(date '+%F').dmg
166+ else
167+ @echo This is a $(COLOR_YELLOW)Tagged Release build$(COLOR_END)
168+ @echo Final filename: $(COLOR_RED)OpenBVE-$(PROGRAM_VERSION).dmg$(COLOR_END)
169+ @mv macbuild.dmg OpenBVE-$(PROGRAM_VERSION).dmg
170+ endif
160171
161172$(LINUX_BUILD_RESULT ) : all-release
162173 @rm -rf bin_release/DevTools/
163174 @echo $(COLOR_RED ) Compressing $(COLOR_CYAN )$(LINUX_BUILD_RESULT )$(COLOR_END )
164175 @cd $(RELEASE_DIR ) ; zip -qr9Z deflate ../$(LINUX_BUILD_RESULT ) *
176+ @echo Renaming final output file
177+ ifeq (, $(PROGRAM_VERSION ) )
178+ @echo This is a $(COLOR_BLUE)Daily build$(COLOR_END)
179+ @echo Final filename: $(COLOR_RED)OpenBVE-$$(date '+%F').zip$(COLOR_END)
180+ @mv linuxbuild.zip OpenBVE-$$(date '+%F').zip
181+ else
182+ @echo This is a $(COLOR_YELLOW)Tagged Release build$(COLOR_END)
183+ @echo Final filename: $(COLOR_RED)OpenBVE-$(PROGRAM_VERSION).zip$(COLOR_END)
184+ @mv linuxbuild.zip OpenBVE-$(PROGRAM_VERSION).zip
185+ endif
165186
166187$(DEBIAN_BUILD_RESULT ) : all-release
167188 @rm -rf bin_release/DevTools/
@@ -174,3 +195,13 @@ $(DEBIAN_BUILD_RESULT): all-release
174195 @cp -r -f $(CP_UPDATE_FLAG) $(RELEASE_DIR)/* installers/debian/usr/lib/openbve
175196 @echo $(COLOR_RED)Compressing $(COLOR_CYAN)$(DEBIAN_BUILD_RESULT)$(COLOR_END)
176197 @fakeroot dpkg-deb --build installers/debian
198+ @echo Renaming final output file
199+ ifeq (, $(PROGRAM_VERSION ) )
200+ @echo This is a $(COLOR_BLUE)Daily build$(COLOR_END)
201+ @echo Final filename: $(COLOR_RED)OpenBVE-$$(date '+%F').deb$(COLOR_END)
202+ @mv debianbuild.deb OpenBVE-$$(date '+%F').deb
203+ else
204+ @echo This is a $(COLOR_YELLOW)Tagged Release build$(COLOR_END)
205+ @echo Final filename: $(COLOR_RED)OpenBVE-$$(date '+%F').deb$(COLOR_END)
206+ @mv debianbuild.deb OpenBVE-$(PROGRAM_VERSION).deb
207+ endif
0 commit comments