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 ## Tests should never call make directly.
469 sc_tests_make_without_am_makeflags:
470 @if grep '^[^#].*(MAKE) ' $(srcdir)/lib/am/*.am $(srcdir)/automake.in |\
471 grep -v 'AM_MAKEFLAGS'; then \
472 echo 'Use $$(MAKE) $$(AM_MAKEFLAGS).' 1>&2; \
476 ## Look out for some obsolete variables.
477 sc_tests_obsolete_variables:
481 test_prefer_config_shell \
486 for v in $$vars; do \
487 if grep -E "\b$$v\b" \
488 $(xtests) $(srcdir)/tests/defs \
489 $(srcdir)/tests/defs-static.in \
494 if test -n "$$seen"; then \
495 for v in $$seen; do \
496 echo "Variable '$$v' is obsolete, use 'am_$$v' instead." 1>&2; \
501 ## Tests should never call make directly.
503 @if grep -v '^#' $(xtests) | $(EGREP) ':[ ]*make( |$$)'; then \
504 echo 'Do not run "make" in the above tests. Use "$$MAKE" instead.' 1>&2; \
508 ## Tests should never call autoconf directly.
509 sc_tests_plain_autoconf:
510 @if grep -v '^#' $(xtests) | grep ':[ ]*autoconf\>'; then \
511 echo 'Do not run "autoconf" in the above tests. Use "$$AUTOCONF" instead.' 1>&2; \
515 ## Tests should never call autoupdate directly.
516 sc_tests_plain_autoupdate:
517 @if grep -v '^#' $(xtests) | grep ':[ ]*autoupdate\>'; then \
518 echo 'Do not run "autoupdate" in the above tests. Use "$$AUTOUPDATE" instead.' 1>&2; \
522 ## Tests should never call automake directly.
523 sc_tests_plain_automake:
524 @if grep -v '^#' $(xtests) | grep -E ':[ ]*automake\>([^:]|$$)'; then \
525 echo 'Do not run "automake" in the above tests. Use "$$AUTOMAKE" instead.' 1>&2; \
529 ## Tests should never call autoheader directly.
530 sc_tests_plain_autoheader:
531 @if grep -v '^#' $(xtests) | grep ':[ ]*autoheader\>'; then \
532 echo 'Do not run "autoheader" in the above tests. Use "$$AUTOHEADER" instead.' 1>&2; \
536 ## Tests should never call autoreconf directly.
537 sc_tests_plain_autoreconf:
538 @if grep -v '^#' $(xtests) | grep ':[ ]*autoreconf\>'; then \
539 echo 'Do not run "autoreconf" in the above tests. Use "$$AUTORECONF" instead.' 1>&2; \
543 ## Tests should never call autom4te directly.
544 sc_tests_plain_autom4te:
545 @if grep -v '^#' $(xtests) | grep ':[ ]*autom4te\>'; then \
546 echo 'Do not run "autom4te" in the above tests. Use "$$AUTOM4TE" instead.' 1>&2; \
550 ## Tests should only use END and EOF for here documents
551 ## (so that the next test is effective).
552 sc_tests_here_document_format:
553 @if grep '<<' $(xtests) | grep -v 'END' | grep -v 'EOF'; then \
554 echo 'Use here documents with "END" and "EOF" only, for greppability.' 1>&2; \
558 ## Tests should never call exit directly, but use Exit.
559 ## This is so that the exit status is transported correctly across the 0 trap.
560 ## Ignore comments, testsuite self tests, and one perl line in ext2.test.
561 sc_tests_Exit_not_exit:
562 @found=false; for file in $(xtests); do \
563 case $$file in */self-check-*) continue;; esac; \
564 res=`sed -n -e '/^#/d; /^\$$PERL/d' -e '/<<.*END/,/^END/b' \
565 -e '/<<.*EOF/,/^EOF/b' -e '/exit [$$0-9]/p' $$file`; \
566 if test -n "$$res"; then \
567 echo "$$file:$$res"; \
572 echo 'Do not call plain "exit", use "Exit" instead, in above tests.' 1>&2; \
576 ## Use AUTOMAKE_fails when appropriate
577 sc_tests_automake_fails:
578 @if grep -v '^#' $(xtests) | grep '\$$AUTOMAKE.*&&.*[eE]xit'; then \
579 echo 'Use AUTOMAKE_fails + grep to catch automake failures in the above tests.' 1>&2; \
583 ## Tests should never call aclocal directly.
584 sc_tests_plain_aclocal:
585 @if grep -v '^#' $(xtests) | grep ':[ ]*aclocal\>'; then \
586 echo 'Do not run "aclocal" in the above tests. Use "$$ACLOCAL" instead.' 1>&2; \
590 ## Tests should never call perl directly.
592 @if grep -v '^#' $(xtests) | grep ':[ ]*perl\>'; then \
593 echo 'Do not run "perl" in the above tests. Use "$$PERL" instead.' 1>&2; \
597 ## Setting `required' after sourcing `./defs' is a bug.
598 sc_tests_required_after_defs:
599 @for file in $(xtests); do \
600 if out=`sed -n '/defs/,$${/required=/p;}' $$file`; test -n "$$out"; then \
601 echo 'Do not set "required" after sourcing "defs" in '"$$file: $$out" 1>&2; \
606 ## TAP-based test scripts should not forget to declare a TAP plan. In
607 ## case it is not known in advance how many tests will be run, a "lazy"
608 ## plan can be used; but its use should be deliberate, explicitly declared
609 ## with a "plan_ later" call, rather than the result of an oversight.
610 ## This check helps to ensure this is indeed the case.
612 @with_plan=`grep -l '^ *plan_ ' $(srcdir)/tests/*.tap`; \
613 with_plan=`echo $$with_plan`; \
615 for t in $(srcdir)/tests/*.tap; do \
616 case " $$with_plan " in *" $$t "*) continue;; esac; \
617 ## It's ok for an *auto-generated* test sourcing an hand-written one not
618 ## to declare a TAP plan: that will be done by the sourced test.
621 t2=`echo $$t | sed -e 's|.*/||' -e 's/-w\.tap$$/.tap/'` \
622 && grep -E "^ *\\. *[^ ]*/$$t2\\b" $$t >/dev/null \
623 && continue || : ;; \
625 ok=false; echo $$t; \
628 echo 'The tests above do not declare a TAP plan.' 1>&2; \
632 ## Overriding a Makefile macro on the command line is not portable when
633 ## recursive targets are used. Better use an envvar. SHELL is an
634 ## exception, POSIX says it can't come from the environment. V, DESTDIR,
635 ## DISTCHECK_CONFIGURE_FLAGS and DISABLE_HARD_ERRORS are exceptions, too,
636 ## as package authors are urged not to initialize them anywhere.
637 sc_tests_overriding_macros_on_cmdline:
638 @if grep -E '\$$MAKE .*(SHELL=.*=|=.*SHELL=)' $(xtests); then \
639 echo 'Rewrite "$$MAKE foo=bar SHELL=$$SHELL" as "foo=bar $$MAKE -e SHELL=$$SHELL"' 1>&2; \
640 echo ' in the above lines, it is more portable.' 1>&2; \
643 ## Also try to account for usages like "$MAKE || st=$?".
644 @if sed -e 's/ || .*//' -e 's/ && .*//' \
645 -e 's/ DESTDIR=[^ ]*/ /' -e 's/ SHELL=[^ ]*/ /' \
646 -e 's/ V=[^ ]*/ /' -e 's/ DISABLE_HARD_ERRORS=[^ ]*/ /' \
647 ## DISTCHECK_CONFIGURE_FLAGS is allowed to contain whitespace in its
648 ## definition, so the more complex substitutions below.
649 -e "s/ DISTCHECK_CONFIGURE_FLAGS='[^']*'/ /" \
650 -e 's/ DISTCHECK_CONFIGURE_FLAGS="[^"]*"/ /' \
651 -e 's/ DISTCHECK_CONFIGURE_FLAGS=[^ ]/ /' \
652 $(xtests) | grep '\$$MAKE .*='; then \
653 echo 'Rewrite "$$MAKE foo=bar" as "foo=bar $$MAKE -e" in the above lines,' 1>&2; \
654 echo 'it is more portable.' 1>&2; \
657 @if grep 'SHELL=.*\$$MAKE' $(xtests); then \
658 echo '$$MAKE ignores the SHELL envvar, use "$$MAKE SHELL=$$SHELL" in' 1>&2; \
659 echo 'the above lines.' 1>&2; \
663 ## Never use `sleep 1' to create files with different timestamps.
664 ## Use `$sleep' instead. Some filesystems (e.g., Windows') have only
665 ## a 2sec resolution.
666 sc_tests_plain_sleep:
667 @if grep -E '\bsleep +[12345]\b' $(xtests); then \
668 echo 'Do not use "sleep x" in the above tests. Use "$$sleep" instead.' 1>&2; \
672 ## fgrep and egrep are not required by POSIX.
673 sc_tests_plain_egrep_fgrep:
674 @if grep -E '\b[ef]grep\b' $(xtests) ; then \
675 echo 'Do not use egrep or fgrep in test cases. Use $$FGREP or $$EGREP.' 1>&2; \
678 @if grep -E '\b[ef]grep\b' $(srcdir)/lib/am/*.am $(srcdir)/m4/*.m4; then \
679 echo 'Do not use egrep or fgrep in the above files, they are not portable.' 1>&2; \
683 ## Rule to ensure that the testsuite has been run before. We don't depend on `check'
684 ## here, because that would be very wasteful in the common case. We could run
685 ## `make check RECHECK_LOGS=' and avoid toplevel races with AM_RECURSIVE_TARGETS.
686 ## Suggest keeping test directories around for greppability of the Makefile.in files.
687 sc_ensure_testsuite_has_run:
688 @if test ! -f tests/test-suite.log; then \
689 echo "Run \`env keep_testdirs=yes make check' before \`maintainer-check'" >&2; \
692 .PHONY: sc_ensure_testsuite_has_run
694 ## Ensure our warning and error messages do not contain duplicate 'warning:' prefixes.
695 ## This test actually depends on the testsuite having been run before.
696 sc_tests_logs_duplicate_prefixes: sc_ensure_testsuite_has_run
697 @if grep -E '(warning|error):.*(warning|error):' tests/*.log; then \
698 echo 'Duplicate warning/error message prefixes seen in above tests.' >&2; \
702 ## Ensure variables are listed before rules in Makefile.in files we generate.
703 sc_tests_makefile_variable_order: sc_ensure_testsuite_has_run
704 @for file in `find tests -name Makefile.in -print`; do \
707 -e '/\\\\$$/{' -e N -e 'b x' -e '}' \
710 ## Allow @ so we match conditionals.
711 -e '/^ *[a-zA-Z_@]\{1,\} *=/p' $$file`; \
712 if test -n "$$latevars"; then \
713 echo 'Ensure variables are expanded before rules' >&2; \
714 echo "Variables are expanded too late in $$file:" >&2; \
715 echo "$$latevars" | sed 's/^/ /' >&2; \
720 ## Using `:' as a PATH separator is not portable.
721 sc_tests_PATH_SEPARATOR:
722 @if grep -E '\bPATH=.*:.*' $(xtests) ; then \
723 echo "Use \`\$$PATH_SEPARATOR', not \`:', in PATH definitions above." 1>&2; \
729 $(srcdir)/automake.in \
730 $(srcdir)/lib/am/*.am \
733 echo 'Do not use mkdir_p in the above files, use MKDIR_P.' 1>&2; \
737 ## Try to make sure all @...@ substitutions are covered by our
738 ## substitution rule.
740 @if test `grep -E '^[^#]*@[A-Za-z_0-9]+@' aclocal | wc -l` -ne 0; then \
741 echo "Unresolved @...@ substitution in aclocal" 1>&2; \
744 @if test `grep -E '^[^#]*@[A-Za-z_0-9]+@' automake | wc -l` -ne 0; then \
745 echo "Unresolved @...@ substitution in automake" 1>&2; \
750 @if grep -E "[^\'\"]\\\$$\(DESTDIR" $(srcdir)/lib/am/*.am; then \
751 echo 'Suspicious unquoted DESTDIR uses.' 1>&2 ; \
756 @if grep ' ' $(srcdir)/doc/automake.texi; then \
757 echo 'Do not use tabs in the manual.' 1>&2; \
762 @if grep -E '([^@]|^)@([ ][^@]|$$)' $(srcdir)/doc/automake.texi; \
764 echo 'Unescaped @.' 1>&2; \
769 git-dist: maintainer-check
770 ## Make sure the NEWS file is up-to-date.
771 @if sed 1q $(srcdir)/NEWS | grep -e "$(VERSION)" > /dev/null; then :; else \
772 echo "NEWS not updated; not releasing" 1>&2; \
775 ## Build the distribution. We expect the developer to have already run
776 ## "make check" and "make distcheck" on his own (as required in the
777 ## HACKING file, section "Release procedure").
778 $(MAKE) $(AM_MAKEFLAGS) dist
779 ## Finally, if anything was successful, commit the last changes and tag
780 ## the release in the repository. We don't use RCS keywords so it's OK
781 ## to distribute the files before they were committed.
782 $(am__cd) $(srcdir) && git commit -a -s && \
783 git tag -s "v$(VERSION)" -m "Release $(VERSION)"
785 git-release: git-dist
787 *[a-z]) dest=alpha;; \
790 $(srcdir)/lib/gnupload $(GNUPLOADFLAGS) \
791 --to $$dest.gnu.org:automake $(DIST_ARCHIVES)
793 ## Visually comparing differences between the Makefile.in files in
794 ## automake's own build system as generated in two different branches
795 ## might help to catch bugs and blunders. This has already happened a
796 ## few times in the past, when we used to version-control Makefile.in.
799 NEW_COMMIT=$${NEW_COMMIT-"HEAD"}; \
800 OLD_COMMIT=$${OLD_COMMIT-"HEAD~1"}; \
801 am_gitdir='$(abs_top_srcdir)/.git'; \
802 get_autofiles_from_rev () \
805 && echo "$@: will get files from revision $$rev" \
806 && git clone -q --depth 1 "$$am_gitdir" tmp \
808 && git checkout -q "$$rev" \
809 && echo "$@: bootstrapping $$rev" \
810 && $(SHELL) ./bootstrap \
811 && echo "$@: copying files from $$rev" \
812 && makefile_ins=`find . -name Makefile.in` \
813 && (tar cf - configure aclocal.m4 $$makefile_ins) | \
814 (cd .. && cd "$$dir" && tar xf -) \
819 ## Before proceeding, ensure the specified revisions truly exist.
820 && git --git-dir="$$am_gitdir" describe $$OLD_COMMIT >/dev/null \
821 && git --git-dir="$$am_gitdir" describe $$NEW_COMMIT >/dev/null \
826 && get_autofiles_from_rev $$OLD_COMMIT old \
827 && get_autofiles_from_rev $$NEW_COMMIT new \
829 ## With lots of eye candy; we like our developers pampered and spoiled :-)
830 compare-autodiffs: autodiffs
832 : $${COLORDIFF=colordiff} $${DIFF=diff}; \
834 if test ! -d "$$dir"; then \
835 echo "$@: $$dir: Not a directory" >&2; \
838 mydiff=false mypager=false; \
840 if ($$COLORDIFF -r . .) </dev/null >/dev/null 2>&1; then \
841 mydiff=$$COLORDIFF; \
849 if test "$$mydiff" = false; then \
850 if ($$DIFF -r -u . .); then \
853 echo "$@: no good-enough diff program specified" >&2; \
857 st=0; $$mydiff -r -u $$dir/old $$dir/new | $$mypager || st=$$?; \
860 .PHONY: autodiffs compare-autodiffs
862 ## Program to use to fetch files.
864 WGET_SV_CVS = $(WGET) http://savannah.gnu.org/cgi-bin/viewcvs/~checkout~/
865 WGET_SV_GIT_CF = $(WGET) 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;hb=HEAD;f='
866 WGET_SV_GIT_AC = $(WGET) 'http://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=blob_plain;hb=HEAD;f='
867 WGET_SV_GIT_GL = $(WGET) 'http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob_plain;hb=HEAD;f='
868 WGET_GCC = $(WGET) 'http://gcc.gnu.org/viewcvs/*checkout*/trunk/'
870 ## Files that we fetch and which we compare against.
871 ## FIXME should be a lot more here
878 gitlog-to-changelog \
882 ## Fetch the latest versions of files we care about.
884 rm -rf Fetchdir > /dev/null 2>&1
886 ## If a get fails then that is a problem.
887 ($(am__cd) Fetchdir && \
888 $(WGET_SV_GIT_CF)config.guess -O config.guess && \
889 $(WGET_SV_GIT_CF)config.sub -O config.sub && \
890 $(WGET_SV_CVS)texinfo/texinfo/doc/texinfo.tex -O texinfo.tex && \
891 $(WGET_SV_GIT_GL)doc/INSTALL -O INSTALL && \
892 $(WGET_SV_GIT_GL)build-aux/gnupload -O gnupload && \
893 $(WGET_SV_GIT_GL)build-aux/gitlog-to-changelog -O gitlog-to-changelog && \
894 $(WGET_GCC)config-ml.in -O config-ml.in && \
895 $(WGET_GCC)symlink-tree -O symlink-tree)
896 ## Don't exit after test because we want to give as many errors as
898 @stat=0; for file in $(FETCHFILES); do \
899 if diff -u $(srcdir)/lib/$$file Fetchdir/$$file \
900 >>Fetchdir/update.patch 2>/dev/null; then :; \
903 echo "Updating $(srcdir)/lib/$$file ..."; \
904 cp Fetchdir/$$file $(srcdir)/lib/$$file; \
908 echo "See Fetchdir/update.patch for a log of the changes."; \
912 ## Generate release statistics, for the table in automake.texi.
913 ## This has to be run in an up to date build tree, but there must
914 ## be no temp files nor unused other files lying around!
917 am=`wc -l < automake` && \
918 acl=`wc -l < aclocal` && \
919 pmfiles="lib/Automake/*.pm" && \
920 if test . != '$(srcdir)'; then pmfiles="$$pmfiles $(srcdir)/lib/Automake/*.pm"; \
922 pm=`cat $$pmfiles | wc -l` && \
923 dot_am_files=`ls -1 $(srcdir)/lib/am/*.am | grep -v Makefile.am` && \
924 amf=`echo "$$dot_am_files" | wc -l` && \
925 aml=`cat $$dot_am_files | wc -l` && \
926 m4f=`ls -1 $(srcdir)/m4/*.m4 | wc -l` && \
927 m4l=`cat $(srcdir)/m4/*.m4 | wc -l` && \
928 doc_text=`$(am__cd) doc && LC_ALL=C pstops 0 automake.ps unused.ps 2>&1` && \
929 echo "$$doc_text" && \
930 rm -f doc/unused.ps && \
931 doc=`echo "$$doc_text" | sed -n 's/.*Wrote \([1-9][0-9]*\) pages.*/\1/p'` && \
932 tests="tests/*.test"; \
933 if test . != '$(srcdir)'; then tests="$$tests $(srcdir)/tests/*.test"; \
935 t=`ls -1 $$tests | wc -l` && \
936 tgen=`grep 'GENERATED AUTOMATICALLY' $$tests | wc -l` && \
937 today=`date +%Y-%m-%d` && \
938 echo "add this to the table in doc/automake.texi after verification:" && \
939 printf '@item %s @tab %-6s @tab %4d @tab %4d @tab %4d @tab %4d %-4s @tab %4d %-4s @tab %3d @tab %d %-4s\n' \
940 $$today $(VERSION) $$am $$acl $$pm $$aml "($$amf)" $$m4l "($$m4f)" $$doc $$t "($$tgen)"
941 .PHONY: release-stats