diff options
Diffstat (limited to 'Makefile.am')
-rw-r--r-- | Makefile.am | 37 |
1 files changed, 35 insertions, 2 deletions
diff --git a/Makefile.am b/Makefile.am index 72619ec..0eb4b0e 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,6 +1,39 @@ -SUBDIRS=src @GRECS_TESTDIR@ @GRECS_DOCDIR@ -EXTRA_DIST=@GRECS_BUILD_AUX@ +# This file is part of Grecs +# Copyright (C) 2007, 2009-2011 Sergey Poznyakoff +# +# Grecs is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# Grecs is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Grecs. If not, see <http://www.gnu.org/licenses/>. + ACLOCAL_AMFLAGS = -I am +SUBDIRS=. src @GRECS_TESTDIR@ @GRECS_DOCDIR@ +EXTRA_DIST=@GRECS_BUILD_AUX@ gitid.h + +noinst_HEADERS = gitid.h +BUILT_SOURCES = gitid.h + +.PHONY: gitid.h +gitid.h: + @if test -d .git; then \ + url=`git config --get remote.origin.url | sed 's|.*://||'`; \ + if test "$$url" = "git.gnu.org.ua/gitroot/grecs.git"; then \ + dirty=`git diff-index --name-only HEAD 2>/dev/null` || dirty=;\ + test -n "$$dirty" && dirty="-dirty"; \ + ID=`git log -1 --pretty='%H-%ct-%ae'`$$dirty;\ + echo "#define GRECS_GIT_ID \"$$ID\"" > gitid.tmp; \ + cmp gitid.tmp gitid.h >/dev/null 2>&1 || mv gitid.tmp gitid.h; \ + rm -f gitid.tmp; \ + fi; \ + fi; @GRECS_CHANGELOG@.PHONY: ChangeLog @GRECS_CHANGELOG@ChangeLog: |