From 1d5906756f09693104b45e7f87b1b2ff264613dd Mon Sep 17 00:00:00 2001 From: Maximus32 Date: Tue, 28 Jan 2025 21:56:49 +0100 Subject: [PATCH] Add "git describe --tags" version number --- .github/workflows/compile.yml | 4 ++++ .gitignore | 1 + ee/loader/Makefile | 8 +++++++- ee/loader/src/main.c | 5 +++-- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/compile.yml b/.github/workflows/compile.yml index bf1195c..3d6fb00 100644 --- a/.github/workflows/compile.yml +++ b/.github/workflows/compile.yml @@ -27,6 +27,7 @@ jobs: make copy mkdir $TARGET cp *.elf $TARGET/ + cp version.txt $TARGET/ cp -r modules/ $TARGET/modules/ cp -r config/ $TARGET/config/ cp ../../README.md $TARGET/ @@ -72,6 +73,7 @@ jobs: make copy mkdir $TARGET cp *.elf $TARGET/ + cp version.txt $TARGET/ cp -r modules/ $TARGET/modules/ cp -r config/ $TARGET/config/ cp ../../README.md $TARGET/ @@ -107,6 +109,7 @@ jobs: make copy mkdir $TARGET cp *.elf $TARGET/ + cp version.txt $TARGET/ cp -r modules/ $TARGET/modules/ cp -r config/ $TARGET/config/ cp ../../README.md $TARGET/ @@ -142,6 +145,7 @@ jobs: make copy mkdir $TARGET cp *.elf $TARGET/ + cp version.txt $TARGET/ cp -r modules/ $TARGET/modules/ cp -r config/ $TARGET/config/ cp ../../README.md $TARGET/ diff --git a/.gitignore b/.gitignore index 61efed6..242c19b 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ obj/ obj.*/ ee/loader/irx/ +ee/loader/version.txt iop/patches/ iop/fileio/ releases/ diff --git a/ee/loader/Makefile b/ee/loader/Makefile index 6b05617..a68eb0a 100644 --- a/ee/loader/Makefile +++ b/ee/loader/Makefile @@ -1,6 +1,9 @@ +GIT_TAG = $(shell git describe --tags) + EE_OBJS = main.o compat.o xparam.o patch.o ee_core_config.o ioprp.o toml.o EE_INCS = -I../ee_core/include EE_LIBS = -lfileXio -lpatches +EE_CFLAGS = -DGIT_TAG=\"$(GIT_TAG)\" EE_NEWLIB_NANO = 1 EE_COMPACT_EXECUTABLE = 1 @@ -12,7 +15,10 @@ EE_BIN_PACKED = $(EE_BIN_NAME).elf $(EE_BIN_PACKED): $(EE_BIN) ps2-packer $< $@ > /dev/null -all: $(EE_BIN_PACKED) +version.txt: + echo $(GIT_TAG) > $@ + +all: $(EE_BIN_PACKED) version.txt # TODO: # SCUS_971.01 Twisted Metal Black (same as opl, when quit to menu the games crash with black screen) diff --git a/ee/loader/src/main.c b/ee/loader/src/main.c index 94d98ab..8353f50 100644 --- a/ee/loader/src/main.c +++ b/ee/loader/src/main.c @@ -978,8 +978,9 @@ int main(int argc, char *argv[]) off_t iso_size = 0; printf("--------------------------------\n"); - printf("- Neutrino PS2 Device Emulator -\n"); - printf("- By Maximus32 -\n"); + printf("- Neutrino PS2 Device Emulator\n"); + printf("- Version: %s\n", GIT_TAG); + printf("- By Maximus32\n"); printf("--------------------------------\n"); /*