[build] Include version number within only a single object file

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2012-11-02 14:46:39 +00:00
parent 0932bc5156
commit 4867085c0c
11 changed files with 87 additions and 21 deletions

View File

@@ -21,6 +21,7 @@ FILE_LICENCE ( GPL2_OR_LATER );
#include <ipxe/shell.h>
#include <ipxe/image.h>
#include <ipxe/keys.h>
#include <ipxe/version.h>
#include <usr/prompt.h>
#include <usr/autoboot.h>
#include <config/general.h>
@@ -82,10 +83,10 @@ __asmcall int main ( void ) {
* do so.
*
*/
printf ( NORMAL "\n\n" PRODUCT_NAME "\n" BOLD "iPXE " VERSION
printf ( NORMAL "\n\n" PRODUCT_NAME "\n" BOLD "iPXE %s"
NORMAL " -- Open Source Network Boot Firmware -- "
CYAN "http://ipxe.org" NORMAL "\n"
"Features:" );
"Features:", product_version );
for_each_table_entry ( feature, FEATURES )
printf ( " %s", feature->name );
printf ( "\n" );

41
src/core/version.c Normal file
View File

@@ -0,0 +1,41 @@
/*
* Copyright (C) 2012 Michael Brown <mbrown@fensystems.co.uk>.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*/
FILE_LICENCE ( GPL2_OR_LATER );
/** @file
*
* Version number
*
*/
#include <ipxe/features.h>
#include <ipxe/version.h>
/** Version number feature */
FEATURE_VERSION ( VERSION_MAJOR, VERSION_MINOR, VERSION_PATCH );
/** Product major version */
const int product_major_version = VERSION_MAJOR;
/** Product minor version */
const int product_minor_version = VERSION_MINOR;
/** Product version string */
const char *product_version = VERSION;