1 ## Process this file with automake to create Makefile.in
3 ## Makefile for Automake.
5 # Copyright (C) 1995, 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004,
6 # 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Free Software
9 # This program is free software; you can redistribute it and/or modify
10 # it under the terms of the GNU General Public License as published by
11 # the Free Software Foundation; either version 2, or (at your option)
14 # This program is distributed in the hope that it will be useful,
15 # but WITHOUT ANY WARRANTY; without even the implied warranty of
16 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 # GNU General Public License for more details.
19 # You should have received a copy of the GNU General Public License
20 # along with this program. If not, see <http://www.gnu.org/licenses/>.
22 ## lib goes first, because it builds Config.pm, used by aclocal and
23 ## automake (run in doc, tests, and in the rebuild rules.)
24 ## `.' goes before doc and tests, because the latter two directories
25 ## run aclocal and automake.
26 SUBDIRS = lib . contrib doc m4 tests
28 bin_SCRIPTS = automake aclocal
30 CLEANFILES = $(bin_SCRIPTS)
31 AUTOMAKESOURCES = automake.in aclocal.in
33 TAGS_FILES = $(AUTOMAKESOURCES)
49 ## Make versioned links. We only run the transform on the root name;
50 ## then we make a versioned link with the transformed base name. This
51 ## seemed like the most reasonable approach.
54 @for p in $(bin_SCRIPTS); do \
55 f="`echo $$p|sed '$(transform)'`"; \
56 fv="$$f-$(APIVERSION)"; \
57 rm -f $(DESTDIR)$(bindir)/$$fv; \
58 echo " $(LN) $(DESTDIR)$(bindir)/$$f $(DESTDIR)$(bindir)/$$fv"; \
59 $(LN) $(DESTDIR)$(bindir)/$$f $(DESTDIR)$(bindir)/$$fv; \
63 @for p in $(bin_SCRIPTS); do \
64 f="`echo $$p|sed '$(transform)'`"; \
65 fv="$$f-$(APIVERSION)"; \
66 rm -f $(DESTDIR)$(bindir)/$$fv; \
70 ## We can't use configure to do the substitution here; we must do it
71 ## by hand. We use a funny notation here to avoid configure
72 ## substitutions in our text.
74 -e 's,[@]APIVERSION[@],$(APIVERSION),g' \
75 -e 's,[@]PACKAGE[@],$(PACKAGE),g' \
76 -e 's,[@]PACKAGE_BUGREPORT[@],$(PACKAGE_BUGREPORT),g' \
77 -e 's,[@]PACKAGE_URL[@],$(PACKAGE_URL),g' \
78 -e 's,[@]PATH_SEPARATOR[@],$(PATH_SEPARATOR),g' \
79 -e 's,[@]PERL[@],$(PERL),g' \
80 -e 's,[@]PERL_THREADS[@],$(PERL_THREADS),g' \
81 -e 's,[@]SHELL[@],$(SHELL),g' \
82 -e 's,[@]am_AUTOCONF[@],$(am_AUTOCONF),g' \
83 -e 's,[@]am_AUTOM4TE[@],$(am_AUTOM4TE),g' \
84 -e 's,[@]VERSION[@],$(VERSION),g' \
85 -e 's,[@]configure_input[@],Generated from $@.in; do not edit by hand.,g' \
86 -e 's,[@]datadir[@],$(datadir),g'
88 ## These files depend on Makefile so they are rebuilt if $(VERSION),
89 ## $(datadir) or other do_subst'ituted variables change.
90 ## Use chmod a-w to prevent people from editing the wrong file by accident.
93 automake aclocal: Makefile
94 $(AM_V_at)rm -f $@ $@-t
95 $(AM_V_GEN)$(do_subst) $(srcdir)/$@.in >$@-t
96 $(AM_V_at)chmod a+x,a-w $@-t && mv -f $@-t $@
98 ## The master location for INSTALL is lib/INSTALL.
99 ## This is where `make fetch' will install new versions.
100 ## Make sure we also update this copy.
102 $(AM_V_GEN)cp $(srcdir)/lib/INSTALL $@
104 # Run the testsuite with the installed aclocal and automake.
106 am_running_installcheck=yes $(MAKE) $(AM_MAKEFLAGS) check
108 # Convenience proxy target for the test suites.
110 $(am__cd) tests && $(MAKE) $(AM_MAKEFLAGS) $@
113 ################################################################
115 ## Everything past here is useful to the maintainer, but probably not
119 gitlog_to_changelog_command = $(PERL) $(srcdir)/lib/gitlog-to-changelog
120 gitlog_to_changelog_options = --since='2011-12-28 00:00:00' \
121 --no-cluster --format '%s%n%n%b'
123 # Automatic generation of the ChangeLog from git history.
125 # When executed from a git checkout, generate the ChangeLog from the git
126 # history. When executed from an extracted distribution tarball, just
127 # copy the distributed ChangeLog in the build directory (and if this
128 # fails, or if no distributed ChangeLog file is present, complain and
131 # We need the apparently useless dependency from another .PHONY target
132 # `am--changelog-regen-hook' to work around a bug of Solaris make, which
133 # doesn't execute the recipe of a target named as an existing file, even
134 # if such target is declared `.PHONY' (yikes!)
136 .PHONY: am--changelog-regen-hook
137 am--changelog-regen-hook:
138 ChangeLog: am--changelog-regen-hook
139 $(AM_V_GEN)set -e; set -u; \
140 ## The ChangeLog should be regenerated unconditionally when working from
141 ## checked-out sources; otherwise, if we're working from a distribution
142 ## tarball, we expect the ChangeLog to be distributed, so check that it
143 ## is indeed present in the source directory.
144 if test -d $(srcdir)/.git; then \
146 && $(gitlog_to_changelog_command) \
147 $(gitlog_to_changelog_options) >$@-t \
151 elif test ! -f $(srcdir)/$@; then \
152 echo "Source tree is not a git checkout, and no pre-existent" \
153 "$@ file has been found there" >&2; \
157 # Ensure tests are world-executable
159 $(am__cd) $(distdir)/tests && chmod a+rx *.test
162 # Perl coverage statistics.
163 PERL_COVERAGE_DB = $(abs_top_builddir)/cover_db
164 PERL_COVERAGE_FLAGS = -MDevel::Cover=-db,$(PERL_COVERAGE_DB),-silent,on,-summary,off
167 check-coverage-run recheck-coverage-run: all
168 $(mkinstalldirs) $(PERL_COVERAGE_DB)
169 PERL5OPT="$$PERL5OPT $(PERL_COVERAGE_FLAGS)"; export PERL5OPT; \
170 WANT_NO_THREADS=yes; export WANT_NO_THREADS; unset AUTOMAKE_JOBS; \
171 $(MAKE) $(AM_MAKEFLAGS) `echo $@ | sed 's/-coverage-run//'`
173 check-coverage-report:
174 @if test ! -d "$(PERL_COVERAGE_DB)"; then \
175 echo "No coverage database found in \`$(PERL_COVERAGE_DB)'." >&2; \
176 echo "Please run \`make check-coverage' first" >&2; \
179 $(PERL_COVER) $(PERL_COVER_FLAGS) "$(PERL_COVERAGE_DB)"
181 # We don't use direct dependencies here because we'd like to be able
182 # to invoke the report even after interrupted check-coverage.
183 check-coverage: check-coverage-run
184 $(MAKE) $(AM_MAKEFLAGS) check-coverage-report
186 recheck-coverage: recheck-coverage-run
187 $(MAKE) $(AM_MAKEFLAGS) check-coverage-report
190 rm -rf "$(PERL_COVERAGE_DB)"
191 clean-local: clean-coverage
193 .PHONY: check-coverage recheck-coverage check-coverage-run \
194 recheck-coverage-run check-coverage-report clean-coverage
196 # We also have to take into account VPATH builds (where some generated
197 # tests might be in `$(builddir)' rather than in `$(srcdir)'), TAP-based
198 # tests script (which have a `.tap' extension) and helper scripts used
199 # by other test cases (which have a `.sh' extension).
201 `if test $(srcdir) = .; then \
204 dirs='$(srcdir) .'; \
206 for d in $$dirs; do \
207 for s in test tap sh; do \
208 ls $$d/tests/*.$$s 2>/dev/null; \
212 # Some simple checks, and then ordinary check. These are only really
213 # guaranteed to work on my machine.
214 syntax_check_rules = \
216 sc_diff_automake_in_automake \
217 sc_diff_aclocal_in_automake \
219 sc_no_brace_variable_expansions \
221 sc_no_for_variable_in_macro \
223 sc_pre_normal_post_install_uninstall \
225 sc_perl_no_split_regex_space \
226 sc_cd_in_backquotes \
228 sc_perl_at_uscore_in_scalar_context \
229 sc_perl_local_no_parens \
231 sc_AMDEP_TRUE_in_automake_in \
232 sc_tests_make_without_am_makeflags \
233 sc_tests_obsolete_variables \
234 sc_tests_plain_make \
235 sc_tests_plain_autoconf \
236 sc_tests_plain_autoupdate \
237 sc_tests_plain_automake \
238 sc_tests_plain_autom4te \
239 sc_tests_plain_autoheader \
240 sc_tests_plain_autoreconf \
241 sc_tests_here_document_format \
242 sc_tests_Exit_not_exit \
243 sc_tests_automake_fails \
244 sc_tests_plain_aclocal \
245 sc_tests_plain_perl \
246 sc_tests_required_after_defs \
248 sc_tests_overriding_macros_on_cmdline \
249 sc_tests_plain_sleep \
250 sc_tests_plain_egrep_fgrep \
251 sc_tests_PATH_SEPARATOR \
252 sc_tests_logs_duplicate_prefixes \
253 sc_tests_makefile_variable_order \
256 sc_unquoted_DESTDIR \
260 $(syntax_check_rules): automake aclocal
261 maintainer-check: $(syntax_check_rules)
262 .PHONY: maintainer-check $(syntax_check_rules)
264 ## Check that the list of tests given in the Makefile is equal to the
265 ## list of all test scripts in the Automake testsuite.
266 .PHONY: maintainer-check-list-of-tests
267 maintainer-check-list-of-tests:
268 $(am__cd) tests && $(MAKE) $(AM_MAKEFLAGS) $@
269 maintainer-check: maintainer-check-list-of-tests
271 ## Look for test whose names can cause spurious failures when used as
272 ## first argument to AC_INIT (chiefly because they might contain an
273 ## m4/m4sugar builtin or macro name).
323 @m4_builtin_rx=`echo $(m4_builtins) | sed 's/ /|/g'`; \
324 m4_macro_rx="\\<($$m4_builtin_rx)\\>|\\<_?(A[CUMHS]|m4)_"; \
326 for t in $(xtests); do echo $$t; done \
327 | LC_ALL=C grep -E "$$m4_macro_rx"; \
329 echo "the names of the tests above can be problematic" 1>&2; \
330 echo "Avoid test names that contain names of m4 macros" 1>&2; \
334 ## These check avoids accidental configure substitutions in the source.
335 ## There are exactly 9 lines that should be modified from automake.in to
336 ## automake, and 10 lines that should be modified from aclocal.in to
337 ## aclocal; these wors out to 32 and 34 lines of diffs, respectively.
338 sc_diff_automake_in_automake:
339 @if test `diff $(srcdir)/automake.in automake | wc -l` -ne 32; then \
340 echo "found too many diffs between automake.in and automake" 1>&2; \
341 diff -c $(srcdir)/automake.in automake; \
344 sc_diff_aclocal_in_aclocal:
345 @if test `diff $(srcdir)/aclocal.in aclocal | wc -l` -ne 34; then \
346 echo "found too many diffs between aclocal.in and aclocal" 1>&2; \
347 diff -c $(srcdir)/aclocal.in aclocal; \
351 ## Syntax check with default Perl (on my machine, Perl 5).
353 @perllibdir="./lib$(PATH_SEPARATOR)$(srcdir)/lib" $(PERL) -c -w automake
354 @perllibdir="./lib$(PATH_SEPARATOR)$(srcdir)/lib" $(PERL) -c -w aclocal
356 ## expect no instances of '${...}'. However, $${...} is ok, since that
357 ## is a shell construct, not a Makefile construct.
358 sc_no_brace_variable_expansions:
359 @if grep -F '$${' $(srcdir)/lib/am/[a-z]*.am | \
360 grep -F -v '$$$$'; then \
361 echo "Found too many uses of '\$${' in the lines above." 1>&2; \
365 ## Make sure `rm' is called with `-f'.
367 @if grep -v '^#' $(srcdir)/lib/am/[a-z]*.am $(xtests) \
368 | grep -E '\<rm ([^-]|\-[^f ]*\>)'; \
370 echo "Suspicious 'rm' invocation." 1>&2; \
374 ## Never use something like `for file in $(FILES)', this doesn't work
375 ## if FILES is empty or if it contains shell meta characters (e.g. $ is
376 ## commonly used in Java filenames).
377 sc_no_for_variable_in_macro:
378 @if grep 'for .* in \$$(' $(srcdir)/lib/am/[a-z]*.am; then \
379 echo 'Use "list=$$(mumble); for var in $$$$list".' 1>&2 ; \
383 ## Make sure all invocations of mkinstalldirs are correct.
385 @if grep -n 'mkinstalldirs' $(srcdir)/lib/am/[a-z]*.am | \
386 grep -F -v '$$(mkinstalldirs)'; then \
387 echo "Found incorrect use of mkinstalldirs in the lines above" 1>&2; \
391 ## Make sure all calls to PRE/NORMAL/POST_INSTALL/UNINSTALL
392 sc_pre_normal_post_install_uninstall:
393 @if grep -E -n '\((PRE|NORMAL|POST)_(|UN)INSTALL\)' \
394 $(srcdir)/lib/am/[a-z]*.am | \
395 grep -v ':##' | grep -v ': @\$$('; then \
396 echo "Found incorrect use of PRE/NORMAL/POST_INSTALL/UNINSTALL in the lines above" 1>&2; \
400 ## We never want to use "undef", only "delete", but for $/.
402 @if grep -n -w 'undef ' $(srcdir)/automake.in | \
403 grep -F -v 'undef $$/'; then \
404 echo "Found undef in automake.in; use delete instead" 1>&2; \
408 ## We never want split (/ /,...), only split (' ', ...).
409 sc_perl_no_split_regex_space:
410 @if grep -n 'split (/ /' $(srcdir)/automake.in; then \
411 echo "Found bad split in the lines above." 1>&2; \
415 ## Look for cd within backquotes
417 @if grep -n '^[^#]*` *cd ' $(srcdir)/automake.in \
418 $(srcdir)/lib/am/*.am; then \
419 echo "Consider using \$$(am__cd) in the lines above." 1>&2; \
423 ## Look for cd to a relative directory (may be influenced by CDPATH).
424 ## Skip some known directories that are OK.
426 @if grep -n '^[^#]*cd ' $(srcdir)/automake.in \
427 $(srcdir)/lib/am/*.am | \
428 grep -v 'echo.*cd ' | \
429 grep -v 'am__cd =' | \
430 grep -v '^[^#]*cd [./]' | \
431 grep -v '^[^#]*cd \$$(top_builddir)' | \
432 grep -v '^[^#]*cd "\$$\$$am__cwd' | \
433 grep -v '^[^#]*cd \$$(abs' | \
434 grep -v '^[^#]*cd "\$$(DESTDIR)'; then \
435 echo "Consider using \$$(am__cd) in the lines above." 1>&2; \
439 ## Using @_ in a scalar context is most probably a programming error.
440 sc_perl_at_uscore_in_scalar_context:
441 @if grep -Hn '[^@_A-Za-z0-9][_A-Za-z0-9]*[^) ] *= *@_' $(srcdir)/automake.in; then \
442 echo "Using @_ in a scalar context in the lines above." 1>&2; \
446 ## Forbid using parens with `local' to ease counting.
447 sc_perl_local_no_parens:
448 @if grep '^[ \t]*local *(' $(srcdir)/automake.in; then \
449 echo "Don't use \`local' with parens: use several \`local' above." >&2; \
453 ## Allow only few variables to be localized in Automake.
455 @if egrep -v '^[ \t]*local \$$[_~]( *=|;)' $(srcdir)/automake.in | \
456 grep '^[ \t]*local [^*]'; then \
457 echo "Please avoid \`local'." 1>&2; \
461 ## Don't let AMDEP_TRUE substitution appear in automake.in.
462 sc_AMDEP_TRUE_in_automake_in:
463 @if grep '@AMDEP''_TRUE@' $(srcdir)/automake.in; then \
464 echo "Don't put AMDEP_TRUE substitution in automake.in" 1>&2; \
468 ## Recursive make invocations should always pass $(AM_MAKEFLAGS)
469 ## to $(MAKE), for portability to non-GNU make.
470 sc_tests_make_without_am_makeflags:
471 @if grep '^[^#].*(MAKE) ' $(srcdir)/lib/am/*.am $(srcdir)/automake.in |\
472 grep -v 'AM_MAKEFLAGS'; then \
473 echo 'Use $$(MAKE) $$(AM_MAKEFLAGS).' 1>&2; \
477 ## Look out for some obsolete variables.
478 sc_tests_obsolete_variables:
482 test_prefer_config_shell \
487 for v in $$vars; do \
488 if grep -E "\b$$v\b" \
489 $(xtests) $(srcdir)/tests/defs \
490 $(srcdir)/tests/defs-static.in \
495 if test -n "$$seen"; then \
496 for v in $$seen; do \
497 echo "Variable '$$v' is obsolete, use 'am_$$v' instead." 1>&2; \
502 ## Tests should never call make directly.
504 @if grep -v '^#' $(xtests) | $(EGREP) ':[ ]*make( |$$)'; then \
505 echo 'Do not run "make" in the above tests. Use "$$MAKE" instead.' 1>&2; \
509 ## Tests should never call autoconf directly.
510 sc_tests_plain_autoconf:
511 @if grep -v '^#' $(xtests) | grep ':[ ]*autoconf\>'; then \
512 echo 'Do not run "autoconf" in the above tests. Use "$$AUTOCONF" instead.' 1>&2; \
516 ## Tests should never call autoupdate directly.
517 sc_tests_plain_autoupdate:
518 @if grep -v '^#' $(xtests) | grep ':[ ]*autoupdate\>'; then \
519 echo 'Do not run "autoupdate" in the above tests. Use "$$AUTOUPDATE" instead.' 1>&2; \
523 ## Tests should never call automake directly.
524 sc_tests_plain_automake:
525 @if grep -v '^#' $(xtests) | grep -E ':[ ]*automake\>([^:]|$$)'; then \
526 echo 'Do not run "automake" in the above tests. Use "$$AUTOMAKE" instead.' 1>&2; \
530 ## Tests should never call autoheader directly.
531 sc_tests_plain_autoheader:
532 @if grep -v '^#' $(xtests) | grep ':[ ]*autoheader\>'; then \
533 echo 'Do not run "autoheader" in the above tests. Use "$$AUTOHEADER" instead.' 1>&2; \
537 ## Tests should never call autoreconf directly.
538 sc_tests_plain_autoreconf:
539 @if grep -v '^#' $(xtests) | grep ':[ ]*autoreconf\>'; then \
540 echo 'Do not run "autoreconf" in the above tests. Use "$$AUTORECONF" instead.' 1>&2; \
544 ## Tests should never call autom4te directly.
545 sc_tests_plain_autom4te:
546 @if grep -v '^#' $(xtests) | grep ':[ ]*autom4te\>'; then \
547 echo 'Do not run "autom4te" in the above tests. Use "$$AUTOM4TE" instead.' 1>&2; \
551 ## Tests should only use END and EOF for here documents
552 ## (so that the next test is effective).
553 sc_tests_here_document_format:
554 @if grep '<<' $(xtests) | grep -v 'END' | grep -v 'EOF'; then \
555 echo 'Use here documents with "END" and "EOF" only, for greppability.' 1>&2; \
559 ## Tests should never call exit directly, but use Exit.
560 ## This is so that the exit status is transported correctly across the 0 trap.
561 ## Ignore comments, testsuite self tests, and one perl line in ext2.test.
562 sc_tests_Exit_not_exit:
563 @found=false; for file in $(xtests); do \
564 case $$file in */self-check-*) continue;; esac; \
565 res=`sed -n -e '/^#/d; /^\$$PERL/d' -e '/<<.*END/,/^END/b' \
566 -e '/<<.*EOF/,/^EOF/b' -e '/exit [$$0-9]/p' $$file`; \
567 if test -n "$$res"; then \
568 echo "$$file:$$res"; \
573 echo 'Do not call plain "exit", use "Exit" instead, in above tests.' 1>&2; \
577 ## Use AUTOMAKE_fails when appropriate
578 sc_tests_automake_fails:
579 @if grep -v '^#' $(xtests) | grep '\$$AUTOMAKE.*&&.*[eE]xit'; then \
580 echo 'Use AUTOMAKE_fails + grep to catch automake failures in the above tests.' 1>&2; \
584 ## Tests should never call aclocal directly.
585 sc_tests_plain_aclocal:
586 @if grep -v '^#' $(xtests) | grep ':[ ]*aclocal\>'; then \
587 echo 'Do not run "aclocal" in the above tests. Use "$$ACLOCAL" instead.' 1>&2; \
591 ## Tests should never call perl directly.
593 @if grep -v '^#' $(xtests) | grep ':[ ]*perl\>'; then \
594 echo 'Do not run "perl" in the above tests. Use "$$PERL" instead.' 1>&2; \
598 ## Setting `required' after sourcing `./defs' is a bug.
599 sc_tests_required_after_defs:
600 @for file in $(xtests); do \
601 if out=`sed -n '/defs/,$${/required=/p;}' $$file`; test -n "$$out"; then \
602 echo 'Do not set "required" after sourcing "defs" in '"$$file: $$out" 1>&2; \
607 ## TAP-based test scripts should not forget to declare a TAP plan. In
608 ## case it is not known in advance how many tests will be run, a "lazy"
609 ## plan can be used; but its use should be deliberate, explicitly declared
610 ## with a "plan_ later" call, rather than the result of an oversight.
611 ## This check helps to ensure this is indeed the case.
613 @with_plan=`grep -l '^ *plan_ ' $(srcdir)/tests/*.tap`; \
614 with_plan=`echo $$with_plan`; \
616 for t in $(srcdir)/tests/*.tap; do \
617 case " $$with_plan " in *" $$t "*) continue;; esac; \
618 ## It's ok for an *auto-generated* test sourcing an hand-written one not
619 ## to declare a TAP plan: that will be done by the sourced test.
622 t2=`echo $$t | sed -e 's|.*/||' -e 's/-w\.tap$$/.tap/'` \
623 && grep -E "^ *\\. *[^ ]*/$$t2\\b" $$t >/dev/null \
624 && continue || : ;; \
626 ok=false; echo $$t; \
629 echo 'The tests above do not declare a TAP plan.' 1>&2; \
633 ## Overriding a Makefile macro on the command line is not portable when
634 ## recursive targets are used. Better use an envvar. SHELL is an
635 ## exception, POSIX says it can't come from the environment. V, DESTDIR,
636 ## DISTCHECK_CONFIGURE_FLAGS and DISABLE_HARD_ERRORS are exceptions, too,
637 ## as package authors are urged not to initialize them anywhere.
638 sc_tests_overriding_macros_on_cmdline:
639 @if grep -E '\$$MAKE .*(SHELL=.*=|=.*SHELL=)' $(xtests); then \
640 echo 'Rewrite "$$MAKE foo=bar SHELL=$$SHELL" as "foo=bar $$MAKE -e SHELL=$$SHELL"' 1>&2; \
641 echo ' in the above lines, it is more portable.' 1>&2; \
644 ## Also try to account for usages like "$MAKE || st=$?".
645 @if sed -e 's/ || .*//' -e 's/ && .*//' \
646 -e 's/ DESTDIR=[^ ]*/ /' -e 's/ SHELL=[^ ]*/ /' \
647 -e 's/ V=[^ ]*/ /' -e 's/ DISABLE_HARD_ERRORS=[^ ]*/ /' \
648 ## DISTCHECK_CONFIGURE_FLAGS is allowed to contain whitespace in its
649 ## definition, so the more complex substitutions below.
650 -e "s/ DISTCHECK_CONFIGURE_FLAGS='[^']*'/ /" \
651 -e 's/ DISTCHECK_CONFIGURE_FLAGS="[^"]*"/ /' \
652 -e 's/ DISTCHECK_CONFIGURE_FLAGS=[^ ]/ /' \
653 $(xtests) | grep '\$$MAKE .*='; then \
654 echo 'Rewrite "$$MAKE foo=bar" as "foo=bar $$MAKE -e" in the above lines,' 1>&2; \
655 echo 'it is more portable.' 1>&2; \
658 @if grep 'SHELL=.*\$$MAKE' $(xtests); then \
659 echo '$$MAKE ignores the SHELL envvar, use "$$MAKE SHELL=$$SHELL" in' 1>&2; \
660 echo 'the above lines.' 1>&2; \
664 ## Never use `sleep 1' to create files with different timestamps.
665 ## Use `$sleep' instead. Some filesystems (e.g., Windows') have only
666 ## a 2sec resolution.
667 sc_tests_plain_sleep:
668 @if grep -E '\bsleep +[12345]\b' $(xtests); then \
669 echo 'Do not use "sleep x" in the above tests. Use "$$sleep" instead.' 1>&2; \
673 ## fgrep and egrep are not required by POSIX.
674 sc_tests_plain_egrep_fgrep:
675 @if grep -E '\b[ef]grep\b' $(xtests) ; then \
676 echo 'Do not use egrep or fgrep in test cases. Use $$FGREP or $$EGREP.' 1>&2; \
679 @if grep -E '\b[ef]grep\b' $(srcdir)/lib/am/*.am $(srcdir)/m4/*.m4; then \
680 echo 'Do not use egrep or fgrep in the above files, they are not portable.' 1>&2; \
684 ## Rule to ensure that the testsuite has been run before. We don't depend on `check'
685 ## here, because that would be very wasteful in the common case. We could run
686 ## `make check RECHECK_LOGS=' and avoid toplevel races with AM_RECURSIVE_TARGETS.
687 ## Suggest keeping test directories around for greppability of the Makefile.in files.
688 sc_ensure_testsuite_has_run:
689 @if test ! -f tests/test-suite.log; then \
690 echo "Run \`env keep_testdirs=yes make check' before \`maintainer-check'" >&2; \
693 .PHONY: sc_ensure_testsuite_has_run
695 ## Ensure our warning and error messages do not contain duplicate 'warning:' prefixes.
696 ## This test actually depends on the testsuite having been run before.
697 sc_tests_logs_duplicate_prefixes: sc_ensure_testsuite_has_run
698 @if grep -E '(warning|error):.*(warning|error):' tests/*.log; then \
699 echo 'Duplicate warning/error message prefixes seen in above tests.' >&2; \
703 ## Ensure variables are listed before rules in Makefile.in files we generate.
704 sc_tests_makefile_variable_order: sc_ensure_testsuite_has_run
705 @for file in `find tests -name Makefile.in -print`; do \
708 -e '/\\\\$$/{' -e N -e 'b x' -e '}' \
711 ## Allow @ so we match conditionals.
712 -e '/^ *[a-zA-Z_@]\{1,\} *=/p' $$file`; \
713 if test -n "$$latevars"; then \
714 echo 'Ensure variables are expanded before rules' >&2; \
715 echo "Variables are expanded too late in $$file:" >&2; \
716 echo "$$latevars" | sed 's/^/ /' >&2; \
721 ## Using `:' as a PATH separator is not portable.
722 sc_tests_PATH_SEPARATOR:
723 @if grep -E '\bPATH=.*:.*' $(xtests) ; then \
724 echo "Use \`\$$PATH_SEPARATOR', not \`:', in PATH definitions above." 1>&2; \
730 $(srcdir)/automake.in \
731 $(srcdir)/lib/am/*.am \
734 echo 'Do not use mkdir_p in the above files, use MKDIR_P.' 1>&2; \
738 ## Try to make sure all @...@ substitutions are covered by our
739 ## substitution rule.
741 @if test `grep -E '^[^#]*@[A-Za-z_0-9]+@' aclocal | wc -l` -ne 0; then \
742 echo "Unresolved @...@ substitution in aclocal" 1>&2; \
745 @if test `grep -E '^[^#]*@[A-Za-z_0-9]+@' automake | wc -l` -ne 0; then \
746 echo "Unresolved @...@ substitution in automake" 1>&2; \
751 @if grep -E "[^\'\"]\\\$$\(DESTDIR" $(srcdir)/lib/am/*.am; then \
752 echo 'Suspicious unquoted DESTDIR uses.' 1>&2 ; \
757 @if grep ' ' $(srcdir)/doc/automake.texi; then \
758 echo 'Do not use tabs in the manual.' 1>&2; \
763 @if grep -E '([^@]|^)@([ ][^@]|$$)' $(srcdir)/doc/automake.texi; \
765 echo 'Unescaped @.' 1>&2; \
770 git-dist: maintainer-check
771 ## Make sure the NEWS file is up-to-date.
772 @if sed 1q $(srcdir)/NEWS | grep -e "$(VERSION)" > /dev/null; then :; else \
773 echo "NEWS not updated; not releasing" 1>&2; \
776 ## Build the distribution. We expect the developer to have already run
777 ## "make check" and "make distcheck" on his own (as required in the
778 ## HACKING file, section "Release procedure").
779 $(MAKE) $(AM_MAKEFLAGS) dist
780 ## Finally, if anything was successful, commit the last changes and tag
781 ## the release in the repository. We don't use RCS keywords so it's OK
782 ## to distribute the files before they were committed.
783 $(am__cd) $(srcdir) && git commit -a -s && \
784 git tag -s "v$(VERSION)" -m "Release $(VERSION)"
786 git-release: git-dist
788 *[a-z]) dest=alpha;; \
791 $(srcdir)/lib/gnupload $(GNUPLOADFLAGS) \
792 --to $$dest.gnu.org:automake $(DIST_ARCHIVES)
794 ## Visually comparing differences between the Makefile.in files in
795 ## automake's own build system as generated in two different branches
796 ## might help to catch bugs and blunders. This has already happened a
797 ## few times in the past, when we used to version-control Makefile.in.
800 NEW_COMMIT=$${NEW_COMMIT-"HEAD"}; \
801 OLD_COMMIT=$${OLD_COMMIT-"HEAD~1"}; \
802 am_gitdir='$(abs_top_srcdir)/.git'; \
803 get_autofiles_from_rev () \
806 && echo "$@: will get files from revision $$rev" \
807 && git clone -q --depth 1 "$$am_gitdir" tmp \
809 && git checkout -q "$$rev" \
810 && echo "$@: bootstrapping $$rev" \
811 && $(SHELL) ./bootstrap \
812 && echo "$@: copying files from $$rev" \
813 && makefile_ins=`find . -name Makefile.in` \
814 && (tar cf - configure aclocal.m4 $$makefile_ins) | \
815 (cd .. && cd "$$dir" && tar xf -) \
820 ## Before proceeding, ensure the specified revisions truly exist.
821 && git --git-dir="$$am_gitdir" describe $$OLD_COMMIT >/dev/null \
822 && git --git-dir="$$am_gitdir" describe $$NEW_COMMIT >/dev/null \
827 && get_autofiles_from_rev $$OLD_COMMIT old \
828 && get_autofiles_from_rev $$NEW_COMMIT new \
830 ## With lots of eye candy; we like our developers pampered and spoiled :-)
831 compare-autodiffs: autodiffs
833 : $${COLORDIFF=colordiff} $${DIFF=diff}; \
835 if test ! -d "$$dir"; then \
836 echo "$@: $$dir: Not a directory" >&2; \
839 mydiff=false mypager=false; \
841 if ($$COLORDIFF -r . .) </dev/null >/dev/null 2>&1; then \
842 mydiff=$$COLORDIFF; \
850 if test "$$mydiff" = false; then \
851 if ($$DIFF -r -u . .); then \
854 echo "$@: no good-enough diff program specified" >&2; \
858 st=0; $$mydiff -r -u $$dir/old $$dir/new | $$mypager || st=$$?; \
861 .PHONY: autodiffs compare-autodiffs
863 ## Program to use to fetch files.
865 WGET_SV_CVS = $(WGET) http://savannah.gnu.org/cgi-bin/viewcvs/~checkout~/
866 WGET_SV_GIT_CF = $(WGET) 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;hb=HEAD;f='
867 WGET_SV_GIT_AC = $(WGET) 'http://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=blob_plain;hb=HEAD;f='
868 WGET_SV_GIT_GL = $(WGET) 'http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob_plain;hb=HEAD;f='
870 ## Files that we fetch and which we compare against.
871 ## FIXME should be a lot more here
877 gitlog-to-changelog \
880 ## Fetch the latest versions of files we care about.
882 rm -rf Fetchdir > /dev/null 2>&1
884 ## If a get fails then that is a problem.
885 ($(am__cd) Fetchdir && \
886 $(WGET_SV_GIT_CF)config.guess -O config.guess && \
887 $(WGET_SV_GIT_CF)config.sub -O config.sub && \
888 $(WGET_SV_CVS)texinfo/texinfo/doc/texinfo.tex -O texinfo.tex && \
889 $(WGET_SV_GIT_GL)doc/INSTALL -O INSTALL && \
890 $(WGET_SV_GIT_GL)build-aux/gnupload -O gnupload && \
891 $(WGET_SV_GIT_GL)build-aux/gitlog-to-changelog -O gitlog-to-changelog)
892 ## Don't exit after test because we want to give as many errors as
894 @stat=0; for file in $(FETCHFILES); do \
895 if diff -u $(srcdir)/lib/$$file Fetchdir/$$file \
896 >>Fetchdir/update.patch 2>/dev/null; then :; \
899 echo "Updating $(srcdir)/lib/$$file ..."; \
900 cp Fetchdir/$$file $(srcdir)/lib/$$file; \
904 echo "See Fetchdir/update.patch for a log of the changes."; \
908 ## Generate release statistics, for the table in automake.texi.
909 ## This has to be run in an up to date build tree, but there must
910 ## be no temp files nor unused other files lying around!
913 am=`wc -l < automake` && \
914 acl=`wc -l < aclocal` && \
915 pmfiles="lib/Automake/*.pm" && \
916 if test . != '$(srcdir)'; then pmfiles="$$pmfiles $(srcdir)/lib/Automake/*.pm"; \
918 pm=`cat $$pmfiles | wc -l` && \
919 dot_am_files=`ls -1 $(srcdir)/lib/am/*.am | grep -v Makefile.am` && \
920 amf=`echo "$$dot_am_files" | wc -l` && \
921 aml=`cat $$dot_am_files | wc -l` && \
922 m4f=`ls -1 $(srcdir)/m4/*.m4 | wc -l` && \
923 m4l=`cat $(srcdir)/m4/*.m4 | wc -l` && \
924 doc_text=`$(am__cd) doc && LC_ALL=C pstops 0 automake.ps unused.ps 2>&1` && \
925 echo "$$doc_text" && \
926 rm -f doc/unused.ps && \
927 doc=`echo "$$doc_text" | sed -n 's/.*Wrote \([1-9][0-9]*\) pages.*/\1/p'` && \
928 tests="tests/*.test"; \
929 if test . != '$(srcdir)'; then tests="$$tests $(srcdir)/tests/*.test"; \
931 t=`ls -1 $$tests | wc -l` && \
932 tgen=`grep 'GENERATED AUTOMATICALLY' $$tests | wc -l` && \
933 today=`date +%Y-%m-%d` && \
934 echo "add this to the table in doc/automake.texi after verification:" && \
935 printf '@item %s @tab %-6s @tab %4d @tab %4d @tab %4d @tab %4d %-4s @tab %4d %-4s @tab %3d @tab %d %-4s\n' \
936 $$today $(VERSION) $$am $$acl $$pm $$aml "($$amf)" $$m4l "($$m4f)" $$doc $$t "($$tgen)"
937 .PHONY: release-stats