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)
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_GEN)rm -f $@ $@.tmp
95 $(AM_V_at)$(do_subst) $(srcdir)/$@.in >$@.tmp
96 $(AM_V_at)chmod +x $@.tmp
97 $(AM_V_at)chmod a-w $@.tmp
98 $(AM_V_at)mv -f $@.tmp $@
100 ## The master location for INSTALL is lib/INSTALL.
101 ## This is where `make fetch' will install new versions.
102 ## Make sure we also update this copy.
104 $(AM_V_GEN)cp $(srcdir)/lib/INSTALL $@
106 # Run the testsuite with the installed aclocal and automake.
108 am_running_installcheck=yes $(MAKE) $(AM_MAKEFLAGS) check
110 ## recheck: convenience proxy target for the test suites.
114 for f in x $$MAKEFLAGS; do \
117 *k*) failcom='fail=yes';; \
120 for subdir in $(TEST_SUBDIRS); do \
121 ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@) \
126 ################################################################
128 ## Everything past here is useful to the maintainer, but probably not
132 # Ensure tests are world-executable
134 $(am__cd) $(distdir)/tests && chmod a+rx *.test
137 # Perl coverage statistics.
138 PERL_COVERAGE_DB = $(abs_top_builddir)/cover_db
139 PERL_COVERAGE_FLAGS = -MDevel::Cover=-db,$(PERL_COVERAGE_DB),-silent,on,-summary,off
142 check-coverage-run recheck-coverage-run: all
143 $(mkinstalldirs) $(PERL_COVERAGE_DB)
144 PERL5OPT="$$PERL5OPT $(PERL_COVERAGE_FLAGS)"; export PERL5OPT; \
145 WANT_NO_THREADS=yes; export WANT_NO_THREADS; unset AUTOMAKE_JOBS; \
146 $(MAKE) $(AM_MAKEFLAGS) `echo $@ | sed 's/-coverage-run//'`
148 check-coverage-report:
149 @if test ! -d "$(PERL_COVERAGE_DB)"; then \
150 echo "No coverage database found in \`$(PERL_COVERAGE_DB)'." >&2; \
151 echo "Please run \`make check-coverage' first" >&2; \
154 $(PERL_COVER) $(PERL_COVER_FLAGS) "$(PERL_COVERAGE_DB)"
156 # We don't use direct dependencies here because we'd like to be able
157 # to invoke the report even after interrupted check-coverage.
158 check-coverage: check-coverage-run
159 $(MAKE) $(AM_MAKEFLAGS) check-coverage-report
161 recheck-coverage: recheck-coverage-run
162 $(MAKE) $(AM_MAKEFLAGS) check-coverage-report
165 rm -rf "$(PERL_COVERAGE_DB)"
166 clean-local: clean-coverage
168 .PHONY: check-coverage recheck-coverage check-coverage-run \
169 recheck-coverage-run check-coverage-report clean-coverage
171 # Some simple checks, and then ordinary check. These are only really
172 # guaranteed to work on my machine.
173 syntax_check_rules = \
175 sc_diff_automake_in_automake \
176 sc_diff_aclocal_in_automake \
178 sc_no_brace_variable_expansions \
180 sc_no_for_variable_in_macro \
182 sc_pre_normal_post_install_uninstall \
184 sc_perl_no_split_regex_space \
185 sc_cd_in_backquotes \
187 sc_perl_at_uscore_in_scalar_context \
188 sc_perl_local_no_parens \
190 sc_AMDEP_TRUE_in_automake_in \
191 sc_tests_make_without_am_makeflags \
192 sc_tests_obsolete_variables \
193 sc_tests_plain_make \
194 sc_tests_plain_autoconf \
195 sc_tests_plain_autoupdate \
196 sc_tests_plain_automake \
197 sc_tests_plain_autom4te \
198 sc_tests_plain_autoheader \
199 sc_tests_plain_autoreconf \
200 sc_tests_here_document_format \
201 sc_tests_Exit_not_exit \
202 sc_tests_automake_fails \
203 sc_tests_plain_aclocal \
204 sc_tests_plain_perl \
205 sc_tests_required_after_defs \
207 sc_tests_overriding_macros_on_cmdline \
208 sc_tests_plain_sleep \
209 sc_tests_plain_egrep_fgrep \
210 sc_tests_PATH_SEPARATOR \
211 sc_tests_logs_duplicate_prefixes \
212 sc_tests_makefile_variable_order \
215 sc_unquoted_DESTDIR \
219 .PHONY: $(syntax_check_rules)
220 $(syntax_check_rules): automake aclocal
222 ## Check that the list of tests given in the Makefile is equal to the
223 ## list of all test scripts in the Automake testsuite.
224 .PHONY: maintainer-check-list-of-tests
225 maintainer-check-list-of-tests:
227 for f in x $$MAKEFLAGS; do \
230 *k*) failcom='fail=yes';; \
233 for subdir in $(TEST_SUBDIRS); do \
234 (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@) || eval $$failcom; \
238 maintainer-check: $(syntax_check_rules) maintainer-check-list-of-tests
240 ## Look for test whose names can cause spurious failures when used as
241 ## first argument to AC_INIT (chiefly because they might contain an
242 ## m4/m4sugar builtin or macro name).
292 @m4_builtin_rx=`echo $(m4_builtins) | sed 's/ /|/g'`; \
293 m4_macro_rx="\\<($$m4_builtin_rx)\\>|\\<_?(A[CUMHS]|m4)_"; \
294 if ls tests/*.test | LC_ALL=C grep -E "$$m4_macro_rx"; then \
295 echo "the names of the tests above can be problematic" 1>&2; \
296 echo "Avoid test names that contain names of m4 macros" 1>&2; \
300 ## These check avoids accidental configure substitutions in the source.
301 ## There are exactly 9 lines that should be modified from automake.in to
302 ## automake, and 10 lines that should be modified from aclocal.in to
303 ## aclocal; these wors out to 32 and 34 lines of diffs, respectively.
304 sc_diff_automake_in_automake:
305 @if test `diff $(srcdir)/automake.in automake | wc -l` -ne 32; then \
306 echo "found too many diffs between automake.in and automake" 1>&2; \
307 diff -c $(srcdir)/automake.in automake; \
310 sc_diff_aclocal_in_aclocal:
311 @if test `diff $(srcdir)/aclocal.in aclocal | wc -l` -ne 34; then \
312 echo "found too many diffs between aclocal.in and aclocal" 1>&2; \
313 diff -c $(srcdir)/aclocal.in aclocal; \
317 ## Syntax check with default Perl (on my machine, Perl 5).
319 perllibdir="./lib$(PATH_SEPARATOR)$(srcdir)/lib" $(PERL) -c -w automake
320 perllibdir="./lib$(PATH_SEPARATOR)$(srcdir)/lib" $(PERL) -c -w aclocal
322 ## expect no instances of '${...}'. However, $${...} is ok, since that
323 ## is a shell construct, not a Makefile construct.
324 sc_no_brace_variable_expansions:
325 @if grep -F '$${' $(srcdir)/lib/am/[a-z]*.am | \
326 grep -F -v '$$$$'; then \
327 echo "Found too many uses of '\$${' in the lines above." 1>&2; \
331 ## Make sure `rm' is called with `-f'.
333 @if grep -v '^#' $(srcdir)/lib/am/[a-z]*.am $(srcdir)/tests/*.test | \
334 grep -E '\<rm ([^-]|\-[^f ]*\>)'; then \
335 echo "Suspicious 'rm' invocation." 1>&2; \
339 ## Never use something like `for file in $(FILES)', this doesn't work
340 ## if FILES is empty or if it contains shell meta characters (e.g. $ is
341 ## commonly used in Java filenames).
342 sc_no_for_variable_in_macro:
343 @if grep 'for .* in \$$(' $(srcdir)/lib/am/[a-z]*.am; then \
344 echo 'Use "list=$$(mumble); for var in $$$$list".' 1>&2 ; \
348 ## Make sure all invocations of mkinstalldirs are correct.
350 @if grep -n 'mkinstalldirs' $(srcdir)/lib/am/[a-z]*.am | \
351 grep -F -v '$$(mkinstalldirs)'; then \
352 echo "Found incorrect use of mkinstalldirs in the lines above" 1>&2; \
356 ## Make sure all calls to PRE/NORMAL/POST_INSTALL/UNINSTALL
357 sc_pre_normal_post_install_uninstall:
358 @if grep -E -n '\((PRE|NORMAL|POST)_(|UN)INSTALL\)' \
359 $(srcdir)/lib/am/[a-z]*.am | \
360 grep -v ':##' | grep -v ': @\$$('; then \
361 echo "Found incorrect use of PRE/NORMAL/POST_INSTALL/UNINSTALL in the lines above" 1>&2; \
365 ## We never want to use "undef", only "delete", but for $/.
367 @if grep -n -w 'undef ' $(srcdir)/automake.in | \
368 grep -F -v 'undef $$/'; then \
369 echo "Found undef in automake.in; use delete instead" 1>&2; \
373 ## We never want split (/ /,...), only split (' ', ...).
374 sc_perl_no_split_regex_space:
375 @if grep -n 'split (/ /' $(srcdir)/automake.in; then \
376 echo "Found bad split in the lines above." 1>&2; \
380 ## Look for cd within backquotes
382 @if grep -n '^[^#]*` *cd ' $(srcdir)/automake.in \
383 $(srcdir)/lib/am/*.am; then \
384 echo "Consider using \$$(am__cd) in the lines above." 1>&2; \
388 ## Look for cd to a relative directory (may be influenced by CDPATH).
389 ## Skip some known directories that are OK.
391 @if grep -n '^[^#]*cd ' $(srcdir)/automake.in \
392 $(srcdir)/lib/am/*.am | \
393 grep -v 'echo.*cd ' | \
394 grep -v 'am__cd =' | \
395 grep -v '^[^#]*cd [./]' | \
396 grep -v '^[^#]*cd \$$(top_builddir)' | \
397 grep -v '^[^#]*cd "\$$\$$am__cwd' | \
398 grep -v '^[^#]*cd \$$(abs' | \
399 grep -v '^[^#]*cd "\$$(DESTDIR)'; then \
400 echo "Consider using \$$(am__cd) in the lines above." 1>&2; \
404 ## Using @_ in a scalar context is most probably a programming error.
405 sc_perl_at_uscore_in_scalar_context:
406 @if grep -Hn '[^@_A-Za-z0-9][_A-Za-z0-9]*[^) ] *= *@_' $(srcdir)/automake.in; then \
407 echo "Using @_ in a scalar context in the lines above." 1>&2; \
411 ## Forbid using parens with `local' to ease counting.
412 sc_perl_local_no_parens:
413 @if grep '^[ \t]*local *(' $(srcdir)/automake.in; then \
414 echo "Don't use \`local' with parens: use several \`local' above." >&2; \
418 ## Allow only few variables to be localized in Automake.
420 @if egrep -v '^[ \t]*local \$$[_~]( *=|;)' $(srcdir)/automake.in | \
421 grep '^[ \t]*local [^*]'; then \
422 echo "Please avoid \`local'." 1>&2; \
426 ## Don't let AMDEP_TRUE substitution appear in automake.in.
427 sc_AMDEP_TRUE_in_automake_in:
428 @if grep '@AMDEP''_TRUE@' $(srcdir)/automake.in; then \
429 echo "Don't put AMDEP_TRUE substitution in automake.in" 1>&2; \
433 ## Tests should never call make directly.
434 sc_tests_make_without_am_makeflags:
435 @if grep '^[^#].*(MAKE) ' $(srcdir)/lib/am/*.am $(srcdir)/automake.in |\
436 grep -v 'AM_MAKEFLAGS'; then \
437 echo 'Use $$(MAKE) $$(AM_MAKEFLAGS).' 1>&2; \
441 ## Look out for some obsolete variables.
442 sc_tests_obsolete_variables:
446 test_prefer_config_shell \
451 for v in $$vars; do \
452 if grep -E "\b$$v\b" \
453 $(srcdir)/tests/*.test \
454 $(srcdir)/tests/*.tap \
455 $(srcdir)/tests/*.sh \
456 $(srcdir)/tests/defs \
457 $(srcdir)/tests/defs-static.in \
462 if test -n "$$seen"; then \
463 for v in $$seen; do \
464 echo "Variable '$$v' is obsolete, use 'am_$$v' instead." 1>&2; \
469 ## Tests should never call make directly.
471 @if grep -v '^#' $(srcdir)/tests/*.test | $(EGREP) ':[ ]*make( |$$)'; then \
472 echo 'Do not run "make" in the above tests. Use "$$MAKE" instead.' 1>&2; \
476 ## Tests should never call autoconf directly.
477 sc_tests_plain_autoconf:
478 @if grep -v '^#' $(srcdir)/tests/*.test | grep ':[ ]*autoconf\>'; then \
479 echo 'Do not run "autoconf" in the above tests. Use "$$AUTOCONF" instead.' 1>&2; \
483 ## Tests should never call autoupdate directly.
484 sc_tests_plain_autoupdate:
485 @if grep -v '^#' $(srcdir)/tests/*.test | grep ':[ ]*autoupdate\>'; then \
486 echo 'Do not run "autoupdate" in the above tests. Use "$$AUTOUPDATE" instead.' 1>&2; \
490 ## Tests should never call automake directly.
491 sc_tests_plain_automake:
492 @if grep -v '^#' $(srcdir)/tests/*.test | grep -E ':[ ]*automake\>([^:]|$$)'; then \
493 echo 'Do not run "automake" in the above tests. Use "$$AUTOMAKE" instead.' 1>&2; \
497 ## Tests should never call autoheader directly.
498 sc_tests_plain_autoheader:
499 @if grep -v '^#' $(srcdir)/tests/*.test | grep ':[ ]*autoheader\>'; then \
500 echo 'Do not run "automake" in the above tests. Use "$$AUTOHEADER" instead.' 1>&2; \
504 ## Tests should never call autoreconf directly.
505 sc_tests_plain_autoreconf:
506 @if grep -v '^#' $(srcdir)/tests/*.test | grep ':[ ]*autoreconf\>'; then \
507 echo 'Do not run "automake" in the above tests. Use "$$AUTORECONF" instead.' 1>&2; \
511 ## Tests should never call autom4te directly.
512 sc_tests_plain_autom4te:
513 @if grep -v '^#' $(srcdir)/tests/*.test | grep ':[ ]*autom4te\>'; then \
514 echo 'Do not run "automake" in the above tests. Use "$$AUTOM4TE" instead.' 1>&2; \
518 ## Tests should only use END and EOF for here documents
519 ## (so that the next test is effective).
520 sc_tests_here_document_format:
521 @if grep '<<' $(srcdir)/tests/*.test | grep -v 'END' | grep -v 'EOF'; then \
522 echo 'Use here documents with "END" and "EOF" only, for greppability.' 1>&2; \
526 ## Tests should never call exit directly, but use Exit.
527 ## This is so that the exit status is transported correctly across the 0 trap.
528 ## Ignore comments, testsuite self tests, and one perl line in ext2.test.
529 sc_tests_Exit_not_exit:
530 @found=false; for file in $(srcdir)/tests/*.test; do \
531 case $$file in */self-check-*.test) continue;; esac; \
532 res=`sed -n -e '/^#/d; /^\$$PERL/d' -e '/<<.*END/,/^END/b' \
533 -e '/<<.*EOF/,/^EOF/b' -e '/exit [$$0-9]/p' $$file`; \
534 if test -n "$$res"; then \
535 echo "$$file:$$res"; \
540 echo 'Do not call plain "exit", use "Exit" instead, in above tests.' 1>&2; \
544 ## Use AUTOMAKE_fails when appropriate
545 sc_tests_automake_fails:
546 @if grep -v '^#' $(srcdir)/tests/*.test | grep '\$$AUTOMAKE.*&&.*[eE]xit'; then \
547 echo 'Use AUTOMAKE_fails + grep to catch automake failures in the above tests.' 1>&2; \
551 ## Tests should never call aclocal directly.
552 sc_tests_plain_aclocal:
553 @if grep -v '^#' $(srcdir)/tests/*.test | grep ':[ ]*aclocal\>'; then \
554 echo 'Do not run "aclocal" in the above tests. Use "$$ACLOCAL" instead.' 1>&2; \
558 ## Tests should never call perl directly.
560 @if grep -v '^#' $(srcdir)/tests/*.test | grep ':[ ]*perl\>'; then \
561 echo 'Do not run "perl" in the above tests. Use "$$PERL" instead.' 1>&2; \
565 ## Setting `required' after sourcing `./defs' is a bug.
566 sc_tests_required_after_defs:
567 @for file in $(srcdir)/tests/*.test; do \
568 if out=`sed -n '/defs/,$${/required=/p;}' $$file`; test -n "$$out"; then \
569 echo 'Do not set "required" after sourcing "defs" in '"$$file: $$out" 1>&2; \
574 ## TAP-based test scripts should not forget to declare a TAP plan. In
575 ## case it is not known in advance how many tests will be run, a "lazy"
576 ## plan can be used; but its use should be deliberate, explicitly declared
577 ## with a "plan_ later" call, rather than the result of an oversight.
578 ## This check helps to ensure this is indeed the case.
580 @with_plan=`grep -l '^ *plan_ ' $(srcdir)/tests/*.tap`; \
581 with_plan=`echo $$with_plan`; \
583 for t in $(srcdir)/tests/*.tap; do \
584 case " $$with_plan " in *" $$t "*) continue;; esac; \
585 ## It's ok for an *auto-generated* test sourcing an hand-written one not
586 ## to declare a TAP plan: that will be done by the sourced test.
589 t2=`echo $$t | sed -e 's|.*/||' -e 's/-w\.tap$$/.tap/'` \
590 && grep -E "^ *\\. *[^ ]*/$$t2\\b" $$t >/dev/null \
591 && continue || : ;; \
593 ok=false; echo $$t; \
596 echo 'The tests above do not declare a TAP plan.' 1>&2; \
600 ## Overriding a Makefile macro on the command line is not portable when
601 ## recursive targets are used. Better use an envvar. SHELL is an
602 ## exception, POSIX says it can't come from the environment. V, DESTDIR,
603 ## DISTCHECK_CONFIGURE_FLAGS and DISABLE_HARD_ERRORS are exceptions, too,
604 ## as package authors are urged not to initialize them anywhere.
605 sc_tests_overriding_macros_on_cmdline:
606 @if grep -E '\$$MAKE .*(SHELL=.*=|=.*SHELL=)' $(srcdir)/tests/*.test; then \
607 echo 'Rewrite "$$MAKE foo=bar SHELL=$$SHELL" as "foo=bar $$MAKE -e SHELL=$$SHELL"' 1>&2; \
608 echo ' in the above lines, it is more portable.' 1>&2; \
611 ## Also try to account for usages like "$MAKE || st=$?".
612 @if sed -e 's/ || .*//' -e 's/ && .*//' \
613 -e 's/ DESTDIR=[^ ]*/ /' -e 's/ SHELL=[^ ]*/ /' \
614 -e 's/ V=[^ ]*/ /' -e 's/ DISABLE_HARD_ERRORS=[^ ]*/ /' \
615 ## DISTCHECK_CONFIGURE_FLAGS is allowed to contain whitespace in its
616 ## definition, so the more complex substitutions below.
617 -e "s/ DISTCHECK_CONFIGURE_FLAGS='[^']*'/ /" \
618 -e 's/ DISTCHECK_CONFIGURE_FLAGS="[^"]*"/ /' \
619 -e 's/ DISTCHECK_CONFIGURE_FLAGS=[^ ]/ /' \
620 $(srcdir)/tests/*.test | grep '\$$MAKE .*='; then \
621 echo 'Rewrite "$$MAKE foo=bar" as "foo=bar $$MAKE -e" in the above lines,' 1>&2; \
622 echo 'it is more portable.' 1>&2; \
625 @if grep 'SHELL=.*\$$MAKE' $(srcdir)/tests/*.test; then \
626 echo '$$MAKE ignores the SHELL envvar, use "$$MAKE SHELL=$$SHELL" in' 1>&2; \
627 echo 'the above lines.' 1>&2; \
631 ## Never use `sleep 1' to create files with different timestamps.
632 ## Use `$sleep' instead. Some filesystems (e.g., Windows') have only
633 ## a 2sec resolution.
634 sc_tests_plain_sleep:
635 @if grep -E '\bsleep +[12345]\b' $(srcdir)/tests/*.test; then \
636 echo 'Do not use "sleep x" in the above tests. Use "$$sleep" instead.' 1>&2; \
640 ## fgrep and egrep are not required by POSIX.
641 sc_tests_plain_egrep_fgrep:
642 @if grep -E '\b[ef]grep\b' $(srcdir)/tests/*.test ; then \
643 echo 'Do not use egrep or fgrep in test cases. Use $$FGREP or $$EGREP.' 1>&2; \
646 @if grep -E '\b[ef]grep\b' $(srcdir)/lib/am/*.am $(srcdir)/m4/*.m4; then \
647 echo 'Do not use egrep or fgrep in the above files, they are not portable.' 1>&2; \
651 ## Rule to ensure that the testsuite has been run before. We don't depend on `check'
652 ## here, because that would be very wasteful in the common case. We could run
653 ## `make check RECHECK_LOGS=' and avoid toplevel races with AM_RECURSIVE_TARGETS.
654 ## Suggest keeping test directories around for greppability of the Makefile.in files.
655 sc_ensure_testsuite_has_run:
656 @if test ! -f tests/test-suite.log; then \
657 echo "Run \`env keep_testdirs=yes make check' before \`maintainer-check'" >&2; \
660 .PHONY: sc_ensure_testsuite_has_run
662 ## Ensure our warning and error messages do not contain duplicate 'warning:' prefixes.
663 ## This test actually depends on the testsuite having been run before.
664 sc_tests_logs_duplicate_prefixes: sc_ensure_testsuite_has_run
665 @if grep -E '(warning|error):.*(warning|error):' tests/*.log; then \
666 echo 'Duplicate warning/error message prefixes seen in above tests.' >&2; \
670 ## Ensure variables are listed before rules in Makefile.in files we generate.
671 sc_tests_makefile_variable_order: sc_ensure_testsuite_has_run
672 @for file in `find tests -name Makefile.in -print`; do \
675 -e '/\\\\$$/{' -e N -e 'b x' -e '}' \
678 ## Allow @ so we match conditionals.
679 -e '/^ *[a-zA-Z_@]\{1,\} *=/p' $$file`; \
680 if test -n "$$latevars"; then \
681 echo 'Ensure variables are expanded before rules' >&2; \
682 echo "Variables are expanded too late in $$file:" >&2; \
683 echo "$$latevars" | sed 's/^/ /' >&2; \
688 ## Using `:' as a PATH separator is not portable.
689 sc_tests_PATH_SEPARATOR:
690 @if grep -E '\bPATH=.*:.*' $(srcdir)/tests/*.test ; then \
691 echo "Use \`\$$PATH_SEPARATOR', not \`:', in PATH definitions above." 1>&2; \
696 @if grep 'mkdir_p' $(srcdir)/automake.in \
697 $(srcdir)/lib/am/*.am $(srcdir)/tests/*.test; then \
698 echo 'Do not use mkdir_p in the above files, use MKDIR_P.' 1>&2; \
702 ## Try to make sure all @...@ substitutions are covered by our
703 ## substitution rule.
705 @if test `grep -E '^[^#]*@[A-Za-z_0-9]+@' aclocal | wc -l` -ne 0; then \
706 echo "Unresolved @...@ substitution in aclocal" 1>&2; \
709 @if test `grep -E '^[^#]*@[A-Za-z_0-9]+@' automake | wc -l` -ne 0; then \
710 echo "Unresolved @...@ substitution in automake" 1>&2; \
715 @if grep -E "[^\'\"]\\\$$\(DESTDIR" $(srcdir)/lib/am/*.am; then \
716 echo 'Suspicious unquoted DESTDIR uses.' 1>&2 ; \
721 @if grep ' ' $(srcdir)/doc/automake.texi; then \
722 echo 'Do not use tabs in the manual.' 1>&2; \
727 @if grep -E '([^@]|^)@([ ][^@]|$$)' $(srcdir)/doc/automake.texi; \
729 echo 'Unescaped @.' 1>&2; \
734 git-dist: maintainer-check
735 ## Make sure the NEWS file is up-to-date.
736 @if sed 1q $(srcdir)/NEWS | grep -e "$(VERSION)" > /dev/null; then :; else \
737 echo "NEWS not updated; not releasing" 1>&2; \
740 ## Build the distribution
741 $(MAKE) $(AM_MAKEFLAGS) distcheck
742 ## Finally, if anything was successful, commit the last changes and tag
743 ## the release in the repository. We don't use RCS keywords so it's OK
744 ## to distribute the files before they were committed.
745 $(am__cd) $(srcdir) && git commit -a -s && \
746 git tag -s "v$(VERSION)" -m "Release $(VERSION)"
748 git-release: git-dist
750 *[a-z]) dest=alpha;; \
753 $(srcdir)/lib/gnupload $(GNUPLOADFLAGS) \
754 --to $$dest.gnu.org:automake $(DIST_ARCHIVES)
757 thisver="v$(VERSION)"; \
758 if test -z "$$OLDVERSION"; then \
759 prevno=`echo "$(VERSION)" - 0.01 | bc | sed 's/^\./0./'`; \
760 else prevno="$$OLDVERSION"; fi; \
762 git diff $$prevver..$$thisver $(PACKAGE) \
763 > $(PACKAGE)-$$prevno-$(VERSION).diff
765 ## Check our path lengths.
767 ($(am__cd) $(distdir) && \
768 ## FIXME there's got to be a better way! pathchk should take the list
769 ## of files on stdin, at least.
770 find . -print | xargs pathchk -p); \
772 find $(distdir) -type d '!' -perm -200 -exec chmod u+w {} ';'; \
776 ## Program to use to fetch files.
778 WGET_SV_CVS = $(WGET) http://savannah.gnu.org/cgi-bin/viewcvs/~checkout~/
779 WGET_SV_GIT_CF = $(WGET) 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;hb=HEAD;f='
780 WGET_SV_GIT_AC = $(WGET) 'http://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=blob_plain;hb=HEAD;f='
781 WGET_SV_GIT_GL = $(WGET) 'http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob_plain;hb=HEAD;f='
782 WGET_GCC = $(WGET) 'http://gcc.gnu.org/viewcvs/*checkout*/trunk/'
784 ## Files that we fetch and which we compare against.
785 ## FIXME should be a lot more here
794 ## Fetch the latest versions of files we care about.
796 rm -rf Fetchdir > /dev/null 2>&1
798 ## If a get fails then that is a problem.
799 ($(am__cd) Fetchdir && \
800 $(WGET_SV_GIT_CF)config.guess -O config.guess && \
801 $(WGET_SV_GIT_CF)config.sub -O config.sub && \
802 $(WGET_SV_CVS)texinfo/texinfo/doc/texinfo.tex -O texinfo.tex && \
803 $(WGET_SV_GIT_GL)doc/INSTALL -O INSTALL && \
804 $(WGET_GCC)config-ml.in -O config-ml.in && \
805 $(WGET_GCC)symlink-tree -O symlink-tree)
806 ## Don't exit after test because we want to give as many errors as
808 @stat=0; for file in $(FETCHFILES); do \
809 if diff -u $(srcdir)/lib/$$file Fetchdir/$$file \
810 >>Fetchdir/update.patch 2>/dev/null; then :; \
813 echo "Updating $(srcdir)/lib/$$file ..."; \
814 cp Fetchdir/$$file $(srcdir)/lib/$$file; \
818 echo "See Fetchdir/update.patch for a log of the changes."; \
821 ## Generate release statistics, for the table in automake.texi.
822 ## This has to be run in an up to date build tree, but there must
823 ## be no temp files nor unused other files lying around!
825 @am=`wc -l < automake` && \
826 acl=`wc -l < aclocal` && \
827 pmfiles="lib/Automake/*.pm" && \
828 if test . != '$(srcdir)'; then pmfiles="$$pmfiles $(srcdir)/lib/Automake/*.pm"; \
830 pm=`cat $$pmfiles | wc -l` && \
831 dot_am_files=`ls -1 $(srcdir)/lib/am/*.am | grep -v Makefile.am` && \
832 amf=`echo "$$dot_am_files" | wc -l` && \
833 aml=`cat $$dot_am_files | wc -l` && \
834 m4f=`ls -1 $(srcdir)/m4/*.m4 | wc -l` && \
835 m4l=`cat $(srcdir)/m4/*.m4 | wc -l` && \
836 doc_text=`$(am__cd) doc && LC_ALL=C pstops 0 automake.ps unused.ps 2>&1` && \
837 echo "$$doc_text" && \
838 rm -f doc/unused.ps && \
839 doc=`echo "$$doc_text" | sed -n 's/.*Wrote \([1-9][0-9]*\) pages.*/\1/p'` && \
840 tests="tests/*.test"; \
841 if test . != '$(srcdir)'; then tests="$$tests $(srcdir)/tests/*.test"; \
843 t=`ls -1 $$tests | wc -l` && \
844 tgen=`grep 'GENERATED AUTOMATICALLY' $$tests | wc -l` && \
845 today=`date +%Y-%m-%d` && \
846 echo "add this to the table in doc/automake.texi after verification:" && \
847 printf '@item %s @tab %-6s @tab %4d @tab %4d @tab %4d @tab %4d %-4s @tab %4d %-4s @tab %3d @tab %d %-4s\n' \
848 $$today $(VERSION) $$am $$acl $$pm $$aml "($$amf)" $$m4l "($$m4f)" $$doc $$t "($$tgen)"
849 .PHONY: release-stats