3 # Copyright (C) 1999-2004, 2006-2017, 2020-2024 Free Software
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'
74 $(srcdir)/INSTALL: $(top_srcdir)/doc/install.texi
75 echo @firstparagraphindent insert \
76 | cat - $(top_srcdir)/doc/install.texi > tmp.texi
77 $(MAKEINFO) $(custom_MAKEINFOFLAGS) \
78 $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) \
79 --plaintext tmp.texi \
80 | sed -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 (cd $(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 printf '%s\n' '$(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 printf '%s\n' '$(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.
128 # Delete ChangeLog if it is the dummy created by the rule above.
129 # The sed construct below distinguishes between a file whose sole
130 # contents are "dummy", and a file whose first line is "dummy" but then
131 # has other stuff, without reading the whole thing.
133 if test x"$(VPATH)" != x ; then rm -f GNUmakefile ; fi
134 if test "x`sed -ne 'l;2q' ChangeLog 2> /dev/null`" = 'xdummy$$'; \
135 then rm -f ChangeLog; fi
137 include $(srcdir)/bin/local.mk
138 include $(srcdir)/doc/local.mk
139 include $(srcdir)/lib/local.mk
140 include $(srcdir)/man/local.mk
141 include $(srcdir)/tests/local.mk
143 # Perl coverage statistics.
144 PERL_COVERAGE_DB = `pwd`/cover_db
145 PERL_COVERAGE_FLAGS = -MDevel::Cover=-db,$(PERL_COVERAGE_DB),-silent,on,-summary,off
148 check-coverage-run: all
149 $(MKDIR_P) $(PERL_COVERAGE_DB)
150 PERL5OPT="$(PERL_COVERAGE_FLAGS)"; export PERL5OPT; \
151 $(MAKE) $(AM_MAKEFLAGS) check
153 check-coverage-report:
154 @if test ! -d $(PERL_COVERAGE_DB); then \
155 printf '%s\n' "No coverage database in '$(PERL_COVERAGE_DB)'." >&2; \
156 printf '%s\n' "Please run '$(MAKE) check-coverage' first" >&2; \
159 $(PERL_COVER) $(PERL_COVERAGE_DB) $(PERL_COVER_FLAGS)
161 # We don't use direct dependencies here because we'd like to be able
162 # to invoke the report even after interrupted check-coverage.
163 check-coverage: check-coverage-run
164 $(MAKE) $(AM_MAKEFLAGS) check-coverage-report
166 clean-local: clean-coverage
168 rm -rf $(PERL_COVERAGE_DB)
170 .PHONY: check-coverage check-coverage-run check-coverage-report clean-coverage