summaryrefslogtreecommitdiffabout
path: root/Makefile.am
blob: 4fdef33172df590a69191811ce98a98e9825722a (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
49
50
51
52
53
54
55
# This file is part of Grecs
# Copyright (C) 2007-2019 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@

# Wordsplit components.
WORDSPLIT_SRC = wordsplit/wordsplit.c wordsplit/wordsplit.h
WORDSPLIT_TEST = wordsplit/wordsplit.at wordsplit/wsp.c
WORDSPLIT_DOC = wordsplit/wordsplit.3

EXTRA_DIST=build-aux/yyrename @GRECS_BUILD_AUX@ @GRECS_DISTDOC@ gitid.h\
           $(WORDSPLIT_SRC) @GRECS_EXTRA_DIST@

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.