Skip to content

Commit

Permalink
Resolve nasa#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, baseline, elf2cfetbl_version, and version string
Set buildnumber
  • Loading branch information
astrogeco authored and Gerardo E. Cruz-Ortiz committed Jul 15, 2020
1 parent 169cd8f commit a39b6d4
Show file tree
Hide file tree
Showing 3 changed files with 72 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
35 changes: 35 additions & 0 deletions elf2cfetbl_buildnumber.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
/*
** GSC-18128-1, "Core Flight Executive Version 6.7"
**
** Copyright (c) 2006-2019 United States Government as represented by
** the Administrator of the National Aeronautics and Space Administration.
** All Rights Reserved.
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/

/*
* File: elf2cfetbl_buildnumber.h
*
* Purpose:
* Provide development version identifier for the ELF to cFE Table Converter.
* See cfe documentation for version and buildnumber description and explanation
*/

#ifndef ELF2CFETBL_BUILDNUMBER_H
#define ELF2CFETBL_BUILDNUMBER_H

#define ELF2CFETBL_BUILDNUMBER 36 /* Number of commits since baseline */
#define ELF2CFETBL_BUILDBASELINE "v3.1.0" /* Number of commits since baseline */

#endif
37 changes: 35 additions & 2 deletions elf2cfetbl_version.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,45 @@
#ifndef ELF2CFETBL_VERSION_H
#define ELF2CFETBL_VERSION_H


#include "elf2cfetbl_buildnumber.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_VERSION ELF2CFETBL_BUILDBASELINE "+dev" ELF2CFETBL_STR(ELF2CFETBL_BUILDNUMBER) /* Baseling git tag + Number of commits since baseline, see elf2cfetbl_buildnumber.h */

#define ELF2CFETBL_VERSION_STRING /* Used to report the full version */ \
" elf2cfetbl Development Build\n " \
ELF2CFETBL_VERSION " (Codename: Bootes)" /* Codename for current development */ \
"\n Last Offical Release: elf2cfetbl v3.1.0" /* 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 a39b6d4

Please sign in to comment.