foxygit / fake-08-xbox360 Log in
commit 9eb743b0f6edfced98aa447a8b89f8922fab0976
Author:     Jon Bell <j.to.the.bell@gmail.com>
AuthorDate: Mon Apr 12 18:30:33 2021 -0600
Commit:     Jon Bell <j.to.the.bell@gmail.com>
CommitDate: Mon Apr 12 18:30:33 2021 -0600

    Define version in makefile
---
 Makefile                      | 7 ++++++-
 platform/3ds/Makefile         | 2 +-
 platform/SDL2Desktop/Makefile | 2 +-
 platform/switch/Makefile      | 2 +-
 platform/vita/Makefile        | 2 +-
 platform/wiiu/Makefile        | 2 +-
 source/FakoBios.h             | 5 ++++-
 7 files changed, 15 insertions(+), 7 deletions(-)

diff --git a/Makefile b/Makefile
index 44ef1bd..9765794 100644
--- a/Makefile
+++ b/Makefile
@@ -4,7 +4,12 @@ ROOT_INCLUDES	?= include

 export APP_TITLE	= FAKE-08
 export APP_AUTHOR	= jtothebell
-export APP_VERSION	= v0.0.2.5
+export V_MAJOR	= 0
+export V_MINOR	= 0
+export V_PATCH	= 2
+export V_BUILD	= 6
+export APP_VERSION	= v$(V_MAJOR).$(V_MINOR).$(V_PATCH).$(V_BUILD)
+

 #paths are relative to platform folder
 export SOURCES   = ../../source ../../libs/z8lua ../../libs/utf8-util ../../libs/lodepng ../../libs/simpleini
diff --git a/platform/3ds/Makefile b/platform/3ds/Makefile
index 8fa384b..5acc410 100644
--- a/platform/3ds/Makefile
+++ b/platform/3ds/Makefile
@@ -70,7 +70,7 @@ CFLAGS	:=	-g -Wall -Ofast -mword-relocations \
 			-fomit-frame-pointer -ffunction-sections \
 			$(ARCH)

-CFLAGS	+=	$(INCLUDE) -DARM11 -D_3DS
+CFLAGS	+=	$(INCLUDE) -DARM11 -D_3DS -DVER_STR=\"$(APP_VERSION)\"

 CXXFLAGS	:= $(CFLAGS) -fno-rtti -fexceptions -std=gnu++11

diff --git a/platform/SDL2Desktop/Makefile b/platform/SDL2Desktop/Makefile
index 0756a9b..134474d 100644
--- a/platform/SDL2Desktop/Makefile
+++ b/platform/SDL2Desktop/Makefile
@@ -19,7 +19,7 @@ CC = $(CXX)
 CFLAGS	:=	-g -Wall -O2 -ffunction-sections \
 			$(DEFINES)

-CFLAGS	+=	$(INCLUDE)
+CFLAGS	+=	$(INCLUDE) -DVER_STR=\"$(APP_VERSION)\"

 CXXFLAGS	:= $(CFLAGS) -fno-rtti -fexceptions -std=gnu++11

diff --git a/platform/switch/Makefile b/platform/switch/Makefile
index 6c53ac6..f16fefd 100644
--- a/platform/switch/Makefile
+++ b/platform/switch/Makefile
@@ -50,7 +50,7 @@ CC = $(CXX)

 ARCH	:=	-march=armv8-a -mtune=cortex-a57 -mtp=soft -fPIE

-CFLAGS	:=	-g -Wall -O2 -ffunction-sections \
+CFLAGS	:=	-g -Wall -O2 -ffunction-sections -DVER_STR=\"$(APP_VERSION)\" \
 			$(ARCH) $(DEFINES)

 CFLAGS	+=	$(INCLUDE) -D__SWITCH__
diff --git a/platform/vita/Makefile b/platform/vita/Makefile
index cfbbc50..ab5a040 100644
--- a/platform/vita/Makefile
+++ b/platform/vita/Makefile
@@ -24,7 +24,7 @@ PREFIX  = arm-vita-eabi
 CC      = $(PREFIX)-gcc
 CXX      = $(PREFIX)-g++
 STRIP := $(PREFIX)-strip
-CFLAGS  = -g -Wl,-q -O2 -ftree-vectorize -D__VITA__ $(INCLUDE)
+CFLAGS  = -g -Wl,-q -O2 -ftree-vectorize -D__VITA__ -DVER_STR=\"$(APP_VERSION)\" $(INCLUDE)
 CXXFLAGS  = $(CFLAGS) -fexceptions -std=gnu++11 -fpermissive
 ASFLAGS = $(CFLAGS)

diff --git a/platform/wiiu/Makefile b/platform/wiiu/Makefile
index cdfaa01..ee56665 100644
--- a/platform/wiiu/Makefile
+++ b/platform/wiiu/Makefile
@@ -33,7 +33,7 @@ LIBRARIES	:=	SDL2_gfx SDL2_image SDL2_mixer SDL2_ttf sdl2 \
 #-------------------------------------------------------------------------------
 CC = $(CXX)

-CFLAGS		:=	-g -Wall -O2 -ffunction-sections \
+CFLAGS		:=	-g -Wall -O2 -ffunction-sections -DVER_STR=\"$(APP_VERSION)\" \
 			-ffast-math \
 			$(MACHDEP)

diff --git a/source/FakoBios.h b/source/FakoBios.h
index 0aa306a..1672019 100644
--- a/source/FakoBios.h
+++ b/source/FakoBios.h
@@ -2,6 +2,9 @@

 #include <string>

+#ifndef VER_STR
+#define VER_STR = "v0.0.0.0"
+#endif

 //from PicoLove api.lua

@@ -24,7 +27,7 @@ local runcmd=false
 cartpath = "sdmc:/p8carts/"
 selectbtn = "a"
 pausebtn = "start"
-versionstr = "v0.0.2.5"
+versionstr = ")#" VER_STR  R"#("
 exitbtn = "l + r"
 sizebtn = "r to cycle screen sizes"
 --end customizable per platform