Skip to content

Commit

Permalink
build: Replace PACKAGE_VERSION & __DATE__ with git tag
Browse files Browse the repository at this point in the history
  • Loading branch information
GalaxyShard committed Oct 4, 2024
1 parent 8113974 commit 0c67281
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
12 changes: 11 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,20 @@
SOURCEDIRS := source
INCLUDEDIRS := source

# Try to find the SDK version if it wasn't already provided e.g. by the parent Makefile
SDK_VERSION ?= $(shell git describe --tags --exact-match --dirty 2>/dev/null)

# Fallback to commit hash
ifeq ($(SDK_VERSION),)
VERSION_ID := "commit $(shell git describe --always --dirty 2>/dev/null)"
else
VERSION_ID := "BlocksDS $(SDK_VERSION)"
endif

# Defines passed to all files
# ---------------------------

DEFINES := -DPACKAGE_VERSION=\"2.3.0\"
DEFINES := -DVERSION_ID=\"$(VERSION_ID)\"

# Libraries
# ---------
Expand Down
3 changes: 0 additions & 3 deletions source/compile_date.c

This file was deleted.

2 changes: 1 addition & 1 deletion source/ndstool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ unsigned int appFlags = 0x01;

void Title()
{
printf("Nintendo DS rom tool " PACKAGE_VERSION " - %s\nby Rafael Vuijk, Dave Murphy, Alexei Karpenko\n",CompileDate);
printf("Nintendo DS rom tool (" VERSION_ID ")\nby Rafael Vuijk, Dave Murphy, Alexei Karpenko\n");
}

// Argument information
Expand Down
2 changes: 0 additions & 2 deletions source/ndstool.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,5 +74,3 @@ extern char *gamecode;
extern int latency1;
extern int latency2;
extern unsigned int romversion;

extern const char CompileDate[];

0 comments on commit 0c67281

Please sign in to comment.