diff --git a/meson.build b/meson.build index 1cded64..08ad5a2 100644 --- a/meson.build +++ b/meson.build @@ -34,6 +34,13 @@ subdir('stub') linker_script = meson.current_source_dir() / 'ogc.ld' +git = find_program('git') +version_file = vcs_tag( + command: [git, 'describe', '--always', '--tags', '--dirty'], + input: 'source/version.c.in', + output: 'version.c', +) + iplboot = executable( 'iplboot', 'source/main.c', @@ -42,6 +49,7 @@ iplboot = executable( 'source/fatfs/ffsystem.c', 'source/fatfs/ffunicode.c', 'source/ffshim.c', + version_file, dependencies: [ libogc_deps['ogc'], stub_dep, diff --git a/source/main.c b/source/main.c index 19770f1..3ea4e43 100644 --- a/source/main.c +++ b/source/main.c @@ -10,6 +10,7 @@ #include "ffshim.h" #include "fatfs/ff.h" #include "utils.h" +#include "version.h" #include "stub.h" @@ -21,7 +22,7 @@ int dol_argc = 0; char *dol_argv[MAX_NUM_ARGV]; u16 all_buttons_held; -char *default_path = "/ipl.dol"; +char *default_path = "/ipl2.dol"; struct shortcut { u16 pad_buttons; char *path; @@ -346,7 +347,7 @@ int main() VIDEO_WaitVSync(); CON_Init(__xfb, 0, 0, rmode->fbWidth, rmode->xfbHeight, rmode->fbWidth * VI_DISPLAY_PIX_SZ); - kprintf("\n\niplboot\n"); + kprintf("\n\niplboot %s\n", version); // Disable Qoob u32 val = 6 << 24; diff --git a/source/version.c.in b/source/version.c.in new file mode 100644 index 0000000..f2942d0 --- /dev/null +++ b/source/version.c.in @@ -0,0 +1 @@ +char version[] = "@VCS_TAG@"; diff --git a/source/version.h b/source/version.h new file mode 100644 index 0000000..a18045b --- /dev/null +++ b/source/version.h @@ -0,0 +1,3 @@ +#pragma once + +extern char version[];