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 .prev-version .version
40 -e 's|@SHELL[@]|$(SHELL)|g' \
41 -e 's|@PERL[@]|$(PERL)|g' \
42 -e 's|@PERL_FLOCK[@]|$(PERL_FLOCK)|g' \
43 -e 's|@bindir[@]|$(bindir)|g' \
44 -e 's|@pkgdatadir[@]|$(pkgdatadir)|g' \
45 -e 's|@prefix[@]|$(prefix)|g' \
46 -e 's|@autoconf-name[@]|'`echo autoconf | sed '$(transform)'`'|g' \
47 -e 's|@autoheader-name[@]|'`echo autoheader | sed '$(transform)'`'|g' \
48 -e 's|@autom4te-name[@]|'`echo autom4te | sed '$(transform)'`'|g' \
49 -e 's|@M4[@]|$(M4)|g' \
50 -e 's|@M4_DEBUGFILE[@]|$(M4_DEBUGFILE)|g' \
51 -e 's|@M4_GNU[@]|$(M4_GNU)|g' \
52 -e 's|@AWK[@]|$(AWK)|g' \
53 -e 's|@RELEASE_YEAR[@]|$(RELEASE_YEAR)|g' \
54 -e 's|@VERSION[@]|$(VERSION)|g' \
55 -e 's|@PACKAGE_NAME[@]|$(PACKAGE_NAME)|g' \
56 -e 's|@configure_input[@]|Generated from $@.in; do not edit by hand.|g'
58 include $(srcdir)/lib/freeze.mk
64 custom_MAKEINFOFLAGS = --no-headers --no-validate --no-split
66 if MAKE_CASE_SENSITIVE
67 pkgdata_DATA = $(srcdir)/INSTALL
68 MAINTAINERCLEANFILES += $(srcdir)/INSTALL
70 # Don't leave blank line at end of file.
71 OMIT_TRAILING_EMPTY_LINES = '/^$$/H; /^$$/d; x; s/\n//p; s/\n*//; x'
72 # Prefer 'plain quotes' over `makeinfo quotes'.
73 CONVERT_QUOTES = "s/\`\([^']*\)'/'\1'/g"
75 $(srcdir)/INSTALL: $(top_srcdir)/doc/install.texi
76 echo @firstparagraphindent insert \
77 | cat - $(top_srcdir)/doc/install.texi > tmp.texi
78 $(MAKEINFO) $(custom_MAKEINFOFLAGS) $(MAKEINFOFLAGS) \
79 --plaintext tmp.texi \
80 | sed -e $(CONVERT_QUOTES) -e $(OMIT_TRAILING_EMPTY_LINES) \
85 # Generate the ChangeLog from git history.
86 gen_start_date = 2012-01-15 18:00:00 UTC
89 if test -d $(top_srcdir)/.git; then \
90 $(top_srcdir)/build-aux/gitlog-to-changelog \
91 --since='$(gen_start_date)' > $(distdir)/cl-t \
92 && rm -f $(distdir)/ChangeLog \
93 && mv $(distdir)/cl-t $(distdir)/ChangeLog; \
96 # Dummy rule, to pacify automake "gnu" strictness and allow a clean
97 # bootstrap. Creates a dummy ChangeLog (unless one is already present,
98 # as might be the case for users of vc-dwim) that will be overridden
99 # with a proper one at distribution time.
103 # Version string management. There are two files to be aware of:
104 # .tarball-version - present only in a distribution tarball, and not in
105 # a checked-out repository. Created with contents that were learned at
106 # the last time autoconf was run, and used by git-version-gen. Must not
107 # be present in either $(srcdir) or $(builddir) for git-version-gen to
108 # give accurate answers during normal development with a checked out tree,
109 # but must be present in a tarball when there is no version control system.
110 # Therefore, it cannot be used in any dependencies. GNUmakefile has
111 # hooks to force a reconfigure at distribution time to get the value
112 # correct, without penalizing normal development with extra reconfigures.
113 # .version - present in a checked-out repository and in a distribution
114 # tarball. At least as current as the most recent .tarball-version
115 # creation. Usable in dependencies, particularly for files that don't
116 # want to depend on config.h but do want to track version changes.
117 BUILT_SOURCES = $(top_srcdir)/.version
118 $(top_srcdir)/.version:
119 echo $(VERSION) > $@-t && mv $@-t $@
121 # Arrange so that .tarball-version appears only in distribution tarballs,
122 # never in a checked-out repository.
123 dist-hook: gen-ChangeLog
124 echo $(VERSION) > $(distdir)/.tarball-version
126 # Arrange to remove the symlink to GNUmakefile in VPATH builds.
127 # TODO remove this once automake vs. AC_CONFIG_LINKS issue is fixed.
129 if test x"$(VPATH)" != x ; then rm -f GNUmakefile ; fi
131 include $(srcdir)/bin/local.mk
132 include $(srcdir)/doc/local.mk
133 include $(srcdir)/lib/local.mk
134 include $(srcdir)/man/local.mk
135 include $(srcdir)/tests/local.mk
137 # Perl coverage statistics.
138 PERL_COVERAGE_DB = `pwd`/cover_db
139 PERL_COVERAGE_FLAGS = -MDevel::Cover=-db,$(PERL_COVERAGE_DB),-silent,on,-summary,off
142 check-coverage-run: all
143 $(MKDIR_P) $(PERL_COVERAGE_DB)
144 PERL5OPT="$(PERL_COVERAGE_FLAGS)"; export PERL5OPT; \
145 $(MAKE) $(AM_MAKEFLAGS) check
147 check-coverage-report:
148 @if test ! -d $(PERL_COVERAGE_DB); then \
149 echo "No coverage database found in '$(PERL_COVERAGE_DB)'." >&2; \
150 echo "Please run 'make check-coverage' first" >&2; \
153 $(PERL_COVER) $(PERL_COVERAGE_DB) $(PERL_COVER_FLAGS)
155 # We don't use direct dependencies here because we'd like to be able
156 # to invoke the report even after interrupted check-coverage.
157 check-coverage: check-coverage-run
158 $(MAKE) $(AM_MAKEFLAGS) check-coverage-report
160 clean-local: clean-coverage
162 rm -rf $(PERL_COVERAGE_DB)
164 .PHONY: check-coverage check-coverage-run check-coverage-report clean-coverage