Signed-off-by: Liam Girdwood liam.r.girdwood@linux.intel.com --- .gitignore | 2 ++ Makefile.am | 5 ++++- configure.ac | 2 +- git-version.sh | 16 ++++++++++++++-- src/ipc/intel-ipc.c | 3 +-- 5 files changed, 22 insertions(+), 6 deletions(-)
diff --git a/.gitignore b/.gitignore index 9223f60..c8a8ab0 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,8 @@ *.man .version .tarball-version +*.x +.build
Makefile Makefile.in diff --git a/Makefile.am b/Makefile.am index c47580e..362e2bd 100644 --- a/Makefile.am +++ b/Makefile.am @@ -17,10 +17,13 @@ export PLATFORM_INCDIR = \
BUILT_SOURCES = $(top_srcdir)/src/include/version.h
-$(top_srcdir)/src/include/version.h: +$(top_srcdir)/src/include/version.h: Makefile ./git-version.sh
dist-hook: ./git-version.sh cat .version > $(distdir)/.tarball-version cat .version > $(distdir)/.version + +all-local: + rm -f $(top_srcdir)/src/include/version.h diff --git a/configure.ac b/configure.ac index 7c1acf4..f085a73 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@
AC_PREREQ([2.69]) -AC_INIT([Reef],[m4_esyscmd(./git-version.sh)],[sound-open-firmware@alsa-project.org]) +AC_INIT([Reef],[m4_esyscmd(./git-version.sh), m4_esyscmd(rm -f .build)],[sound-open-firmware@alsa-project.org]) AC_CONFIG_SRCDIR([src/init/init.c]) AC_CONFIG_HEADERS([src/include/config.h]) AC_CONFIG_MACRO_DIRS([m4]) diff --git a/git-version.sh b/git-version.sh index f8f1e58..c6beb40 100755 --- a/git-version.sh +++ b/git-version.sh @@ -1,10 +1,22 @@
# version for configure -echo -n `git describe --abbrev=4` +# echo -n `git describe --abbrev=4`
# version for make dist git describe --abbrev=4 > .version git describe --abbrev=4 > .tarball-version
# git commit for IPC -echo "#define REEF_BUILD "`git describe --abbrev=4 | cut -d- -f3`"" > src/include/version.h +echo "#define REEF_TAG "`git describe --abbrev=4 | cut -d- -f3`"" > src/include/version.h + +# build counter +if [ -e .build ]; then + num=$((`cat .build` + 1)) +else + num=0 +fi + +# save and insert build counter +echo $num > .build +echo "#define REEF_BUILD $num" >> src/include/version.h + diff --git a/src/ipc/intel-ipc.c b/src/ipc/intel-ipc.c index 7db4179..e0ab4f7 100644 --- a/src/ipc/intel-ipc.c +++ b/src/ipc/intel-ipc.c @@ -120,11 +120,10 @@ static inline uint32_t msg_get_stage_type(uint32_t msg)
/* TODO: add build count */ static const struct ipc_intel_ipc_fw_version fw_version = { - .build = 0, + .build = REEF_BUILD, .minor = REEF_MINOR, .major = REEF_MAJOR, .type = 0, - .fw_build_hash = REEF_BUILD, .fw_log_providers_hash = 0, };