diff options
author | Suren A. Chilingaryan <csa@suren.me> | 2016-02-04 01:18:33 +0100 |
---|---|---|
committer | Suren A. Chilingaryan <csa@suren.me> | 2016-02-04 01:18:33 +0100 |
commit | 0e12e11ed817d66ff1e9246a32931e14e4fa6700 (patch) | |
tree | 6d2a2f2c6f374a0df45605701a0f736f2993a8a5 /pcitool | |
parent | 333fe52eb3c7876cfe668dfe0445d34c46989d73 (diff) | |
download | pcitool-0e12e11ed817d66ff1e9246a32931e14e4fa6700.tar.gz pcitool-0e12e11ed817d66ff1e9246a32931e14e4fa6700.tar.bz2 pcitool-0e12e11ed817d66ff1e9246a32931e14e4fa6700.tar.xz pcitool-0e12e11ed817d66ff1e9246a32931e14e4fa6700.zip |
Add build information
Diffstat (limited to 'pcitool')
-rw-r--r-- | pcitool/CMakeLists.txt | 6 | ||||
-rw-r--r-- | pcitool/buildinfo.c | 12 | ||||
-rw-r--r-- | pcitool/buildinfo.h | 6 | ||||
-rw-r--r-- | pcitool/cli.c | 21 |
4 files changed, 33 insertions, 12 deletions
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 <stdio.h> +#include <string.h> +#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) { |