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 Free Software Foundation,
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 . doc m4 tests
28 TEST_SUBDIRS = lib/Automake/tests tests
30 bin_SCRIPTS = automake aclocal
32 CLEANFILES = $(bin_SCRIPTS)
33 AUTOMAKESOURCES = automake.in aclocal.in
35 TAGS_FILES = $(AUTOMAKESOURCES)
51 ## Make versioned links. We only run the transform on the root name;
52 ## then we make a versioned link with the transformed base name. This
53 ## seemed like the most reasonable approach.
56 @for p in $(bin_SCRIPTS); do \
57 f="`echo $$p|sed '$(transform)'`"; \
58 fv="$$f-$(APIVERSION)"; \
59 rm -f $(DESTDIR)$(bindir)/$$fv; \
60 echo " $(LN) $(DESTDIR)$(bindir)/$$f $(DESTDIR)$(bindir)/$$fv"; \
61 $(LN) $(DESTDIR)$(bindir)/$$f $(DESTDIR)$(bindir)/$$fv; \
65 @for p in $(bin_SCRIPTS); do \
66 f="`echo $$p|sed '$(transform)'`"; \
67 fv="$$f-$(APIVERSION)"; \
68 rm -f $(DESTDIR)$(bindir)/$$fv; \
72 ## We can't use configure to do the substitution here; we must do it
73 ## by hand. We use a funny notation here to avoid configure
74 ## substitutions in our text.
76 -e 's,[@]APIVERSION[@],$(APIVERSION),g' \
77 -e 's,[@]PACKAGE[@],$(PACKAGE),g' \
78 -e 's,[@]PACKAGE_BUGREPORT[@],$(PACKAGE_BUGREPORT),g' \
79 -e 's,[@]PACKAGE_URL[@],$(PACKAGE_URL),g' \
80 -e 's,[@]PATH_SEPARATOR[@],$(PATH_SEPARATOR),g' \
81 -e 's,[@]PERL[@],$(PERL),g' \
82 -e 's,[@]PERL_THREADS[@],$(PERL_THREADS),g' \
83 -e 's,[@]SHELL[@],$(SHELL),g' \
84 -e 's,[@]am_AUTOCONF[@],$(am_AUTOCONF),g' \
85 -e 's,[@]am_AUTOM4TE[@],$(am_AUTOM4TE),g' \
86 -e 's,[@]VERSION[@],$(VERSION),g' \
87 -e 's,[@]configure_input[@],Generated from $@.in; do not edit by hand.,g' \
88 -e 's,[@]datadir[@],$(datadir),g'
90 ## These files depend on Makefile so they are rebuilt if $(VERSION),
91 ## $(datadir) or other do_subst'ituted variables change.
92 ## Use chmod a-w to prevent people from editing the wrong file by accident.
95 automake aclocal: Makefile
96 $(AM_V_GEN)rm -f $@ $@.tmp
97 $(AM_V_at)$(do_subst) $(srcdir)/$@.in >$@.tmp
98 $(AM_V_at)chmod +x $@.tmp
99 $(AM_V_at)chmod a-w $@.tmp
100 $(AM_V_at)mv -f $@.tmp $@
102 ## The master location for INSTALL is lib/INSTALL.
103 ## This is where `make fetch' will install new versions.
104 ## Make sure we also update this copy.
106 $(AM_V_GEN)cp $(srcdir)/lib/INSTALL $@
108 # Run the testsuite with the installed aclocal and automake.
110 am_running_installcheck=yes $(MAKE) $(AM_MAKEFLAGS) check
112 ## recheck: convenience proxy target for the test suites.
116 for f in x $$MAKEFLAGS; do \
119 *k*) failcom='fail=yes';; \
122 for subdir in $(TEST_SUBDIRS); do \
123 ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@) \
128 ################################################################
130 ## Everything past here is useful to the maintainer, but probably not
134 gitlog_to_changelog_command = $(PERL) $(srcdir)/lib/gitlog-to-changelog
135 gitlog_to_changelog_options = --since='2011-12-28 00:00:00'
137 # Automatic generation of the ChangeLog from git history.
139 # When executed from a git checkout, generate the ChangeLog from the git
140 # history. When executed from an extracted distribution tarball, just
141 # copy the distributed ChangeLog in the build directory (and if this
142 # fails, or if no distributed ChangeLog file is present, complain and
145 # We need the apparently useless dependency from another .PHONY target
146 # `am--changelog-regen-hook' to work around a bug of Solaris make, which
147 # doesn't execute the recipe of a target named as an existing file, even
148 # if such target is declared `.PHONY' (yikes!)
150 .PHONY: am--changelog-regen-hook
151 am--changelog-regen-hook:
152 ChangeLog: am--changelog-regen-hook
153 $(AM_V_GEN)set -e; set -u; \
154 ## The ChangeLog should be regenerated unconditionally when working from
155 ## checked-out sources; otherwise, if we're working from a distribution
156 ## tarball, we expect the ChangeLog to be distributed, so check that it
157 ## is indeed present in the source directory.
158 if test -d $(srcdir)/.git; then \
160 && $(gitlog_to_changelog_command) \
161 $(gitlog_to_changelog_options) >$@-t \
165 elif test ! -f $(srcdir)/$@; then \
166 echo "Source tree is not a git checkout, and no pre-existent" \
167 "$@ file has been found there" >&2; \
171 # Ensure tests are world-executable
173 $(am__cd) $(distdir)/tests && chmod a+rx *.test
176 # Perl coverage statistics.
177 PERL_COVERAGE_DB = $(abs_top_builddir)/cover_db
178 PERL_COVERAGE_FLAGS = -MDevel::Cover=-db,$(PERL_COVERAGE_DB),-silent,on,-summary,off
181 check-coverage-run recheck-coverage-run: all
182 $(mkinstalldirs) $(PERL_COVERAGE_DB)
183 PERL5OPT="$$PERL5OPT $(PERL_COVERAGE_FLAGS)"; export PERL5OPT; \
184 WANT_NO_THREADS=yes; export WANT_NO_THREADS; unset AUTOMAKE_JOBS; \
185 $(MAKE) $(AM_MAKEFLAGS) `echo $@ | sed 's/-coverage-run//'`
187 check-coverage-report:
188 @if test ! -d "$(PERL_COVERAGE_DB)"; then \
189 echo "No coverage database found in \`$(PERL_COVERAGE_DB)'." >&2; \
190 echo "Please run \`make check-coverage' first" >&2; \
193 $(PERL_COVER) $(PERL_COVER_FLAGS) "$(PERL_COVERAGE_DB)"
195 # We don't use direct dependencies here because we'd like to be able
196 # to invoke the report even after interrupted check-coverage.
197 check-coverage: check-coverage-run
198 $(MAKE) $(AM_MAKEFLAGS) check-coverage-report
200 recheck-coverage: recheck-coverage-run
201 $(MAKE) $(AM_MAKEFLAGS) check-coverage-report
204 rm -rf "$(PERL_COVERAGE_DB)"
205 clean-local: clean-coverage
207 .PHONY: check-coverage recheck-coverage check-coverage-run \
208 recheck-coverage-run check-coverage-report clean-coverage
210 # We also have to take into account VPATH builds (where some generated
211 # tests might be in `$(builddir)' rather than in `$(srcdir)'), TAP-based
212 # tests script (which have a `.tap' extension) and helper scripts used
213 # by other test cases (which have a `.sh' extension).
215 `if test $(srcdir) = .; then \
218 dirs='$(srcdir) .'; \
220 for d in $$dirs; do \
221 for s in test tap sh; do \
222 ls $$d/tests/*.$$s 2>/dev/null; \
226 # Some simple checks, and then ordinary check. These are only really
227 # guaranteed to work on my machine.
228 syntax_check_rules = \
230 sc_diff_automake_in_automake \
231 sc_diff_aclocal_in_automake \
233 sc_no_brace_variable_expansions \
235 sc_no_for_variable_in_macro \
237 sc_pre_normal_post_install_uninstall \
239 sc_perl_no_split_regex_space \
240 sc_cd_in_backquotes \
242 sc_perl_at_uscore_in_scalar_context \
243 sc_perl_local_no_parens \
245 sc_AMDEP_TRUE_in_automake_in \
246 sc_tests_make_without_am_makeflags \
247 sc_tests_obsolete_variables \
248 sc_tests_plain_make \
249 sc_tests_plain_autoconf \
250 sc_tests_plain_autoupdate \
251 sc_tests_plain_automake \
252 sc_tests_plain_autom4te \
253 sc_tests_plain_autoheader \
254 sc_tests_plain_autoreconf \
255 sc_tests_here_document_format \
256 sc_tests_Exit_not_exit \
257 sc_tests_automake_fails \
258 sc_tests_plain_aclocal \
259 sc_tests_plain_perl \
260 sc_tests_required_after_defs \
262 sc_tests_overriding_macros_on_cmdline \
263 sc_tests_plain_sleep \
264 sc_tests_plain_egrep_fgrep \
265 sc_tests_PATH_SEPARATOR \
266 sc_tests_logs_duplicate_prefixes \
267 sc_tests_makefile_variable_order \
270 sc_unquoted_DESTDIR \
274 .PHONY: $(syntax_check_rules)
275 $(syntax_check_rules): automake aclocal
277 ## Check that the list of tests given in the Makefile is equal to the
278 ## list of all test scripts in the Automake testsuite.
279 .PHONY: maintainer-check-list-of-tests
280 maintainer-check-list-of-tests:
282 for f in x $$MAKEFLAGS; do \
285 *k*) failcom='fail=yes';; \
288 for subdir in $(TEST_SUBDIRS); do \
289 (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@) || eval $$failcom; \
293 maintainer-check: $(syntax_check_rules) maintainer-check-list-of-tests
295 ## Look for test whose names can cause spurious failures when used as
296 ## first argument to AC_INIT (chiefly because they might contain an
297 ## m4/m4sugar builtin or macro name).
347 @m4_builtin_rx=`echo $(m4_builtins) | sed 's/ /|/g'`; \
348 m4_macro_rx="\\<($$m4_builtin_rx)\\>|\\<_?(A[CUMHS]|m4)_"; \
350 for t in $(xtests); do echo $$t; done \
351 | LC_ALL=C grep -E "$$m4_macro_rx"; \
353 echo "the names of the tests above can be problematic" 1>&2; \
354 echo "Avoid test names that contain names of m4 macros" 1>&2; \
358 ## These check avoids accidental configure substitutions in the source.
359 ## There are exactly 9 lines that should be modified from automake.in to
360 ## automake, and 10 lines that should be modified from aclocal.in to
361 ## aclocal; these wors out to 32 and 34 lines of diffs, respectively.
362 sc_diff_automake_in_automake:
363 @if test `diff $(srcdir)/automake.in automake | wc -l` -ne 32; then \
364 echo "found too many diffs between automake.in and automake" 1>&2; \
365 diff -c $(srcdir)/automake.in automake; \
368 sc_diff_aclocal_in_aclocal:
369 @if test `diff $(srcdir)/aclocal.in aclocal | wc -l` -ne 34; then \
370 echo "found too many diffs between aclocal.in and aclocal" 1>&2; \
371 diff -c $(srcdir)/aclocal.in aclocal; \
375 ## Syntax check with default Perl (on my machine, Perl 5).
377 perllibdir="./lib$(PATH_SEPARATOR)$(srcdir)/lib" $(PERL) -c -w automake
378 perllibdir="./lib$(PATH_SEPARATOR)$(srcdir)/lib" $(PERL) -c -w aclocal
380 ## expect no instances of '${...}'. However, $${...} is ok, since that
381 ## is a shell construct, not a Makefile construct.
382 sc_no_brace_variable_expansions:
383 @if grep -F '$${' $(srcdir)/lib/am/[a-z]*.am | \
384 grep -F -v '$$$$'; then \
385 echo "Found too many uses of '\$${' in the lines above." 1>&2; \
389 ## Make sure `rm' is called with `-f'.
391 @if grep -v '^#' $(srcdir)/lib/am/[a-z]*.am $(xtests) \
392 | grep -E '\<rm ([^-]|\-[^f ]*\>)'; \
394 echo "Suspicious 'rm' invocation." 1>&2; \
398 ## Never use something like `for file in $(FILES)', this doesn't work
399 ## if FILES is empty or if it contains shell meta characters (e.g. $ is
400 ## commonly used in Java filenames).
401 sc_no_for_variable_in_macro:
402 @if grep 'for .* in \$$(' $(srcdir)/lib/am/[a-z]*.am; then \
403 echo 'Use "list=$$(mumble); for var in $$$$list".' 1>&2 ; \
407 ## Make sure all invocations of mkinstalldirs are correct.
409 @if grep -n 'mkinstalldirs' $(srcdir)/lib/am/[a-z]*.am | \
410 grep -F -v '$$(mkinstalldirs)'; then \
411 echo "Found incorrect use of mkinstalldirs in the lines above" 1>&2; \
415 ## Make sure all calls to PRE/NORMAL/POST_INSTALL/UNINSTALL
416 sc_pre_normal_post_install_uninstall:
417 @if grep -E -n '\((PRE|NORMAL|POST)_(|UN)INSTALL\)' \
418 $(srcdir)/lib/am/[a-z]*.am | \
419 grep -v ':##' | grep -v ': @\$$('; then \
420 echo "Found incorrect use of PRE/NORMAL/POST_INSTALL/UNINSTALL in the lines above" 1>&2; \
424 ## We never want to use "undef", only "delete", but for $/.
426 @if grep -n -w 'undef ' $(srcdir)/automake.in | \
427 grep -F -v 'undef $$/'; then \
428 echo "Found undef in automake.in; use delete instead" 1>&2; \
432 ## We never want split (/ /,...), only split (' ', ...).
433 sc_perl_no_split_regex_space:
434 @if grep -n 'split (/ /' $(srcdir)/automake.in; then \
435 echo "Found bad split in the lines above." 1>&2; \
439 ## Look for cd within backquotes
441 @if grep -n '^[^#]*` *cd ' $(srcdir)/automake.in \
442 $(srcdir)/lib/am/*.am; then \
443 echo "Consider using \$$(am__cd) in the lines above." 1>&2; \
447 ## Look for cd to a relative directory (may be influenced by CDPATH).
448 ## Skip some known directories that are OK.
450 @if grep -n '^[^#]*cd ' $(srcdir)/automake.in \
451 $(srcdir)/lib/am/*.am | \
452 grep -v 'echo.*cd ' | \
453 grep -v 'am__cd =' | \
454 grep -v '^[^#]*cd [./]' | \
455 grep -v '^[^#]*cd \$$(top_builddir)' | \
456 grep -v '^[^#]*cd "\$$\$$am__cwd' | \
457 grep -v '^[^#]*cd \$$(abs' | \
458 grep -v '^[^#]*cd "\$$(DESTDIR)'; then \
459 echo "Consider using \$$(am__cd) in the lines above." 1>&2; \
463 ## Using @_ in a scalar context is most probably a programming error.
464 sc_perl_at_uscore_in_scalar_context:
465 @if grep -Hn '[^@_A-Za-z0-9][_A-Za-z0-9]*[^) ] *= *@_' $(srcdir)/automake.in; then \
466 echo "Using @_ in a scalar context in the lines above." 1>&2; \
470 ## Forbid using parens with `local' to ease counting.
471 sc_perl_local_no_parens:
472 @if grep '^[ \t]*local *(' $(srcdir)/automake.in; then \
473 echo "Don't use \`local' with parens: use several \`local' above." >&2; \
477 ## Allow only few variables to be localized in Automake.
479 @if egrep -v '^[ \t]*local \$$[_~]( *=|;)' $(srcdir)/automake.in | \
480 grep '^[ \t]*local [^*]'; then \
481 echo "Please avoid \`local'." 1>&2; \
485 ## Don't let AMDEP_TRUE substitution appear in automake.in.
486 sc_AMDEP_TRUE_in_automake_in:
487 @if grep '@AMDEP''_TRUE@' $(srcdir)/automake.in; then \
488 echo "Don't put AMDEP_TRUE substitution in automake.in" 1>&2; \
492 ## Tests should never call make directly.
493 sc_tests_make_without_am_makeflags:
494 @if grep '^[^#].*(MAKE) ' $(srcdir)/lib/am/*.am $(srcdir)/automake.in |\
495 grep -v 'AM_MAKEFLAGS'; then \
496 echo 'Use $$(MAKE) $$(AM_MAKEFLAGS).' 1>&2; \
500 ## Look out for some obsolete variables.
501 sc_tests_obsolete_variables:
505 test_prefer_config_shell \
510 for v in $$vars; do \
511 if grep -E "\b$$v\b" \
512 $(xtests) $(srcdir)/tests/defs \
513 $(srcdir)/tests/defs-static.in \
518 if test -n "$$seen"; then \
519 for v in $$seen; do \
520 echo "Variable '$$v' is obsolete, use 'am_$$v' instead." 1>&2; \
525 ## Tests should never call make directly.
527 @if grep -v '^#' $(xtests) | $(EGREP) ':[ ]*make( |$$)'; then \
528 echo 'Do not run "make" in the above tests. Use "$$MAKE" instead.' 1>&2; \
532 ## Tests should never call autoconf directly.
533 sc_tests_plain_autoconf:
534 @if grep -v '^#' $(xtests) | grep ':[ ]*autoconf\>'; then \
535 echo 'Do not run "autoconf" in the above tests. Use "$$AUTOCONF" instead.' 1>&2; \
539 ## Tests should never call autoupdate directly.
540 sc_tests_plain_autoupdate:
541 @if grep -v '^#' $(xtests) | grep ':[ ]*autoupdate\>'; then \
542 echo 'Do not run "autoupdate" in the above tests. Use "$$AUTOUPDATE" instead.' 1>&2; \
546 ## Tests should never call automake directly.
547 sc_tests_plain_automake:
548 @if grep -v '^#' $(xtests) | grep -E ':[ ]*automake\>([^:]|$$)'; then \
549 echo 'Do not run "automake" in the above tests. Use "$$AUTOMAKE" instead.' 1>&2; \
553 ## Tests should never call autoheader directly.
554 sc_tests_plain_autoheader:
555 @if grep -v '^#' $(xtests) | grep ':[ ]*autoheader\>'; then \
556 echo 'Do not run "autoheader" in the above tests. Use "$$AUTOHEADER" instead.' 1>&2; \
560 ## Tests should never call autoreconf directly.
561 sc_tests_plain_autoreconf:
562 @if grep -v '^#' $(xtests) | grep ':[ ]*autoreconf\>'; then \
563 echo 'Do not run "autoreconf" in the above tests. Use "$$AUTORECONF" instead.' 1>&2; \
567 ## Tests should never call autom4te directly.
568 sc_tests_plain_autom4te:
569 @if grep -v '^#' $(xtests) | grep ':[ ]*autom4te\>'; then \
570 echo 'Do not run "autom4te" in the above tests. Use "$$AUTOM4TE" instead.' 1>&2; \
574 ## Tests should only use END and EOF for here documents
575 ## (so that the next test is effective).
576 sc_tests_here_document_format:
577 @if grep '<<' $(xtests) | grep -v 'END' | grep -v 'EOF'; then \
578 echo 'Use here documents with "END" and "EOF" only, for greppability.' 1>&2; \
582 ## Tests should never call exit directly, but use Exit.
583 ## This is so that the exit status is transported correctly across the 0 trap.
584 ## Ignore comments, testsuite self tests, and one perl line in ext2.test.
585 sc_tests_Exit_not_exit:
586 @found=false; for file in $(xtests); do \
587 case $$file in */self-check-*) continue;; esac; \
588 res=`sed -n -e '/^#/d; /^\$$PERL/d' -e '/<<.*END/,/^END/b' \
589 -e '/<<.*EOF/,/^EOF/b' -e '/exit [$$0-9]/p' $$file`; \
590 if test -n "$$res"; then \
591 echo "$$file:$$res"; \
596 echo 'Do not call plain "exit", use "Exit" instead, in above tests.' 1>&2; \
600 ## Use AUTOMAKE_fails when appropriate
601 sc_tests_automake_fails:
602 @if grep -v '^#' $(xtests) | grep '\$$AUTOMAKE.*&&.*[eE]xit'; then \
603 echo 'Use AUTOMAKE_fails + grep to catch automake failures in the above tests.' 1>&2; \
607 ## Tests should never call aclocal directly.
608 sc_tests_plain_aclocal:
609 @if grep -v '^#' $(xtests) | grep ':[ ]*aclocal\>'; then \
610 echo 'Do not run "aclocal" in the above tests. Use "$$ACLOCAL" instead.' 1>&2; \
614 ## Tests should never call perl directly.
616 @if grep -v '^#' $(xtests) | grep ':[ ]*perl\>'; then \
617 echo 'Do not run "perl" in the above tests. Use "$$PERL" instead.' 1>&2; \
621 ## Setting `required' after sourcing `./defs' is a bug.
622 sc_tests_required_after_defs:
623 @for file in $(xtests); do \
624 if out=`sed -n '/defs/,$${/required=/p;}' $$file`; test -n "$$out"; then \
625 echo 'Do not set "required" after sourcing "defs" in '"$$file: $$out" 1>&2; \
630 ## TAP-based test scripts should not forget to declare a TAP plan. In
631 ## case it is not known in advance how many tests will be run, a "lazy"
632 ## plan can be used; but its use should be deliberate, explicitly declared
633 ## with a "plan_ later" call, rather than the result of an oversight.
634 ## This check helps to ensure this is indeed the case.
636 @with_plan=`grep -l '^ *plan_ ' $(srcdir)/tests/*.tap`; \
637 with_plan=`echo $$with_plan`; \
639 for t in $(srcdir)/tests/*.tap; do \
640 case " $$with_plan " in *" $$t "*) continue;; esac; \
641 ## It's ok for an *auto-generated* test sourcing an hand-written one not
642 ## to declare a TAP plan: that will be done by the sourced test.
645 t2=`echo $$t | sed -e 's|.*/||' -e 's/-w\.tap$$/.tap/'` \
646 && grep -E "^ *\\. *[^ ]*/$$t2\\b" $$t >/dev/null \
647 && continue || : ;; \
649 ok=false; echo $$t; \
652 echo 'The tests above do not declare a TAP plan.' 1>&2; \
656 ## Overriding a Makefile macro on the command line is not portable when
657 ## recursive targets are used. Better use an envvar. SHELL is an
658 ## exception, POSIX says it can't come from the environment. V, DESTDIR,
659 ## DISTCHECK_CONFIGURE_FLAGS and DISABLE_HARD_ERRORS are exceptions, too,
660 ## as package authors are urged not to initialize them anywhere.
661 sc_tests_overriding_macros_on_cmdline:
662 @if grep -E '\$$MAKE .*(SHELL=.*=|=.*SHELL=)' $(xtests); then \
663 echo 'Rewrite "$$MAKE foo=bar SHELL=$$SHELL" as "foo=bar $$MAKE -e SHELL=$$SHELL"' 1>&2; \
664 echo ' in the above lines, it is more portable.' 1>&2; \
667 ## Also try to account for usages like "$MAKE || st=$?".
668 @if sed -e 's/ || .*//' -e 's/ && .*//' \
669 -e 's/ DESTDIR=[^ ]*/ /' -e 's/ SHELL=[^ ]*/ /' \
670 -e 's/ V=[^ ]*/ /' -e 's/ DISABLE_HARD_ERRORS=[^ ]*/ /' \
671 ## DISTCHECK_CONFIGURE_FLAGS is allowed to contain whitespace in its
672 ## definition, so the more complex substitutions below.
673 -e "s/ DISTCHECK_CONFIGURE_FLAGS='[^']*'/ /" \
674 -e 's/ DISTCHECK_CONFIGURE_FLAGS="[^"]*"/ /' \
675 -e 's/ DISTCHECK_CONFIGURE_FLAGS=[^ ]/ /' \
676 $(xtests) | grep '\$$MAKE .*='; then \
677 echo 'Rewrite "$$MAKE foo=bar" as "foo=bar $$MAKE -e" in the above lines,' 1>&2; \
678 echo 'it is more portable.' 1>&2; \
681 @if grep 'SHELL=.*\$$MAKE' $(xtests); then \
682 echo '$$MAKE ignores the SHELL envvar, use "$$MAKE SHELL=$$SHELL" in' 1>&2; \
683 echo 'the above lines.' 1>&2; \
687 ## Never use `sleep 1' to create files with different timestamps.
688 ## Use `$sleep' instead. Some filesystems (e.g., Windows') have only
689 ## a 2sec resolution.
690 sc_tests_plain_sleep:
691 @if grep -E '\bsleep +[12345]\b' $(xtests); then \
692 echo 'Do not use "sleep x" in the above tests. Use "$$sleep" instead.' 1>&2; \
696 ## fgrep and egrep are not required by POSIX.
697 sc_tests_plain_egrep_fgrep:
698 @if grep -E '\b[ef]grep\b' $(xtests) ; then \
699 echo 'Do not use egrep or fgrep in test cases. Use $$FGREP or $$EGREP.' 1>&2; \
702 @if grep -E '\b[ef]grep\b' $(srcdir)/lib/am/*.am $(srcdir)/m4/*.m4; then \
703 echo 'Do not use egrep or fgrep in the above files, they are not portable.' 1>&2; \
707 ## Rule to ensure that the testsuite has been run before. We don't depend on `check'
708 ## here, because that would be very wasteful in the common case. We could run
709 ## `make check RECHECK_LOGS=' and avoid toplevel races with AM_RECURSIVE_TARGETS.
710 ## Suggest keeping test directories around for greppability of the Makefile.in files.
711 sc_ensure_testsuite_has_run:
712 @if test ! -f tests/test-suite.log; then \
713 echo "Run \`env keep_testdirs=yes make check' before \`maintainer-check'" >&2; \
716 .PHONY: sc_ensure_testsuite_has_run
718 ## Ensure our warning and error messages do not contain duplicate 'warning:' prefixes.
719 ## This test actually depends on the testsuite having been run before.
720 sc_tests_logs_duplicate_prefixes: sc_ensure_testsuite_has_run
721 @if grep -E '(warning|error):.*(warning|error):' tests/*.log; then \
722 echo 'Duplicate warning/error message prefixes seen in above tests.' >&2; \
726 ## Ensure variables are listed before rules in Makefile.in files we generate.
727 sc_tests_makefile_variable_order: sc_ensure_testsuite_has_run
728 @for file in `find tests -name Makefile.in -print`; do \
731 -e '/\\\\$$/{' -e N -e 'b x' -e '}' \
734 ## Allow @ so we match conditionals.
735 -e '/^ *[a-zA-Z_@]\{1,\} *=/p' $$file`; \
736 if test -n "$$latevars"; then \
737 echo 'Ensure variables are expanded before rules' >&2; \
738 echo "Variables are expanded too late in $$file:" >&2; \
739 echo "$$latevars" | sed 's/^/ /' >&2; \
744 ## Using `:' as a PATH separator is not portable.
745 sc_tests_PATH_SEPARATOR:
746 @if grep -E '\bPATH=.*:.*' $(xtests) ; then \
747 echo "Use \`\$$PATH_SEPARATOR', not \`:', in PATH definitions above." 1>&2; \
753 $(srcdir)/automake.in \
754 $(srcdir)/lib/am/*.am \
757 echo 'Do not use mkdir_p in the above files, use MKDIR_P.' 1>&2; \
761 ## Try to make sure all @...@ substitutions are covered by our
762 ## substitution rule.
764 @if test `grep -E '^[^#]*@[A-Za-z_0-9]+@' aclocal | wc -l` -ne 0; then \
765 echo "Unresolved @...@ substitution in aclocal" 1>&2; \
768 @if test `grep -E '^[^#]*@[A-Za-z_0-9]+@' automake | wc -l` -ne 0; then \
769 echo "Unresolved @...@ substitution in automake" 1>&2; \
774 @if grep -E "[^\'\"]\\\$$\(DESTDIR" $(srcdir)/lib/am/*.am; then \
775 echo 'Suspicious unquoted DESTDIR uses.' 1>&2 ; \
780 @if grep ' ' $(srcdir)/doc/automake.texi; then \
781 echo 'Do not use tabs in the manual.' 1>&2; \
786 @if grep -E '([^@]|^)@([ ][^@]|$$)' $(srcdir)/doc/automake.texi; \
788 echo 'Unescaped @.' 1>&2; \
793 git-dist: maintainer-check
794 ## Make sure the NEWS file is up-to-date.
795 @if sed 1q $(srcdir)/NEWS | grep -e "$(VERSION)" > /dev/null; then :; else \
796 echo "NEWS not updated; not releasing" 1>&2; \
799 ## Build the distribution. We expect the developer to have already run
800 ## "make check" and "make distcheck" on his own (as required in the
801 ## HACKING file, section "Release procedure").
802 $(MAKE) $(AM_MAKEFLAGS) dist
803 ## Finally, if anything was successful, commit the last changes and tag
804 ## the release in the repository. We don't use RCS keywords so it's OK
805 ## to distribute the files before they were committed.
806 $(am__cd) $(srcdir) && git commit -a -s && \
807 git tag -s "v$(VERSION)" -m "Release $(VERSION)"
809 git-release: git-dist
811 *[a-z]) dest=alpha;; \
814 $(srcdir)/lib/gnupload $(GNUPLOADFLAGS) \
815 --to $$dest.gnu.org:automake $(DIST_ARCHIVES)
818 thisver="v$(VERSION)"; \
819 if test -z "$$OLDVERSION"; then \
820 prevno=`echo "$(VERSION)" - 0.01 | bc | sed 's/^\./0./'`; \
821 else prevno="$$OLDVERSION"; fi; \
823 git diff $$prevver..$$thisver $(PACKAGE) \
824 > $(PACKAGE)-$$prevno-$(VERSION).diff
826 ## Check our path lengths.
828 ($(am__cd) $(distdir) && \
829 ## FIXME there's got to be a better way! pathchk should take the list
830 ## of files on stdin, at least.
831 find . -print | xargs pathchk -p); \
833 find $(distdir) -type d '!' -perm -200 -exec chmod u+w {} ';'; \
837 ## Visually comparing differences between the Makefile.in files in
838 ## automake's own build system as generated in two different branches
839 ## might help to catch bugs and blunders. This has already happened a
840 ## few times in the past, when we used to version-control Makefile.in.
843 NEW_COMMIT=$${NEW_COMMIT-"HEAD"}; \
844 OLD_COMMIT=$${OLD_COMMIT-"HEAD~1"}; \
845 am_gitdir='$(abs_top_srcdir)/.git'; \
846 get_autofiles_from_rev () \
849 && echo "$@: will get files from revision $$rev" \
850 && git clone -q --depth 1 "$$am_gitdir" tmp \
852 && git checkout -q "$$rev" \
853 && echo "$@: bootstrapping $$rev" \
854 && $(SHELL) ./bootstrap \
855 && echo "$@: copying files from $$rev" \
856 && makefile_ins=`find . -name Makefile.in` \
857 && (tar cf - configure aclocal.m4 $$makefile_ins) | \
858 (cd .. && cd "$$dir" && tar xf -) \
863 ## Before proceeding, ensure the specified revisions truly exist.
864 && git --git-dir="$$am_gitdir" describe $$OLD_COMMIT >/dev/null \
865 && git --git-dir="$$am_gitdir" describe $$NEW_COMMIT >/dev/null \
870 && get_autofiles_from_rev $$OLD_COMMIT old \
871 && get_autofiles_from_rev $$NEW_COMMIT new \
873 ## With lots of eye candy; we like our developers pampered and spoiled :-)
874 compare-autodiffs: autodiffs
876 : $${COLORDIFF=colordiff} $${DIFF=diff}; \
878 if test ! -d "$$dir"; then \
879 echo "$@: $$dir: Not a directory" >&2; \
882 mydiff=false mypager=false; \
884 if ($$COLORDIFF -r . .) </dev/null >/dev/null 2>&1; then \
885 mydiff=$$COLORDIFF; \
893 if test "$$mydiff" = false; then \
894 if ($$DIFF -r -u . .); then \
897 echo "$@: no good-enough diff program specified" >&2; \
901 st=0; $$mydiff -r -u $$dir/old $$dir/new | $$mypager || st=$$?; \
904 .PHONY: autodiffs compare-autodiffs
906 ## Program to use to fetch files.
908 WGET_SV_CVS = $(WGET) http://savannah.gnu.org/cgi-bin/viewcvs/~checkout~/
909 WGET_SV_GIT_CF = $(WGET) 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;hb=HEAD;f='
910 WGET_SV_GIT_AC = $(WGET) 'http://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=blob_plain;hb=HEAD;f='
911 WGET_SV_GIT_GL = $(WGET) 'http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob_plain;hb=HEAD;f='
912 WGET_GCC = $(WGET) 'http://gcc.gnu.org/viewcvs/*checkout*/trunk/'
914 ## Files that we fetch and which we compare against.
915 ## FIXME should be a lot more here
921 gitlog-to-changelog \
925 ## Fetch the latest versions of files we care about.
927 rm -rf Fetchdir > /dev/null 2>&1
929 ## If a get fails then that is a problem.
930 ($(am__cd) Fetchdir && \
931 $(WGET_SV_GIT_CF)config.guess -O config.guess && \
932 $(WGET_SV_GIT_CF)config.sub -O config.sub && \
933 $(WGET_SV_CVS)texinfo/texinfo/doc/texinfo.tex -O texinfo.tex && \
934 $(WGET_SV_GIT_GL)doc/INSTALL -O INSTALL && \
935 $(WGET_SV_GIT_GL)build-aux/gitlog-to-changelog -O gitlog-to-changelog && \
936 $(WGET_GCC)config-ml.in -O config-ml.in && \
937 $(WGET_GCC)symlink-tree -O symlink-tree)
938 ## Don't exit after test because we want to give as many errors as
940 @stat=0; for file in $(FETCHFILES); do \
941 if diff -u $(srcdir)/lib/$$file Fetchdir/$$file \
942 >>Fetchdir/update.patch 2>/dev/null; then :; \
945 echo "Updating $(srcdir)/lib/$$file ..."; \
946 cp Fetchdir/$$file $(srcdir)/lib/$$file; \
950 echo "See Fetchdir/update.patch for a log of the changes."; \
953 ## Generate release statistics, for the table in automake.texi.
954 ## This has to be run in an up to date build tree, but there must
955 ## be no temp files nor unused other files lying around!
957 @am=`wc -l < automake` && \
958 acl=`wc -l < aclocal` && \
959 pmfiles="lib/Automake/*.pm" && \
960 if test . != '$(srcdir)'; then pmfiles="$$pmfiles $(srcdir)/lib/Automake/*.pm"; \
962 pm=`cat $$pmfiles | wc -l` && \
963 dot_am_files=`ls -1 $(srcdir)/lib/am/*.am | grep -v Makefile.am` && \
964 amf=`echo "$$dot_am_files" | wc -l` && \
965 aml=`cat $$dot_am_files | wc -l` && \
966 m4f=`ls -1 $(srcdir)/m4/*.m4 | wc -l` && \
967 m4l=`cat $(srcdir)/m4/*.m4 | wc -l` && \
968 doc_text=`$(am__cd) doc && LC_ALL=C pstops 0 automake.ps unused.ps 2>&1` && \
969 echo "$$doc_text" && \
970 rm -f doc/unused.ps && \
971 doc=`echo "$$doc_text" | sed -n 's/.*Wrote \([1-9][0-9]*\) pages.*/\1/p'` && \
972 tests="tests/*.test"; \
973 if test . != '$(srcdir)'; then tests="$$tests $(srcdir)/tests/*.test"; \
975 t=`ls -1 $$tests | wc -l` && \
976 tgen=`grep 'GENERATED AUTOMATICALLY' $$tests | wc -l` && \
977 today=`date +%Y-%m-%d` && \
978 echo "add this to the table in doc/automake.texi after verification:" && \
979 printf '@item %s @tab %-6s @tab %4d @tab %4d @tab %4d @tab %4d %-4s @tab %4d %-4s @tab %3d @tab %d %-4s\n' \
980 $$today $(VERSION) $$am $$acl $$pm $$aml "($$amf)" $$m4l "($$m4f)" $$doc $$t "($$tgen)"
981 .PHONY: release-stats