Skip to content

Commit

Permalink
Resolve nasa#50, Add baseline and build to version report
Browse files Browse the repository at this point in the history
Reformat string output for "elf2cfetbl -V"
Set buildnumber to 36
Add string helper macro
Add macro for version string and for buildnumber
Add comment to refer to official release
  • Loading branch information
astrogeco authored and Gerardo E. Cruz-Ortiz committed Jul 14, 2020
1 parent 169cd8f commit ebd2796
Show file tree
Hide file tree
Showing 2 changed files with 39 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
39 changes: 37 additions & 2 deletions elf2cfetbl_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,46 @@
#define ELF2CFETBL_VERSION_H

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


/*
* Development build identifiers
*/


#define ELF2CFETBL_BUILDNUMBER 36 /* Number of commits since baseline */

#define ELF2CFETBL_VERSION_STRING \
"elf2cfetbl development build " \
"\n3.1.0+dev" /* Baseling git tag */ \
ELF2CFETBL_STR(ELF2CFETBL_BUILDNUMBER) /* Number of commits since baseline */ \
" (Codename: Bootes)" /* Codename for current development */ \
"\n\nCompiled on " __DATE__ __TIME__ \
"\n\nLatest Official Version: elf2cfetbl v3.1.0\n" /* For full support please use this version */


/*
* 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

/* This definition replaces ELF2CFETBL_VERSION_STRING in official relase builds
// #define ELF2CFETBL_VERSION_STRING \
// "elf2cfetbl version " \
// ELF2CFETBL_STR(ELF2CFETBL_MAJOR_VERSION) "." \
// ELF2CFETBL_STR(ELF2CFETBL_MINOR_VERSION) "." \
// ELF2CFETBL_STR(ELF2CFETBL_REVISION) "." \
// ELF2CFETBL_STR(ELF2CFETBL_MISSION_REV) \
// "\n\nCompiled on " __DATE__ ", " __TIME__ "\n"
*/


#endif /* ELF2CFETBL_VERSION_H */

0 comments on commit ebd2796

Please sign in to comment.