aboutsummaryrefslogtreecommitdiff
path: root/Makefile.am
blob: 3eaa8df4123b9e5911dbf32a485cc01ca453b10d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
# This file is part of Grecs
# Copyright (C) 2007-2016 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=. include src @GRECS_TESTDIR@ @GRECS_DOCDIR@
EXTRA_DIST=build-aux/yyrename @GRECS_BUILD_AUX@ @GRECS_DISTDOC@ gitid.h

noinst_HEADERS = gitid.h
BUILT_SOURCES = gitid.h README

.PHONY: gitid.h
gitid.h:
	@if test -e .git; then \
           url=`git config --get remote.origin.url | sed 's|.*://||;s|/gitroot/|/|'`; \
	   case $$url in \
           git.gnu.org.ua/grecs.git|*@git.gnu.org.ua/grecs.git) \
	      dirty=`git diff-index --name-only HEAD 2>/dev/null` || dirty=;\
              test -n "$$dirty" && dirty="-dirty"; \
	      ID=`git log -1 --pretty='format:%H-%ct-%ae'`$$dirty;\
	      echo "#define GRECS_GIT_ID \"$$ID\"";; \
           *) echo "#define GRECS_GIT_ID \"unknown\"";; \
           esac > gitid.tmp; \
	   cmp gitid.tmp gitid.h >/dev/null 2>&1 || mv gitid.tmp gitid.h; \
	   rm -f gitid.tmp; \
	fi; 

README:
	test -f @GRECS_README@ && cp @GRECS_README@ README

@GRECS_CHANGELOG@.PHONY: ChangeLog
@GRECS_CHANGELOG@ChangeLog:
@GRECS_CHANGELOG@	$(AM_V_GEN)if test -d .git; then                                   \
@GRECS_CHANGELOG@          git log --pretty='format:%ct  %an  <%ae>%n%n%s%n%n%b%n' |        \
@GRECS_CHANGELOG@            awk -f $(top_srcdir)/build-aux/git2chg.awk > ChangeLog;        \
@GRECS_CHANGELOG@        fi

Return to:

Send suggestions and report system problems to the System administrator.