diff --git a/Makefile b/Makefile index 5ac91f7..d187d39 100644 --- a/Makefile +++ b/Makefile @@ -54,7 +54,7 @@ CFLAGS += $(INCLUDE) CXXFLAGS := $(CFLAGS) -fno-rtti -fno-exceptions ASFLAGS := -g $(ARCH) -LDFLAGS = -g $(ARCH) -Wl,-Map,$(notdir $*.map) +LDFLAGS = -g $(ARCH) -Wl,-Map,$(notdir $*.map),--undefined=balatro_version #--------------------------------------------------------------------------------- # any extra libraries we wish to link with the project diff --git a/source/game.c b/source/game.c index 018ebb6..625ecc6 100644 --- a/source/game.c +++ b/source/game.c @@ -28,7 +28,6 @@ #include "soundbank.h" #include "list.h" -#include "version.h" static uint rng_seed = 0; diff --git a/include/version.h b/source/version.c similarity index 68% rename from include/version.h rename to source/version.c index 85be8ff..9d850d8 100644 --- a/include/version.h +++ b/source/version.c @@ -1,6 +1,3 @@ -#ifndef VERSION_H -#define VERSION_H - #ifndef GIT_HASH #define GIT_HASH "undef" #endif @@ -9,7 +6,5 @@ #define GIT_DIRTY "-dirty" #endif -__attribute__((used)) +__attribute__((section(".version"), used)) const char balatro_version[] = "GBALATRO_VERSION:" GIT_HASH GIT_DIRTY; - -#endif // VERSION_H