- version-header: generalize (add built_date and vcs string)

This commit is contained in:
svenhoefer
2013-06-01 09:44:45 +02:00
parent daf539b141
commit 5c0a692f13
2 changed files with 9 additions and 16 deletions

View File

@@ -1,24 +1,17 @@
AM_CPPFLAGS = -fno-rtti -fno-exceptions -D__STDC_FORMAT_MACROS AM_CPPFLAGS = -fno-rtti -fno-exceptions -D__STDC_FORMAT_MACROS
#AM_CPPFLAGS = -fno-rtti #AM_CPPFLAGS = -fno-rtti
BUILT_SOURCES = git_version.h BUILT_SOURCES = version.h
git_version.h: version.h:
@rm -f $@; \
echo '#define BUILT_DATE "'`date`'"' > $@
@if test -d $(top_srcdir)/.git ; then \ @if test -d $(top_srcdir)/.git ; then \
pushd $(top_srcdir) ; \ pushd $(top_srcdir) ; \
GITDESCRIBE=$$(git describe --always --dirty || echo `date`) ; \ GITDESCRIBE=$$(git describe --always --dirty || echo 'VCS failed') ; \
popd ; \ popd ; \
echo "#define GITVERSION \"$${GITDESCRIBE}\" " > git_version.h.tmp ; \ echo '#define VCS "'$${GITDESCRIBE}'"' >> $@ ; \
if diff -q git_version.h git_version.h.tmp >/dev/null 2>&1 ; then \
rm -f git_version.h.tmp ; \
else \
rm -f git_version.h ; \
mv git_version.h.tmp git_version.h ; \
fi; \
else \
rm -f git_version.h; \
echo '#define BUILT_DATE "'`date`'"' > git_version.h ; \
fi fi
noinst_HEADERS = git_version.h noinst_HEADERS = version.h
.PHONY: git_version.h .PHONY: version.h
SUBDIRS = bedit components widget SUBDIRS = bedit components widget

View File

@@ -39,7 +39,7 @@
#include <daemonc/remotecontrol.h> #include <daemonc/remotecontrol.h>
#include <system/flashtool.h> #include <system/flashtool.h>
#include "git_version.h" #include "version.h"
#define GIT_DESC "GIT Desc.:" #define GIT_DESC "GIT Desc.:"
#define GIT_REV "GIT Build:" #define GIT_REV "GIT Build:"
#define LICENSEDIR DATADIR "/neutrino/license/" #define LICENSEDIR DATADIR "/neutrino/license/"