3 # Copyright (C) 1999-2004, 2006-2017, 2020 Free Software Foundation,
6 # This program is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program. If not, see <https://www.gnu.org/licenses/>.
19 ACLOCAL_AMFLAGS = -I m4
21 ## All of these will be incrementally updated later, here or in included
22 ## makefile fragments.
27 MAINTAINERCLEANFILES =
30 EXTRA_DIST = ChangeLog.0 ChangeLog.1 ChangeLog.2 ChangeLog.3 \
31 BUGS COPYINGv3 COPYING.EXCEPTION \
32 GNUmakefile maint.mk cfg.mk \
33 build-aux/gendocs.sh \
34 build-aux/git-version-gen \
35 build-aux/announce-gen build-aux/gnupload \
36 build-aux/gitlog-to-changelog \
37 build-aux/help-extract.pl \
38 .prev-version .version
41 -e 's|@SHELL[@]|$(SHELL)|g' \
42 -e 's|@PERL[@]|$(PERL)|g' \
43 -e 's|@PERL_FLOCK[@]|$(PERL_FLOCK)|g' \
44 -e 's|@bindir[@]|$(bindir)|g' \
45 -e 's|@pkgdatadir[@]|$(pkgdatadir)|g' \
46 -e 's|@prefix[@]|$(prefix)|g' \
47 -e 's|@autoconf-name[@]|'`echo autoconf | sed '$(transform)'`'|g' \
48 -e 's|@autoheader-name[@]|'`echo autoheader | sed '$(transform)'`'|g' \
49 -e 's|@autom4te-name[@]|'`echo autom4te | sed '$(transform)'`'|g' \
50 -e 's|@M4[@]|$(M4)|g' \
51 -e 's|@M4_DEBUGFILE[@]|$(M4_DEBUGFILE)|g' \
52 -e 's|@M4_GNU[@]|$(M4_GNU)|g' \
53 -e 's|@AWK[@]|$(AWK)|g' \
54 -e 's|@RELEASE_YEAR[@]|$(RELEASE_YEAR)|g' \
55 -e 's|@VERSION[@]|$(VERSION)|g' \
56 -e 's|@PACKAGE_NAME[@]|$(PACKAGE_NAME)|g' \
57 -e 's|@configure_input[@]|Generated from $@.in; do not edit by hand.|g'
59 include $(srcdir)/lib/freeze.mk
65 custom_MAKEINFOFLAGS = --no-headers --no-validate --no-split
67 if MAKE_CASE_SENSITIVE
68 pkgdata_DATA = $(srcdir)/INSTALL
69 MAINTAINERCLEANFILES += $(srcdir)/INSTALL
71 # Don't leave blank line at end of file.
72 OMIT_TRAILING_EMPTY_LINES = '/^$$/H; /^$$/d; x; s/\n//p; s/\n*//; x'
73 # Prefer 'plain quotes' over `makeinfo quotes'.
74 CONVERT_QUOTES = "s/\`\([^']*\)'/'\1'/g"
76 $(srcdir)/INSTALL: $(top_srcdir)/doc/install.texi
77 echo @firstparagraphindent insert \
78 | cat - $(top_srcdir)/doc/install.texi > tmp.texi
79 $(MAKEINFO) $(custom_MAKEINFOFLAGS) $(MAKEINFOFLAGS) \
80 --plaintext tmp.texi \
81 | sed -e $(CONVERT_QUOTES) -e $(OMIT_TRAILING_EMPTY_LINES) \
86 # Generate the ChangeLog from git history.
87 gen_start_date = 2012-01-15 18:00:00 UTC
90 if test -d $(top_srcdir)/.git; then \
91 $(top_srcdir)/build-aux/gitlog-to-changelog \
92 --since='$(gen_start_date)' > $(distdir)/cl-t \
93 && rm -f $(distdir)/ChangeLog \
94 && mv $(distdir)/cl-t $(distdir)/ChangeLog; \
97 # Dummy rule, to pacify automake "gnu" strictness and allow a clean
98 # bootstrap. Creates a dummy ChangeLog (unless one is already present,
99 # as might be the case for users of vc-dwim) that will be overridden
100 # with a proper one at distribution time.
104 # Version string management. There are two files to be aware of:
105 # .tarball-version - present only in a distribution tarball, and not in
106 # a checked-out repository. Created with contents that were learned at
107 # the last time autoconf was run, and used by git-version-gen. Must not
108 # be present in either $(srcdir) or $(builddir) for git-version-gen to
109 # give accurate answers during normal development with a checked out tree,
110 # but must be present in a tarball when there is no version control system.
111 # Therefore, it cannot be used in any dependencies. GNUmakefile has
112 # hooks to force a reconfigure at distribution time to get the value
113 # correct, without penalizing normal development with extra reconfigures.
114 # .version - present in a checked-out repository and in a distribution
115 # tarball. At least as current as the most recent .tarball-version
116 # creation. Usable in dependencies, particularly for files that don't
117 # want to depend on config.h but do want to track version changes.
118 BUILT_SOURCES = $(top_srcdir)/.version
119 $(top_srcdir)/.version:
120 echo $(VERSION) > $@-t && mv $@-t $@
122 # Arrange so that .tarball-version appears only in distribution tarballs,
123 # never in a checked-out repository.
124 dist-hook: gen-ChangeLog
125 echo $(VERSION) > $(distdir)/.tarball-version
127 # Arrange to remove the symlink to GNUmakefile in VPATH builds.
128 # TODO remove this once automake vs. AC_CONFIG_LINKS issue is fixed.
129 # Delete ChangeLog if it is the dummy created by the rule above.
130 # The sed construct below distinguishes between a file whose sole
131 # contents are "dummy", and a file whose first line is "dummy" but then
132 # has other stuff, without reading the whole thing.
134 if test x"$(VPATH)" != x ; then rm -f GNUmakefile ; fi
135 if test "x`sed -ne 'l;2q' ChangeLog 2> /dev/null`" = 'xdummy$$'; \
136 then rm -f ChangeLog; fi
138 include $(srcdir)/bin/local.mk
139 include $(srcdir)/doc/local.mk
140 include $(srcdir)/lib/local.mk
141 include $(srcdir)/man/local.mk
142 include $(srcdir)/tests/local.mk
144 # Perl coverage statistics.
145 PERL_COVERAGE_DB = `pwd`/cover_db
146 PERL_COVERAGE_FLAGS = -MDevel::Cover=-db,$(PERL_COVERAGE_DB),-silent,on,-summary,off
149 check-coverage-run: all
150 $(MKDIR_P) $(PERL_COVERAGE_DB)
151 PERL5OPT="$(PERL_COVERAGE_FLAGS)"; export PERL5OPT; \
152 $(MAKE) $(AM_MAKEFLAGS) check
154 check-coverage-report:
155 @if test ! -d $(PERL_COVERAGE_DB); then \
156 echo "No coverage database found in '$(PERL_COVERAGE_DB)'." >&2; \
157 echo "Please run '$(MAKE) check-coverage' first" >&2; \
160 $(PERL_COVER) $(PERL_COVERAGE_DB) $(PERL_COVER_FLAGS)
162 # We don't use direct dependencies here because we'd like to be able
163 # to invoke the report even after interrupted check-coverage.
164 check-coverage: check-coverage-run
165 $(MAKE) $(AM_MAKEFLAGS) check-coverage-report
167 clean-local: clean-coverage
169 rm -rf $(PERL_COVERAGE_DB)
171 .PHONY: check-coverage check-coverage-run check-coverage-report clean-coverage