From 0e12e11ed817d66ff1e9246a32931e14e4fa6700 Mon Sep 17 00:00:00 2001 From: "Suren A. Chilingaryan" Date: Thu, 4 Feb 2016 01:18:33 +0100 Subject: Add build information --- pcitool/CMakeLists.txt | 6 +++--- pcitool/buildinfo.c | 12 ++++++++++++ pcitool/buildinfo.h | 6 ++++++ pcitool/cli.c | 21 ++++++++++++--------- 4 files changed, 33 insertions(+), 12 deletions(-) create mode 100644 pcitool/buildinfo.c create mode 100644 pcitool/buildinfo.h (limited to 'pcitool') diff --git a/pcitool/CMakeLists.txt b/pcitool/CMakeLists.txt index 2f3639f..d8b5a6c 100644 --- a/pcitool/CMakeLists.txt +++ b/pcitool/CMakeLists.txt @@ -13,9 +13,9 @@ link_directories( ) if (NOT DISABLE_PCITOOL) - add_executable(pci cli.c sysinfo.c formaters.c) - set(HEADERS ${HEADERS} sysinfo.h formaters.h) - add_dependencies(pci pcilib) + set(HEADERS ${HEADERS} sysinfo.h formaters.h buildinfo.h) + add_executable(pci cli.c sysinfo.c formaters.c buildinfo.c) + add_dependencies(pci build pcilib) target_link_libraries(pci pcilib ${FASTWRITER_LIBRARIES}) set_target_properties(pci PROPERTIES LINK_FLAGS "${CMAKE_THREAD_LIBS_INIT} ${EXTRA_SYSTEM_LIBS}" diff --git a/pcitool/buildinfo.c b/pcitool/buildinfo.c new file mode 100644 index 0000000..624a934 --- /dev/null +++ b/pcitool/buildinfo.c @@ -0,0 +1,12 @@ +#include +#include +#include "pcilib/build.h" + +void BuildInfo() { + printf("\n"); + printf("Revision: %s built on %s in %s\n", PCILIB_REVISION, PCILIB_BUILD_DATE, PCILIB_BUILD_DIR); + printf("Branch: %s by %s\n", PCILIB_REVISION_BRANCH, PCILIB_REVISION_AUTHOR); + if (strlen(PCILIB_REVISION_MODIFICATIONS)) { + printf("Modifications: %s - %s\n", PCILIB_LAST_MODIFICATION, PCILIB_REVISION_MODIFICATIONS); + } +} diff --git a/pcitool/buildinfo.h b/pcitool/buildinfo.h new file mode 100644 index 0000000..5157a24 --- /dev/null +++ b/pcitool/buildinfo.h @@ -0,0 +1,6 @@ +#ifndef _PCITOOL_BUILDINFO_H +#define _PCITOOL_BUILDINFO_H + +void BuildInfo(); + +#endif /* _PCITOOL_BUILDINFO_H */ \ No newline at end of file diff --git a/pcitool/cli.c b/pcitool/cli.c index 4d5d3d5..bb3d9b8 100644 --- a/pcitool/cli.c +++ b/pcitool/cli.c @@ -31,18 +31,19 @@ #include "pcitool/sysinfo.h" #include "pcitool/formaters.h" +#include "pcitool/buildinfo.h" #include "views/transform.h" #include "views/enum.h" -#include "pci.h" -#include "plugin.h" -#include "config.h" -#include "tools.h" -#include "kmem.h" -#include "error.h" -#include "debug.h" -#include "model.h" -#include "locking.h" +#include "pcilib/pci.h" +#include "pcilib/plugin.h" +#include "pcilib/config.h" +#include "pcilib/tools.h" +#include "pcilib/kmem.h" +#include "pcilib/error.h" +#include "pcilib/debug.h" +#include "pcilib/model.h" +#include "pcilib/locking.h" /* defines */ #define MAX_KBUF 14 @@ -895,6 +896,8 @@ void Version(pcilib_t *handle, const pcilib_model_description_t *model_info) { PCILIB_VERSION_GET_MICRO(version) ); } + + BuildInfo(); } void Info(pcilib_t *handle, const pcilib_model_description_t *model_info, const char *target) { -- cgit v1.2.3