Added revision number to build.

This commit is contained in:
Steve 2015-11-14 14:45:19 +00:00
parent 3ecbd5560e
commit 2ad6579a35
3 changed files with 10 additions and 5 deletions

View File

@ -1,9 +1,10 @@
PROG = tbftss
VERSION = 0.3
REVISION := $(shell git rev-list --count HEAD)
DEBUG = 0
CXXFLAGS += `sdl2-config --cflags` -DVERSION=$(VERSION) -DUNIX=1 -DDEBUG=$(DEBUG)
CXXFLAGS += `sdl2-config --cflags` -DVERSION=$(VERSION) -DREVISION=$(REVISION) -DUNIX=1 -DDEBUG=$(DEBUG)
CXXFLAGS += -DUNIX
CXXFLAGS += $(CFLAGS) -Wall -ansi -pedantic -Werror -Wstrict-prototypes
CXXFLAGS += -g -lefence
@ -53,10 +54,10 @@ dist:
$(RM) -rf $(PROG)-$(VERSION)
mkdir $(PROG)-$(VERSION)
cp -r $(DIST_FILES) $(PROG)-$(VERSION)
git log --oneline master..v$(VERSION) >$(PROG)-$(VERSION)/CHANGELOG
tar czf $(PROG)-$(VERSION)-src.tar.gz $(PROG)-$(VERSION)
git log --oneline master..develop >$(PROG)-$(VERSION)/CHANGELOG
tar czf $(PROG)-$(VERSION).$(REVISION)-src.tar.gz $(PROG)-$(VERSION)
mkdir -p dist
mv $(PROG)-$(VERSION)-src.tar.gz dist
mv $(PROG)-$(VERSION).$(REVISION)-src.tar.gz dist
$(RM) -rf $(PROG)-$(VERSION)
# cleaning everything that can be automatically recreated with "make".

View File

@ -18,6 +18,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#ifndef REVISION
#define REVISION 0
#endif
#define PI 3.14159265358979323846
#define MIN(a,b) (((a)<(b))?(a):(b))
#define MAX(a,b) (((a)>(b))?(a):(b))

View File

@ -172,7 +172,7 @@ static void draw(void)
blit(pandoranWar, SCREEN_WIDTH / 2, 110, 1);
drawText(10, SCREEN_HEIGHT - 25, 14, TA_LEFT, colors.white, "Copyright Parallel Realities, 2015");
drawText(SCREEN_WIDTH - 10, SCREEN_HEIGHT - 25, 14, TA_RIGHT, colors.white, "Version %.2f", VERSION);
drawText(SCREEN_WIDTH - 10, SCREEN_HEIGHT - 25, 14, TA_RIGHT, colors.white, "Version %.2f.%d", VERSION, REVISION);
if (!showingOptions)
{