diff --git a/Makefile.am b/Makefile.am index bab81333..aed4370e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -5,6 +5,7 @@ ACLOCAL_AMFLAGS = -I m4 MAINTAINERCLEANFILES = aclocal.m4 config.* compile configure depcomp \ install-sh ltmain.sh missing mkinstalldirs \ Makefile.in */Makefile.in */*/Makefile.in \ + version.h \ ABOUT-NLS \ po/Makefile.in.in po/Makevars.template po/Rules-quot \ po/*.header po/*.sed po/*.sin po/e16.pot \ @@ -12,10 +13,12 @@ MAINTAINERCLEANFILES = aclocal.m4 config.* compile configure depcomp \ CLEANFILES = $(PACKAGE).spec +BUILT_SOURCES = version.h + SUBDIRS = dox eesh epp src lib config themes fonts scripts misc docs icons pix po EXTRA_DIST = \ -$(PACKAGE).spec.in \ +$(PACKAGE).spec.in version.h \ sample-scripts/bouncingball.pl \ sample-scripts/lcdmover.sh \ sample-scripts/testroller.pl \ @@ -24,8 +27,16 @@ sample-scripts/place-pagers.pl \ AUTHORS COMPLIANCE COPYING ChangeLog if SRC_IS_GIT +version.h: FORCE + @echo '#define E16_VERSION "'`git describe --dirty`'"' > $@.tmp + @if cmp -s $@.tmp $@; then rm $@.tmp; else mv $@.tmp $@; fi + RPM_RELEASE=`echo -n "1.%(date '+%y%m%d').git"; git rev-parse --short=8 HEAD` else +version.h: + @echo '#define E16_VERSION "@VERSION@"' > $@.tmp + @if cmp -s $@.tmp $@; then rm $@.tmp; else mv $@.tmp $@; fi + RPM_RELEASE=1 endif diff --git a/src/Makefile.am b/src/Makefile.am index d6bb01ee..a4145e66 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -132,6 +132,7 @@ AM_CPPFLAGS = \ e16_CPPFLAGS = \ $(AM_CPPFLAGS) \ + -I$(top_srcdir) \ -I$(top_builddir) \ $(MODULE_CFLAGS) \ $(IMLIB2_CFLAGS) \ diff --git a/src/main.c b/src/main.c index 58033629..cd27508c 100644 --- a/src/main.c +++ b/src/main.c @@ -44,10 +44,11 @@ #include "session.h" #include "snaps.h" #include "user.h" +#include "version.h" #include "xwin.h" const char e_wm_name[] = "e16"; -const char e_wm_version[] = VERSION; +const char e_wm_version[] = E16_VERSION; EConf Conf; EMode Mode;