From 90cd360627ddb9c03c17deac4015025e39642d83 Mon Sep 17 00:00:00 2001 From: "Gerardo E. Cruz-Ortiz" <59618057+astrogeco@users.noreply.github.com> Date: Tue, 7 Jul 2020 09:40:19 -0400 Subject: [PATCH] Add macro for release version and version string --- elf2cfetbl.c | 2 +- elf2cfetbl_version.h | 20 +++++++++++++++++--- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/elf2cfetbl.c b/elf2cfetbl.c index 3705529..98a2a0d 100644 --- a/elf2cfetbl.c +++ b/elf2cfetbl.c @@ -1287,7 +1287,7 @@ void OutputVersionInfo(void) * printf("Version v%d.%d.%d.%d ", ELF2CFETBL_MAJOR_VERSION, ELF2CFETBL_MINOR_VERSION, ELF2CFETBL_REVISION, ELF2CFETBL_MISSION_REV); */ - printf("DEVELOPMENT VERSION: %s-%d (v%s+dev%d))\n", ELF2CFETBL_CODENAME, ELF2CFETBL_BUILDNUMBER, ELF2CFETBL_BASELINE, ELF2CFETBL_BUILDNUMBER); + printf("%s\n", ELF2CFETBL_VERSION_STRING); printf(" Built - %s %s\n\n", __DATE__, __TIME__); } diff --git a/elf2cfetbl_version.h b/elf2cfetbl_version.h index f5c66b3..5484c3f 100644 --- a/elf2cfetbl_version.h +++ b/elf2cfetbl_version.h @@ -35,13 +35,27 @@ #define ELF2CFETBL_CODENAME "Bootes" #define ELF2CFETBL_BASELINE "v3.1.0" #define ELF2CFETBL_BUILDNUMBER 34 - /* * Version Macro Definitions + * ONLY APPLY if CFS_RELEASE_BUILD == TRUE */ #define ELF2CFETBL_MAJOR_VERSION 3 #define ELF2CFETBL_MINOR_VERSION 1 -#define ELF2CFETBL_REVISION 5 -#define ELF2CFETBL_MISSION_REV 0 +#define ELF2CFETBL_REVISION 5 +#define ELF2CFETBL_MISSION_REV 0 + +#ifdef ELF2CFETBL_RELEASE_BUILD + +#define ELF2CFETBL_VERSION_STRING \ + ("elf2cfetbl version " ELF2CFETBL_MAJOR_VERSION "." ELF2CFETBL_MINOR_VERSION \ + "." ELF2CFETBL_REVISION) + +#else /* CFS_RELEASE_BUILD */ + +#define ELF2CFETBL_VERSION_STRING \ + ("elf2cfetbl DEVELOPMENT BUILD " ELF2CFETBL_BASELINE "+dev" ELF2CFETBL_BUILDNUMBER \ + " " ELF2CFETBL_CODENAME) + +#endif /* CFS_RELEASE_BUILD */ #endif /* ELF2CFETBL_VERSION_H */