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