Add defaults for GIT_HASH and GIT_DIRTY
This commit is contained in:
@@ -39,7 +39,7 @@ GRAPHICS := graphics
|
|||||||
ARCH := -mthumb -mthumb-interwork
|
ARCH := -mthumb -mthumb-interwork
|
||||||
|
|
||||||
GIT_DIRTY := $(shell git diff-index --quiet HEAD -- || echo "-dirty")
|
GIT_DIRTY := $(shell git diff-index --quiet HEAD -- || echo "-dirty")
|
||||||
GIT_HASH := $(shell git rev-parse --short HEAD)
|
GIT_HASH := $(shell git rev-parse --short HEAD || echo "undef")
|
||||||
GIT_C_FLAGS := -DGIT_HASH=\"$(GIT_HASH)\" -DGIT_DIRTY=\"$(GIT_DIRTY)\"
|
GIT_C_FLAGS := -DGIT_HASH=\"$(GIT_HASH)\" -DGIT_DIRTY=\"$(GIT_DIRTY)\"
|
||||||
|
|
||||||
CFLAGS := -g -O3 -Wall -Werror\
|
CFLAGS := -g -O3 -Wall -Werror\
|
||||||
|
|||||||
+9
-1
@@ -1,7 +1,15 @@
|
|||||||
#ifndef VERSION_H
|
#ifndef VERSION_H
|
||||||
#define VERSION_H
|
#define VERSION_H
|
||||||
|
|
||||||
|
#ifndef GIT_HASH
|
||||||
|
#define GIT_HASH "undef"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef GIT_DIRTY
|
||||||
|
#define GIT_DIRTY "-dirty"
|
||||||
|
#endif
|
||||||
|
|
||||||
__attribute__((used))
|
__attribute__((used))
|
||||||
const char gba_version[] = "GBA_VERSION:" GIT_HASH GIT_DIRTY;
|
const char balatro_version[] = "GBALATRO_VERSION:" GIT_HASH GIT_DIRTY;
|
||||||
|
|
||||||
#endif // VERSION_H
|
#endif // VERSION_H
|
||||||
|
|||||||
Reference in New Issue
Block a user