Skip to content

Commit

Permalink
Resolve #50, Add buildnumber to version info
Browse files Browse the repository at this point in the history
Reformat string output for "elf2cfetbl -V"
Add string helper macro
Add macros for buildnumber, elf2cfetbl version, and version string
Set buildnumber
  • Loading branch information
Gerardo E. Cruz-Ortiz committed Jul 19, 2020
1 parent 169cd8f commit dac9f74
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 5 deletions.
5 changes: 2 additions & 3 deletions elf2cfetbl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1281,9 +1281,7 @@ int32 ProcessCmdLineOptions(int ArgumentCount, char *Arguments[])

void OutputVersionInfo(void)
{
printf("\nElf Object File to cFE Table Image File Conversion Tool\n");
printf("Version v%d.%d.%d.%d ", ELF2CFETBL_MAJOR_VERSION, ELF2CFETBL_MINOR_VERSION, ELF2CFETBL_REVISION, ELF2CFETBL_MISSION_REV);
printf(" Built - %s %s\n\n", __DATE__, __TIME__);
printf("\n%s\n", ELF2CFETBL_VERSION_STRING);
}

/**
Expand All @@ -1292,6 +1290,7 @@ void OutputVersionInfo(void)

void OutputHelpInfo(void)
{
printf("\nElf Object File to cFE Table Image File Conversion Tool (elf2cfetbl)\n\n");
printf("elf2cfetbl [-tTblName] [-d\"Description\"] [-h] [-v] [-V] [-s#] [-p#] [-n] \n");
printf(" [-T] [-eYYYY:MM:DD:hh:mm:ss] [-fYYYY:MM:DD:hh:mm:ss] SrcFilename [DestDirectory]\n");
printf(" where:\n");
Expand Down
46 changes: 44 additions & 2 deletions elf2cfetbl_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,54 @@
#ifndef ELF2CFETBL_VERSION_H
#define ELF2CFETBL_VERSION_H


/* Development Build Macro Definitions */
/** @brief Number of commits since baseline v3.1.0 */
#define ELF2CFETBL_BUILD_NUMBER 36
#define ELF2CFETBL_BUILD_BASELINE "v3.1.0+dev"

/*
* Macro Definitions
* Version Macro Definitions
* These are only used for OFFICIAL release builds.
*/
#define ELF2CFETBL_MAJOR_VERSION 3
#define ELF2CFETBL_MINOR_VERSION 1
#define ELF2CFETBL_REVISION 5
#define ELF2CFETBL_REVISION 0
#define ELF2CFETBL_MISSION_REV 0

/*
* Tools to construct version string
*/
#define ELF2CFETBL_STR_HELPER(x) #x
#define ELF2CFETBL_STR(x) ELF2CFETBL_STR_HELPER(x)

/* Development Build Format for ELF2CFETBL_VERSION */
/* Baseling git tag + Number of commits since baseline, see elf2cfetbl_buildnumber.h */
#define ELF2CFETBL_VERSION ELF2CFETBL_BUILD_BASELINE ELF2CFETBL_STR(ELF2CFETBL_BUILD_NUMBER)

/* Development Build Format for ELF2CFETBL_VERSION_STRING */
#define ELF2CFETBL_VERSION_STRING \
" elf2cfetbl Development Build\n" \
" " ELF2CFETBL_VERSION " (Codename: Bootes)\n" /* Codename for current development */ \
" Last Offical Release: elf2cfetbl v3.1.0" /* For full support please use official release version */

/* Use the following templates for Official Releases ONLY */
/* Official Release format for ELF2CFETBL_VERSION */
/*
#define ELF2CFETBL_VERSION "v" \
ELF2CFETBL_STR(ELF2CFETBL_MAJOR_VERSION) "." \
ELF2CFETBL_STR(ELF2CFETBL_MINOR_VERSION) "." \
ELF2CFETBL_STR(ELF2CFETBL_REVISION) "." \
ELF2CFETBL_STR(ELF2CFETBL_MISSION_REV)
*/


/* Official Release format for ELF2CFETBL_VERSION_STRING */
/*
#define ELF2CFETBL_VERSION_STRING "elf2cfetbl " ELF2CFETBL_VERSION
*/

/* END TEMPLATES */


#endif /* ELF2CFETBL_VERSION_H */

0 comments on commit dac9f74

Please sign in to comment.