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)
50 ## Make versioned links. We only run the transform on the root name;
51 ## then we make a versioned link with the transformed base name. This
52 ## seemed like the most reasonable approach.
55 @for p in $(bin_SCRIPTS); do \
56 f="`echo $$p|sed '$(transform)'`"; \
57 fv="$$f-$(APIVERSION)"; \
58 rm -f $(DESTDIR)$(bindir)/$$fv; \
59 echo " $(LN) $(DESTDIR)$(bindir)/$$f $(DESTDIR)$(bindir)/$$fv"; \
60 $(LN) $(DESTDIR)$(bindir)/$$f $(DESTDIR)$(bindir)/$$fv; \
64 @for p in $(bin_SCRIPTS); do \
65 f="`echo $$p|sed '$(transform)'`"; \
66 fv="$$f-$(APIVERSION)"; \
67 rm -f $(DESTDIR)$(bindir)/$$fv; \
71 ## We can't use configure to do the substitution here; we must do it
72 ## by hand. We use a funny notation here to avoid configure
73 ## substitutions in our text.
75 -e 's,[@]APIVERSION[@],$(APIVERSION),g' \
76 -e 's,[@]PACKAGE[@],$(PACKAGE),g' \
77 -e 's,[@]PACKAGE_BUGREPORT[@],$(PACKAGE_BUGREPORT),g' \
78 -e 's,[@]PACKAGE_URL[@],$(PACKAGE_URL),g' \
79 -e 's,[@]PATH_SEPARATOR[@],$(PATH_SEPARATOR),g' \
80 -e 's,[@]PERL[@],$(PERL),g' \
81 -e 's,[@]PERL_THREADS[@],$(PERL_THREADS),g' \
82 -e 's,[@]SHELL[@],$(SHELL),g' \
83 -e 's,[@]am_AUTOCONF[@],$(am_AUTOCONF),g' \
84 -e 's,[@]am_AUTOM4TE[@],$(am_AUTOM4TE),g' \
85 -e 's,[@]VERSION[@],$(VERSION),g' \
86 -e 's,[@]configure_input[@],Generated from $@.in; do not edit by hand.,g' \
87 -e 's,[@]datadir[@],$(datadir),g'
89 ## These files depend on Makefile so they are rebuilt if $(VERSION),
90 ## $(datadir) or other do_subst'ituted variables change.
91 ## Use chmod a-w to prevent people from editing the wrong file by accident.
94 automake aclocal: Makefile
95 $(AM_V_GEN)rm -f $@ $@.tmp
96 $(AM_V_at)$(do_subst) $(srcdir)/$@.in >$@.tmp
97 $(AM_V_at)chmod +x $@.tmp
98 $(AM_V_at)chmod a-w $@.tmp
99 $(AM_V_at)mv -f $@.tmp $@
101 ## The master location for INSTALL is lib/INSTALL.
102 ## This is where `make fetch' will install new versions.
103 ## Make sure we also update this copy.
105 $(AM_V_GEN)cp $(srcdir)/lib/INSTALL $@
107 # Run the testsuite with the installed aclocal and automake.
109 am_running_installcheck=yes $(MAKE) $(AM_MAKEFLAGS) check
111 ## recheck: convenience proxy target for the test suites.
115 for f in x $$MAKEFLAGS; do \
118 *k*) failcom='fail=yes';; \
121 for subdir in $(TEST_SUBDIRS); do \
122 ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@) \
127 ################################################################
129 ## Everything past here is useful to the maintainer, but probably not
133 # Ensure tests are world-executable
135 $(am__cd) $(distdir)/tests && chmod a+rx *.test
138 # Perl coverage statistics.
139 PERL_COVERAGE_DB = $(abs_top_builddir)/cover_db
140 PERL_COVERAGE_FLAGS = -MDevel::Cover=-db,$(PERL_COVERAGE_DB),-silent,on,-summary,off
143 check-coverage-run recheck-coverage-run: all
144 $(mkinstalldirs) $(PERL_COVERAGE_DB)
145 PERL5OPT="$$PERL5OPT $(PERL_COVERAGE_FLAGS)"; export PERL5OPT; \
146 WANT_NO_THREADS=yes; export WANT_NO_THREADS; unset AUTOMAKE_JOBS; \
147 $(MAKE) $(AM_MAKEFLAGS) `echo $@ | sed 's/-coverage-run//'`
149 check-coverage-report:
150 @if test ! -d "$(PERL_COVERAGE_DB)"; then \
151 echo "No coverage database found in \`$(PERL_COVERAGE_DB)'." >&2; \
152 echo "Please run \`make check-coverage' first" >&2; \
155 $(PERL_COVER) $(PERL_COVER_FLAGS) "$(PERL_COVERAGE_DB)"
157 # We don't use direct dependencies here because we'd like to be able
158 # to invoke the report even after interrupted check-coverage.
159 check-coverage: check-coverage-run
160 $(MAKE) $(AM_MAKEFLAGS) check-coverage-report
162 recheck-coverage: recheck-coverage-run
163 $(MAKE) $(AM_MAKEFLAGS) check-coverage-report
166 rm -rf "$(PERL_COVERAGE_DB)"
167 clean-local: clean-coverage
169 .PHONY: check-coverage recheck-coverage check-coverage-run \
170 recheck-coverage-run check-coverage-report clean-coverage
172 # Some simple checks, and then ordinary check. These are only really
173 # guaranteed to work on my machine.
174 syntax_check_rules = \
176 sc_diff_automake_in_automake \
177 sc_diff_aclocal_in_automake \
179 sc_no_brace_variable_expansions \
181 sc_no_for_variable_in_macro \
183 sc_pre_normal_post_install_uninstall \
185 sc_perl_no_split_regex_space \
186 sc_cd_in_backquotes \
188 sc_perl_at_uscore_in_scalar_context \
189 sc_perl_local_no_parens \
191 sc_AMDEP_TRUE_in_automake_in \
192 sc_tests_make_without_am_makeflags \
193 sc_tests_obsolete_variables \
194 sc_tests_plain_make \
195 sc_tests_plain_autoconf \
196 sc_tests_plain_autoupdate \
197 sc_tests_plain_automake \
198 sc_tests_plain_autom4te \
199 sc_tests_plain_autoheader \
200 sc_tests_plain_autoreconf \
201 sc_tests_here_document_format \
202 sc_tests_Exit_not_exit \
203 sc_tests_automake_fails \
204 sc_tests_plain_aclocal \
205 sc_tests_plain_perl \
206 sc_tests_required_after_defs \
208 sc_tests_overriding_macros_on_cmdline \
209 sc_tests_plain_sleep \
210 sc_tests_plain_egrep_fgrep \
211 sc_tests_PATH_SEPARATOR \
212 sc_tests_logs_duplicate_prefixes \
213 sc_tests_makefile_variable_order \
216 sc_unquoted_DESTDIR \
220 .PHONY: $(syntax_check_rules)
221 $(syntax_check_rules): automake aclocal
223 ## Check that the list of tests given in the Makefile is equal to the
224 ## list of all test scripts in the Automake testsuite.
225 .PHONY: maintainer-check-list-of-tests
226 maintainer-check-list-of-tests:
228 for f in x $$MAKEFLAGS; do \
231 *k*) failcom='fail=yes';; \
234 for subdir in $(TEST_SUBDIRS); do \
235 (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@) || eval $$failcom; \
239 maintainer-check: $(syntax_check_rules) maintainer-check-list-of-tests
241 ## Look for test whose names can cause spurious failures when used as
242 ## first argument to AC_INIT (chiefly because they might contain an
243 ## m4/m4sugar builtin or macro name).
293 @m4_builtin_rx=`echo $(m4_builtins) | sed 's/ /|/g'`; \
294 m4_macro_rx="\\<($$m4_builtin_rx)\\>|\\<_?(A[CUMHS]|m4)_"; \
295 if ls tests/*.test | LC_ALL=C grep -E "$$m4_macro_rx"; then \
296 echo "the names of the tests above can be problematic" 1>&2; \
297 echo "Avoid test names that contain names of m4 macros" 1>&2; \
301 ## These check avoids accidental configure substitutions in the source.
302 ## There are exactly 9 lines that should be modified from automake.in to
303 ## automake, and 10 lines that should be modified from aclocal.in to
304 ## aclocal; these wors out to 32 and 34 lines of diffs, respectively.
305 sc_diff_automake_in_automake:
306 @if test `diff $(srcdir)/automake.in automake | wc -l` -ne 32; then \
307 echo "found too many diffs between automake.in and automake" 1>&2; \
308 diff -c $(srcdir)/automake.in automake; \
311 sc_diff_aclocal_in_aclocal:
312 @if test `diff $(srcdir)/aclocal.in aclocal | wc -l` -ne 34; then \
313 echo "found too many diffs between aclocal.in and aclocal" 1>&2; \
314 diff -c $(srcdir)/aclocal.in aclocal; \
318 ## Syntax check with default Perl (on my machine, Perl 5).
320 perllibdir="./lib$(PATH_SEPARATOR)$(srcdir)/lib" $(PERL) -c -w automake
321 perllibdir="./lib$(PATH_SEPARATOR)$(srcdir)/lib" $(PERL) -c -w aclocal
323 ## expect no instances of '${...}'. However, $${...} is ok, since that
324 ## is a shell construct, not a Makefile construct.
325 sc_no_brace_variable_expansions:
326 @if grep -F '$${' $(srcdir)/lib/am/[a-z]*.am | \
327 grep -F -v '$$$$'; then \
328 echo "Found too many uses of '\$${' in the lines above." 1>&2; \
332 ## Make sure `rm' is called with `-f'.
334 @if grep -v '^#' $(srcdir)/lib/am/[a-z]*.am $(srcdir)/tests/*.test | \
335 grep -E '\<rm ([^-]|\-[^f ]*\>)'; then \
336 echo "Suspicious 'rm' invocation." 1>&2; \
340 ## Never use something like `for file in $(FILES)', this doesn't work
341 ## if FILES is empty or if it contains shell meta characters (e.g. $ is
342 ## commonly used in Java filenames).
343 sc_no_for_variable_in_macro:
344 @if grep 'for .* in \$$(' $(srcdir)/lib/am/[a-z]*.am; then \
345 echo 'Use "list=$$(mumble); for var in $$$$list".' 1>&2 ; \
349 ## Make sure all invocations of mkinstalldirs are correct.
351 @if grep -n 'mkinstalldirs' $(srcdir)/lib/am/[a-z]*.am | \
352 grep -F -v '$$(mkinstalldirs)'; then \
353 echo "Found incorrect use of mkinstalldirs in the lines above" 1>&2; \
357 ## Make sure all calls to PRE/NORMAL/POST_INSTALL/UNINSTALL
358 sc_pre_normal_post_install_uninstall:
359 @if grep -E -n '\((PRE|NORMAL|POST)_(|UN)INSTALL\)' \
360 $(srcdir)/lib/am/[a-z]*.am | \
361 grep -v ':##' | grep -v ': @\$$('; then \
362 echo "Found incorrect use of PRE/NORMAL/POST_INSTALL/UNINSTALL in the lines above" 1>&2; \
366 ## We never want to use "undef", only "delete", but for $/.
368 @if grep -n -w 'undef ' $(srcdir)/automake.in | \
369 grep -F -v 'undef $$/'; then \
370 echo "Found undef in automake.in; use delete instead" 1>&2; \
374 ## We never want split (/ /,...), only split (' ', ...).
375 sc_perl_no_split_regex_space:
376 @if grep -n 'split (/ /' $(srcdir)/automake.in; then \
377 echo "Found bad split in the lines above." 1>&2; \
381 ## Look for cd within backquotes
383 @if grep -n '^[^#]*` *cd ' $(srcdir)/automake.in \
384 $(srcdir)/lib/am/*.am; then \
385 echo "Consider using \$$(am__cd) in the lines above." 1>&2; \
389 ## Look for cd to a relative directory (may be influenced by CDPATH).
390 ## Skip some known directories that are OK.
392 @if grep -n '^[^#]*cd ' $(srcdir)/automake.in \
393 $(srcdir)/lib/am/*.am | \
394 grep -v 'echo.*cd ' | \
395 grep -v 'am__cd =' | \
396 grep -v '^[^#]*cd [./]' | \
397 grep -v '^[^#]*cd \$$(top_builddir)' | \
398 grep -v '^[^#]*cd "\$$\$$am__cwd' | \
399 grep -v '^[^#]*cd \$$(abs' | \
400 grep -v '^[^#]*cd "\$$(DESTDIR)'; then \
401 echo "Consider using \$$(am__cd) in the lines above." 1>&2; \
405 ## Using @_ in a scalar context is most probably a programming error.
406 sc_perl_at_uscore_in_scalar_context:
407 @if grep -Hn '[^@_A-Za-z0-9][_A-Za-z0-9]*[^) ] *= *@_' $(srcdir)/automake.in; then \
408 echo "Using @_ in a scalar context in the lines above." 1>&2; \
412 ## Forbid using parens with `local' to ease counting.
413 sc_perl_local_no_parens:
414 @if grep '^[ \t]*local *(' $(srcdir)/automake.in; then \
415 echo "Don't use \`local' with parens: use several \`local' above." >&2; \
419 ## Allow only few variables to be localized in Automake.
421 @if egrep -v '^[ \t]*local \$$[_~]( *=|;)' $(srcdir)/automake.in | \
422 grep '^[ \t]*local [^*]'; then \
423 echo "Please avoid \`local'." 1>&2; \
427 ## Don't let AMDEP_TRUE substitution appear in automake.in.
428 sc_AMDEP_TRUE_in_automake_in:
429 @if grep '@AMDEP''_TRUE@' $(srcdir)/automake.in; then \
430 echo "Don't put AMDEP_TRUE substitution in automake.in" 1>&2; \
434 ## Tests should never call make directly.
435 sc_tests_make_without_am_makeflags:
436 @if grep '^[^#].*(MAKE) ' $(srcdir)/lib/am/*.am $(srcdir)/automake.in |\
437 grep -v 'AM_MAKEFLAGS'; then \
438 echo 'Use $$(MAKE) $$(AM_MAKEFLAGS).' 1>&2; \
442 ## Look out for some obsolete variables.
443 sc_tests_obsolete_variables:
447 test_prefer_config_shell \
452 for v in $$vars; do \
453 if grep -E "\b$$v\b" \
454 $(srcdir)/tests/*.test \
455 $(srcdir)/tests/*.tap \
456 $(srcdir)/tests/*.sh \
457 $(srcdir)/tests/defs \
458 $(srcdir)/tests/defs-static.in \
463 if test -n "$$seen"; then \
464 for v in $$seen; do \
465 echo "Variable '$$v' is obsolete, use 'am_$$v' instead." 1>&2; \
470 ## Tests should never call make directly.
472 @if grep -v '^#' $(srcdir)/tests/*.test | $(EGREP) ':[ ]*make( |$$)'; then \
473 echo 'Do not run "make" in the above tests. Use "$$MAKE" instead.' 1>&2; \
477 ## Tests should never call autoconf directly.
478 sc_tests_plain_autoconf:
479 @if grep -v '^#' $(srcdir)/tests/*.test | grep ':[ ]*autoconf\>'; then \
480 echo 'Do not run "autoconf" in the above tests. Use "$$AUTOCONF" instead.' 1>&2; \
484 ## Tests should never call autoupdate directly.
485 sc_tests_plain_autoupdate:
486 @if grep -v '^#' $(srcdir)/tests/*.test | grep ':[ ]*autoupdate\>'; then \
487 echo 'Do not run "autoupdate" in the above tests. Use "$$AUTOUPDATE" instead.' 1>&2; \
491 ## Tests should never call automake directly.
492 sc_tests_plain_automake:
493 @if grep -v '^#' $(srcdir)/tests/*.test | grep -E ':[ ]*automake\>([^:]|$$)'; then \
494 echo 'Do not run "automake" in the above tests. Use "$$AUTOMAKE" instead.' 1>&2; \
498 ## Tests should never call autoheader directly.
499 sc_tests_plain_autoheader:
500 @if grep -v '^#' $(srcdir)/tests/*.test | grep ':[ ]*autoheader\>'; then \
501 echo 'Do not run "automake" in the above tests. Use "$$AUTOHEADER" instead.' 1>&2; \
505 ## Tests should never call autoreconf directly.
506 sc_tests_plain_autoreconf:
507 @if grep -v '^#' $(srcdir)/tests/*.test | grep ':[ ]*autoreconf\>'; then \
508 echo 'Do not run "automake" in the above tests. Use "$$AUTORECONF" instead.' 1>&2; \
512 ## Tests should never call autom4te directly.
513 sc_tests_plain_autom4te:
514 @if grep -v '^#' $(srcdir)/tests/*.test | grep ':[ ]*autom4te\>'; then \
515 echo 'Do not run "automake" in the above tests. Use "$$AUTOM4TE" instead.' 1>&2; \
519 ## Tests should only use END and EOF for here documents
520 ## (so that the next test is effective).
521 sc_tests_here_document_format:
522 @if grep '<<' $(srcdir)/tests/*.test | grep -v 'END' | grep -v 'EOF'; then \
523 echo 'Use here documents with "END" and "EOF" only, for greppability.' 1>&2; \
527 ## Tests should never call exit directly, but use Exit.
528 ## This is so that the exit status is transported correctly across the 0 trap.
529 ## Ignore comments, testsuite self tests, and one perl line in ext2.test.
530 sc_tests_Exit_not_exit:
531 @found=false; for file in $(srcdir)/tests/*.test; do \
532 case $$file in */self-check-*.test) continue;; esac; \
533 res=`sed -n -e '/^#/d; /^\$$PERL/d' -e '/<<.*END/,/^END/b' \
534 -e '/<<.*EOF/,/^EOF/b' -e '/exit [$$0-9]/p' $$file`; \
535 if test -n "$$res"; then \
536 echo "$$file:$$res"; \
541 echo 'Do not call plain "exit", use "Exit" instead, in above tests.' 1>&2; \
545 ## Use AUTOMAKE_fails when appropriate
546 sc_tests_automake_fails:
547 @if grep -v '^#' $(srcdir)/tests/*.test | grep '\$$AUTOMAKE.*&&.*[eE]xit'; then \
548 echo 'Use AUTOMAKE_fails + grep to catch automake failures in the above tests.' 1>&2; \
552 ## Tests should never call aclocal directly.
553 sc_tests_plain_aclocal:
554 @if grep -v '^#' $(srcdir)/tests/*.test | grep ':[ ]*aclocal\>'; then \
555 echo 'Do not run "aclocal" in the above tests. Use "$$ACLOCAL" instead.' 1>&2; \
559 ## Tests should never call perl directly.
561 @if grep -v '^#' $(srcdir)/tests/*.test | grep ':[ ]*perl\>'; then \
562 echo 'Do not run "perl" in the above tests. Use "$$PERL" instead.' 1>&2; \
566 ## Setting `required' after sourcing `./defs' is a bug.
567 sc_tests_required_after_defs:
568 @for file in $(srcdir)/tests/*.test; do \
569 if out=`sed -n '/defs/,$${/required=/p;}' $$file`; test -n "$$out"; then \
570 echo 'Do not set "required" after sourcing "defs" in '"$$file: $$out" 1>&2; \
575 ## TAP-based test scripts should not forget to declare a TAP plan. In
576 ## case it is not known in advance how many tests will be run, a "lazy"
577 ## plan can be used; but its use should be deliberate, explicitly declared
578 ## with a "plan_ later" call, rather than the result of an oversight.
579 ## This check helps to ensure this is indeed the case.
581 @with_plan=`grep -l '^ *plan_ ' $(srcdir)/tests/*.tap`; \
582 with_plan=`echo $$with_plan`; \
584 for t in $(srcdir)/tests/*.tap; do \
585 case " $$with_plan " in *" $$t "*) continue;; esac; \
586 ## It's ok for an *auto-generated* test sourcing an hand-written one not
587 ## to declare a TAP plan: that will be done by the sourced test.
590 t2=`echo $$t | sed -e 's|.*/||' -e 's/-w\.tap$$/.tap/'` \
591 && grep -E "^ *\\. *[^ ]*/$$t2\\b" $$t >/dev/null \
592 && continue || : ;; \
594 ok=false; echo $$t; \
597 echo 'The tests above do not declare a TAP plan.' 1>&2; \
601 ## Overriding a Makefile macro on the command line is not portable when
602 ## recursive targets are used. Better use an envvar. SHELL is an
603 ## exception, POSIX says it can't come from the environment. V, DESTDIR,
604 ## DISTCHECK_CONFIGURE_FLAGS and DISABLE_HARD_ERRORS are exceptions, too,
605 ## as package authors are urged not to initialize them anywhere.
606 sc_tests_overriding_macros_on_cmdline:
607 @if grep -E '\$$MAKE .*(SHELL=.*=|=.*SHELL=)' $(srcdir)/tests/*.test; then \
608 echo 'Rewrite "$$MAKE foo=bar SHELL=$$SHELL" as "foo=bar $$MAKE -e SHELL=$$SHELL"' 1>&2; \
609 echo ' in the above lines, it is more portable.' 1>&2; \
612 ## Also try to account for usages like "$MAKE || st=$?".
613 @if sed -e 's/ || .*//' -e 's/ && .*//' \
614 -e 's/ DESTDIR=[^ ]*/ /' -e 's/ SHELL=[^ ]*/ /' \
615 -e 's/ V=[^ ]*/ /' -e 's/ DISABLE_HARD_ERRORS=[^ ]*/ /' \
616 ## DISTCHECK_CONFIGURE_FLAGS is allowed to contain whitespace in its
617 ## definition, so the more complex substitutions below.
618 -e "s/ DISTCHECK_CONFIGURE_FLAGS='[^']*'/ /" \
619 -e 's/ DISTCHECK_CONFIGURE_FLAGS="[^"]*"/ /' \
620 -e 's/ DISTCHECK_CONFIGURE_FLAGS=[^ ]/ /' \
621 $(srcdir)/tests/*.test | grep '\$$MAKE .*='; then \
622 echo 'Rewrite "$$MAKE foo=bar" as "foo=bar $$MAKE -e" in the above lines,' 1>&2; \
623 echo 'it is more portable.' 1>&2; \
626 @if grep 'SHELL=.*\$$MAKE' $(srcdir)/tests/*.test; then \
627 echo '$$MAKE ignores the SHELL envvar, use "$$MAKE SHELL=$$SHELL" in' 1>&2; \
628 echo 'the above lines.' 1>&2; \
632 ## Never use `sleep 1' to create files with different timestamps.
633 ## Use `$sleep' instead. Some filesystems (e.g., Windows') have only
634 ## a 2sec resolution.
635 sc_tests_plain_sleep:
636 @if grep -E '\bsleep +[12345]\b' $(srcdir)/tests/*.test; then \
637 echo 'Do not use "sleep x" in the above tests. Use "$$sleep" instead.' 1>&2; \
641 ## fgrep and egrep are not required by POSIX.
642 sc_tests_plain_egrep_fgrep:
643 @if grep -E '\b[ef]grep\b' $(srcdir)/tests/*.test ; then \
644 echo 'Do not use egrep or fgrep in test cases. Use $$FGREP or $$EGREP.' 1>&2; \
647 @if grep -E '\b[ef]grep\b' $(srcdir)/lib/am/*.am $(srcdir)/m4/*.m4; then \
648 echo 'Do not use egrep or fgrep in the above files, they are not portable.' 1>&2; \
652 ## Rule to ensure that the testsuite has been run before. We don't depend on `check'
653 ## here, because that would be very wasteful in the common case. We could run
654 ## `make check RECHECK_LOGS=' and avoid toplevel races with AM_RECURSIVE_TARGETS.
655 ## Suggest keeping test directories around for greppability of the Makefile.in files.
656 sc_ensure_testsuite_has_run:
657 @if test ! -f tests/test-suite.log; then \
658 echo "Run \`env keep_testdirs=yes make check' before \`maintainer-check'" >&2; \
661 .PHONY: sc_ensure_testsuite_has_run
663 ## Ensure our warning and error messages do not contain duplicate 'warning:' prefixes.
664 ## This test actually depends on the testsuite having been run before.
665 sc_tests_logs_duplicate_prefixes: sc_ensure_testsuite_has_run
666 @if grep -E '(warning|error):.*(warning|error):' tests/*.log; then \
667 echo 'Duplicate warning/error message prefixes seen in above tests.' >&2; \
671 ## Ensure variables are listed before rules in Makefile.in files we generate.
672 sc_tests_makefile_variable_order: sc_ensure_testsuite_has_run
673 @for file in `find tests -name Makefile.in -print`; do \
676 -e '/\\\\$$/{' -e N -e 'b x' -e '}' \
679 ## Allow @ so we match conditionals.
680 -e '/^ *[a-zA-Z_@]\{1,\} *=/p' $$file`; \
681 if test -n "$$latevars"; then \
682 echo 'Ensure variables are expanded before rules' >&2; \
683 echo "Variables are expanded too late in $$file:" >&2; \
684 echo "$$latevars" | sed 's/^/ /' >&2; \
689 ## Using `:' as a PATH separator is not portable.
690 sc_tests_PATH_SEPARATOR:
691 @if grep -E '\bPATH=.*:.*' $(srcdir)/tests/*.test ; then \
692 echo "Use \`\$$PATH_SEPARATOR', not \`:', in PATH definitions above." 1>&2; \
697 @if grep 'mkdir_p' $(srcdir)/automake.in \
698 $(srcdir)/lib/am/*.am $(srcdir)/tests/*.test; then \
699 echo 'Do not use mkdir_p in the above files, use MKDIR_P.' 1>&2; \
703 ## Try to make sure all @...@ substitutions are covered by our
704 ## substitution rule.
706 @if test `grep -E '^[^#]*@[A-Za-z_0-9]+@' aclocal | wc -l` -ne 0; then \
707 echo "Unresolved @...@ substitution in aclocal" 1>&2; \
710 @if test `grep -E '^[^#]*@[A-Za-z_0-9]+@' automake | wc -l` -ne 0; then \
711 echo "Unresolved @...@ substitution in automake" 1>&2; \
716 @if grep -E "[^\'\"]\\\$$\(DESTDIR" $(srcdir)/lib/am/*.am; then \
717 echo 'Suspicious unquoted DESTDIR uses.' 1>&2 ; \
722 @if grep ' ' $(srcdir)/doc/automake.texi; then \
723 echo 'Do not use tabs in the manual.' 1>&2; \
728 @if grep -E '([^@]|^)@([ ][^@]|$$)' $(srcdir)/doc/automake.texi; \
730 echo 'Unescaped @.' 1>&2; \
735 git-dist: maintainer-check
736 ## Make sure the NEWS file is up-to-date.
737 @if sed 1q $(srcdir)/NEWS | grep -e "$(VERSION)" > /dev/null; then :; else \
738 echo "NEWS not updated; not releasing" 1>&2; \
741 ## Build the distribution. We expect the developer to have already run
742 ## "make check" and "make distcheck" on his own (as required in the
743 ## HACKING file, section "Release procedure").
744 $(MAKE) $(AM_MAKEFLAGS) dist
745 ## Finally, if anything was successful, commit the last changes and tag
746 ## the release in the repository. We don't use RCS keywords so it's OK
747 ## to distribute the files before they were committed.
748 $(am__cd) $(srcdir) && git commit -a -s && \
749 git tag -s "v$(VERSION)" -m "Release $(VERSION)"
751 git-release: git-dist
753 *[a-z]) dest=alpha;; \
756 $(srcdir)/lib/gnupload $(GNUPLOADFLAGS) \
757 --to $$dest.gnu.org:automake $(DIST_ARCHIVES)
760 thisver="v$(VERSION)"; \
761 if test -z "$$OLDVERSION"; then \
762 prevno=`echo "$(VERSION)" - 0.01 | bc | sed 's/^\./0./'`; \
763 else prevno="$$OLDVERSION"; fi; \
765 git diff $$prevver..$$thisver $(PACKAGE) \
766 > $(PACKAGE)-$$prevno-$(VERSION).diff
768 ## Check our path lengths.
770 ($(am__cd) $(distdir) && \
771 ## FIXME there's got to be a better way! pathchk should take the list
772 ## of files on stdin, at least.
773 find . -print | xargs pathchk -p); \
775 find $(distdir) -type d '!' -perm -200 -exec chmod u+w {} ';'; \
779 ## Visually comparing differences between the Makefile.in files in
780 ## automake's own build system as generated in two different branches
781 ## might help to catch bugs and blunders. This has already happened a
782 ## few times in the past, when we used to version-control Makefile.in.
785 NEW_COMMIT=$${NEW_COMMIT-"HEAD"}; \
786 OLD_COMMIT=$${OLD_COMMIT-"HEAD~1"}; \
787 am_gitdir='$(abs_top_srcdir)/.git'; \
788 get_autofiles_from_rev () \
791 && echo "$@: will get files from revision $$rev" \
792 && git clone -q --depth 1 "$$am_gitdir" tmp \
794 && git checkout -q "$$rev" \
795 && echo "$@: bootstrapping $$rev" \
796 && $(SHELL) ./bootstrap \
797 && echo "$@: copying files from $$rev" \
798 && makefile_ins=`find . -name Makefile.in` \
799 && (tar cf - configure aclocal.m4 $$makefile_ins) | \
800 (cd .. && cd "$$dir" && tar xf -) \
805 ## Before proceeding, ensure the specified revisions truly exist.
806 && git --git-dir="$$am_gitdir" describe $$OLD_COMMIT >/dev/null \
807 && git --git-dir="$$am_gitdir" describe $$NEW_COMMIT >/dev/null \
812 && get_autofiles_from_rev $$OLD_COMMIT old \
813 && get_autofiles_from_rev $$NEW_COMMIT new \
815 ## With lots of eye candy; we like our developers pampered and spoiled :-)
816 compare-autodiffs: autodiffs
818 : $${COLORDIFF=colordiff} $${DIFF=diff}; \
820 if test ! -d "$$dir"; then \
821 echo "$@: $$dir: Not a directory" >&2; \
824 mydiff=false mypager=false; \
826 if ($$COLORDIFF -r . .) </dev/null >/dev/null 2>&1; then \
827 mydiff=$$COLORDIFF; \
835 if test "$$mydiff" = false; then \
836 if ($$DIFF -r -u . .); then \
839 echo "$@: no good-enough diff program specified" >&2; \
843 st=0; $$mydiff -r -u $$dir/old $$dir/new | $$mypager || st=$$?; \
846 .PHONY: autodiffs compare-autodiffs
848 ## Program to use to fetch files.
850 WGET_SV_CVS = $(WGET) http://savannah.gnu.org/cgi-bin/viewcvs/~checkout~/
851 WGET_SV_GIT_CF = $(WGET) 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;hb=HEAD;f='
852 WGET_SV_GIT_AC = $(WGET) 'http://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=blob_plain;hb=HEAD;f='
853 WGET_SV_GIT_GL = $(WGET) 'http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob_plain;hb=HEAD;f='
854 WGET_GCC = $(WGET) 'http://gcc.gnu.org/viewcvs/*checkout*/trunk/'
856 ## Files that we fetch and which we compare against.
857 ## FIXME should be a lot more here
866 ## Fetch the latest versions of files we care about.
868 rm -rf Fetchdir > /dev/null 2>&1
870 ## If a get fails then that is a problem.
871 ($(am__cd) Fetchdir && \
872 $(WGET_SV_GIT_CF)config.guess -O config.guess && \
873 $(WGET_SV_GIT_CF)config.sub -O config.sub && \
874 $(WGET_SV_CVS)texinfo/texinfo/doc/texinfo.tex -O texinfo.tex && \
875 $(WGET_SV_GIT_GL)doc/INSTALL -O INSTALL && \
876 $(WGET_SV_GIT_GL)build-aux/gitlog-to-changelog -O gitlog-to-changelog && \
877 $(WGET_GCC)config-ml.in -O config-ml.in && \
878 $(WGET_GCC)symlink-tree -O symlink-tree)
879 ## Don't exit after test because we want to give as many errors as
881 @stat=0; for file in $(FETCHFILES); do \
882 if diff -u $(srcdir)/lib/$$file Fetchdir/$$file \
883 >>Fetchdir/update.patch 2>/dev/null; then :; \
886 echo "Updating $(srcdir)/lib/$$file ..."; \
887 cp Fetchdir/$$file $(srcdir)/lib/$$file; \
891 echo "See Fetchdir/update.patch for a log of the changes."; \
894 ## Generate release statistics, for the table in automake.texi.
895 ## This has to be run in an up to date build tree, but there must
896 ## be no temp files nor unused other files lying around!
898 @am=`wc -l < automake` && \
899 acl=`wc -l < aclocal` && \
900 pmfiles="lib/Automake/*.pm" && \
901 if test . != '$(srcdir)'; then pmfiles="$$pmfiles $(srcdir)/lib/Automake/*.pm"; \
903 pm=`cat $$pmfiles | wc -l` && \
904 dot_am_files=`ls -1 $(srcdir)/lib/am/*.am | grep -v Makefile.am` && \
905 amf=`echo "$$dot_am_files" | wc -l` && \
906 aml=`cat $$dot_am_files | wc -l` && \
907 m4f=`ls -1 $(srcdir)/m4/*.m4 | wc -l` && \
908 m4l=`cat $(srcdir)/m4/*.m4 | wc -l` && \
909 doc_text=`$(am__cd) doc && LC_ALL=C pstops 0 automake.ps unused.ps 2>&1` && \
910 echo "$$doc_text" && \
911 rm -f doc/unused.ps && \
912 doc=`echo "$$doc_text" | sed -n 's/.*Wrote \([1-9][0-9]*\) pages.*/\1/p'` && \
913 tests="tests/*.test"; \
914 if test . != '$(srcdir)'; then tests="$$tests $(srcdir)/tests/*.test"; \
916 t=`ls -1 $$tests | wc -l` && \
917 tgen=`grep 'GENERATED AUTOMATICALLY' $$tests | wc -l` && \
918 today=`date +%Y-%m-%d` && \
919 echo "add this to the table in doc/automake.texi after verification:" && \
920 printf '@item %s @tab %-6s @tab %4d @tab %4d @tab %4d @tab %4d %-4s @tab %4d %-4s @tab %3d @tab %d %-4s\n' \
921 $$today $(VERSION) $$am $$acl $$pm $$aml "($$amf)" $$m4l "($$m4f)" $$doc $$t "($$tgen)"
922 .PHONY: release-stats