Skip to content

Commit

Permalink
Fix #6, Replace hardcoded string with version file
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerardo E. Cruz-Ortiz committed Jul 8, 2020
1 parent 685964d commit 1eabaf5
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
3 changes: 2 additions & 1 deletion elf2cfetbl.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
#include <limits.h>
#include "ELF_Structures.h"
#include "cfe_tbl_filedef.h"
#include "elf2cfetbl_version.h"

#define MAX_SECTION_HDR_NAME_LEN (128)
#define TBL_DEF_SYMBOL_NAME "CFE_TBL_FileDef"
Expand Down Expand Up @@ -1275,7 +1276,7 @@ int32 ProcessCmdLineOptions(int ArgumentCount, char *Arguments[])
void OutputVersionInfo(void)
{
printf("\nElf Object File to cFE Table Image File Conversion Tool\n");
printf(" Version v3.1.5\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__);
}

Expand Down
40 changes: 40 additions & 0 deletions elf2cfetbl_version.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
** 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_version.h
*
* Purpose:
* Provide version identifiers for the ELF to cFE Table Converter.
* See cfe documentation for version and build number and description
*/

#ifndef ELF2CFETBL_VERSION_H
#define ELF2CFETBL_VERSION_H

/*
* Macro Definitions
*/
#define ELF2CFETBL_MAJOR_VERSION 3
#define ELF2CFETBL_MINOR_VERSION 1
#define ELF2CFETBL_REVISION 5
#define ELF2CFETBL_MISSION_REV 0

#endif /* ELF2CFETBL_VERSION_H */

0 comments on commit 1eabaf5

Please sign in to comment.