From 53185c3effbc38733fb29669631b6d428564c38a Mon Sep 17 00:00:00 2001 From: SpinDizzy Date: Thu, 24 Dec 2020 10:20:26 +0000 Subject: [PATCH] Introducing a special release build target with SVN version stamping. --- Makefiles/Makefile.Win32 | 2 ++ Makefiles/Rules.inc | 17 ++++++++++++++--- Src/Version.h | 12 +++++++----- 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/Makefiles/Makefile.Win32 b/Makefiles/Makefile.Win32 index f9d4eb7..6738071 100644 --- a/Makefiles/Makefile.Win32 +++ b/Makefiles/Makefile.Win32 @@ -106,6 +106,8 @@ PLATFORM_SRC_FILES = \ Src/OSD/Windows/DirectInputSystem.cpp \ Src/OSD/Windows/WinOutputs.cpp +.PHONY: clean + include Makefiles/Rules.inc clean: diff --git a/Makefiles/Rules.inc b/Makefiles/Rules.inc index 5aa7ec6..c4c6d6f 100644 --- a/Makefiles/Rules.inc +++ b/Makefiles/Rules.inc @@ -44,7 +44,7 @@ OUTFILE = supermodel # # Construct Supermodel build options # -SUPERMODEL_BUILD_FLAGS = +SUPERMODEL_BUILD_FLAGS = # If render state analyser is enabled, need to define DEBUG ifeq ($(strip $(DEBUG)),1) @@ -66,10 +66,10 @@ ifeq ($(strip $(ENABLE_DEBUGGER)),1) SUPERMODEL_BUILD_FLAGS += -DSUPERMODEL_DEBUGGER endif -# +# # Compiler options # -ARCH = +ARCH = OPT = -Ofast WARN = -Wall CSTD = -std=iso9899:2011 @@ -212,6 +212,17 @@ INCLUDE_DIRS = $(sort $(foreach file,$(SRC_FILES),$(dir $(file)))) # all: $(BIN_DIR)/$(OUTFILE) +# +# Release target: used only to create official builds stamped with the SVN +# version number. +# +release: set_version clean all +set_version: + $(eval VERSION = 0.3a-svn-$(shell svnversion --no-newline)) + $(eval SUPERMODEL_BUILD_FLAGS += -DSUPERMODEL_VERSION=\"$(VERSION)\") + $(info Building Supermodel Version $(VERSION)) + + $(BIN_DIR)/$(OUTFILE): $(BIN_DIR) $(OBJ_DIR) $(OBJ_FILES) $(info --------------------------------------------------------------------------------) $(info Linking Supermodel : $(BIN_DIR)/$(OUTFILE)) diff --git a/Src/Version.h b/Src/Version.h index 9ea6738..c81387f 100644 --- a/Src/Version.h +++ b/Src/Version.h @@ -6,7 +6,7 @@ ** This file is part of Supermodel. ** ** Supermodel is free software: you can redistribute it and/or modify it under - ** the terms of the GNU General Public License as published by the Free + ** the terms of the GNU General Public License as published by the Free ** Software Foundation, either version 3 of the License, or (at your option) ** any later version. ** @@ -18,16 +18,18 @@ ** You should have received a copy of the GNU General Public License along ** with Supermodel. If not, see . **/ - + /* * Version.h - * + * * Supermodel version string. */ - + #ifndef INCLUDED_VERSION_H #define INCLUDED_VERSION_H -#define SUPERMODEL_VERSION "0.3a-WIP" +#ifndef SUPERMODEL_VERSION +#define SUPERMODEL_VERSION "0.3a-WIP" +#endif #endif // INCLUDED_VERSION_H