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 ams = `find $(srcdir) -name '*.am'`
214 # Some simple checks, and then ordinary check. These are only really
215 # guaranteed to work on my machine.
216 syntax_check_rules = \
218 sc_diff_automake_in_automake \
219 sc_diff_aclocal_in_automake \
221 sc_no_brace_variable_expansions \
223 sc_no_for_variable_in_macro \
225 sc_pre_normal_post_install_uninstall \
227 sc_perl_no_split_regex_space \
228 sc_cd_in_backquotes \
230 sc_perl_at_uscore_in_scalar_context \
231 sc_perl_local_no_parens \
233 sc_AMDEP_TRUE_in_automake_in \
234 sc_tests_make_without_am_makeflags \
235 sc_tests_obsolete_variables \
236 sc_tests_plain_make \
237 sc_tests_plain_autoconf \
238 sc_tests_plain_autoupdate \
239 sc_tests_plain_automake \
240 sc_tests_plain_autom4te \
241 sc_tests_plain_autoheader \
242 sc_tests_plain_autoreconf \
243 sc_tests_here_document_format \
244 sc_tests_Exit_not_exit \
245 sc_tests_automake_fails \
246 sc_tests_plain_aclocal \
247 sc_tests_plain_perl \
248 sc_tests_required_after_defs \
250 sc_tests_overriding_macros_on_cmdline \
251 sc_tests_plain_sleep \
252 sc_tests_plain_egrep_fgrep \
253 sc_tests_PATH_SEPARATOR \
254 sc_tests_logs_duplicate_prefixes \
255 sc_tests_makefile_variable_order \
258 sc_unquoted_DESTDIR \
262 $(syntax_check_rules): automake aclocal
263 maintainer-check: $(syntax_check_rules)
264 .PHONY: maintainer-check $(syntax_check_rules)
266 ## Check that the list of tests given in the Makefile is equal to the
267 ## list of all test scripts in the Automake testsuite.
268 .PHONY: maintainer-check-list-of-tests
269 maintainer-check-list-of-tests:
270 $(am__cd) tests && $(MAKE) $(AM_MAKEFLAGS) $@
271 maintainer-check: maintainer-check-list-of-tests
273 ## Look for test whose names can cause spurious failures when used as
274 ## first argument to AC_INIT (chiefly because they might contain an
275 ## m4/m4sugar builtin or macro name).
325 @m4_builtin_rx=`echo $(m4_builtins) | sed 's/ /|/g'`; \
326 m4_macro_rx="\\<($$m4_builtin_rx)\\>|\\<_?(A[CUMHS]|m4)_"; \
328 for t in $(xtests); do echo $$t; done \
329 | LC_ALL=C grep -E "$$m4_macro_rx"; \
331 echo "the names of the tests above can be problematic" 1>&2; \
332 echo "Avoid test names that contain names of m4 macros" 1>&2; \
336 ## These check avoids accidental configure substitutions in the source.
337 ## There are exactly 9 lines that should be modified from automake.in to
338 ## automake, and 10 lines that should be modified from aclocal.in to
339 ## aclocal; these wors out to 32 and 34 lines of diffs, respectively.
340 sc_diff_automake_in_automake:
341 @if test `diff $(srcdir)/automake.in automake | wc -l` -ne 32; then \
342 echo "found too many diffs between automake.in and automake" 1>&2; \
343 diff -c $(srcdir)/automake.in automake; \
346 sc_diff_aclocal_in_aclocal:
347 @if test `diff $(srcdir)/aclocal.in aclocal | wc -l` -ne 34; then \
348 echo "found too many diffs between aclocal.in and aclocal" 1>&2; \
349 diff -c $(srcdir)/aclocal.in aclocal; \
353 ## Syntax check with default Perl (on my machine, Perl 5).
355 @perllibdir="./lib$(PATH_SEPARATOR)$(srcdir)/lib" $(PERL) -c -w automake
356 @perllibdir="./lib$(PATH_SEPARATOR)$(srcdir)/lib" $(PERL) -c -w aclocal
358 ## expect no instances of '${...}'. However, $${...} is ok, since that
359 ## is a shell construct, not a Makefile construct.
360 sc_no_brace_variable_expansions:
361 @if grep -F '$${' $(ams) | grep -F -v '$$$$'; then \
362 echo "Found too many uses of '\$${' in the lines above." 1>&2; \
366 ## Make sure `rm' is called with `-f'.
368 @if grep -v '^#' $(ams) $(xtests) \
369 | grep -E '\<rm ([^-]|\-[^f ]*\>)'; \
371 echo "Suspicious 'rm' invocation." 1>&2; \
375 ## Never use something like `for file in $(FILES)', this doesn't work
376 ## if FILES is empty or if it contains shell meta characters (e.g. $ is
377 ## commonly used in Java filenames).
378 sc_no_for_variable_in_macro:
379 @if grep 'for .* in \$$(' $(ams); then \
380 echo 'Use "list=$$(mumble); for var in $$$$list".' 1>&2 ; \
384 ## Make sure all invocations of mkinstalldirs are correct.
386 @if grep -n 'mkinstalldirs' $(ams) | \
387 grep -F -v '$$(mkinstalldirs)'; then \
388 echo "Found incorrect use of mkinstalldirs in the lines above" 1>&2; \
392 ## Make sure all calls to PRE/NORMAL/POST_INSTALL/UNINSTALL
393 sc_pre_normal_post_install_uninstall:
394 @if grep -E -n '\((PRE|NORMAL|POST)_(|UN)INSTALL\)' $(ams) | \
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 $(ams); then \
418 echo "Consider using \$$(am__cd) in the lines above." 1>&2; \
422 ## Look for cd to a relative directory (may be influenced by CDPATH).
423 ## Skip some known directories that are OK.
425 @if grep -n '^[^#]*cd ' $(srcdir)/automake.in $(ams) | \
426 grep -v 'echo.*cd ' | \
427 grep -v 'am__cd =' | \
428 grep -v '^[^#]*cd [./]' | \
429 grep -v '^[^#]*cd \$$(top_builddir)' | \
430 grep -v '^[^#]*cd "\$$\$$am__cwd' | \
431 grep -v '^[^#]*cd \$$(abs' | \
432 grep -v '^[^#]*cd "\$$(DESTDIR)'; then \
433 echo "Consider using \$$(am__cd) in the lines above." 1>&2; \
437 ## Using @_ in a scalar context is most probably a programming error.
438 sc_perl_at_uscore_in_scalar_context:
439 @if grep -Hn '[^@_A-Za-z0-9][_A-Za-z0-9]*[^) ] *= *@_' $(srcdir)/automake.in; then \
440 echo "Using @_ in a scalar context in the lines above." 1>&2; \
444 ## Forbid using parens with `local' to ease counting.
445 sc_perl_local_no_parens:
446 @if grep '^[ \t]*local *(' $(srcdir)/automake.in; then \
447 echo "Don't use \`local' with parens: use several \`local' above." >&2; \
451 ## Allow only few variables to be localized in Automake.
453 @if egrep -v '^[ \t]*local \$$[_~]( *=|;)' $(srcdir)/automake.in | \
454 grep '^[ \t]*local [^*]'; then \
455 echo "Please avoid \`local'." 1>&2; \
459 ## Don't let AMDEP_TRUE substitution appear in automake.in.
460 sc_AMDEP_TRUE_in_automake_in:
461 @if grep '@AMDEP''_TRUE@' $(srcdir)/automake.in; then \
462 echo "Don't put AMDEP_TRUE substitution in automake.in" 1>&2; \
466 ## Recursive make invocations should always pass $(AM_MAKEFLAGS)
467 ## to $(MAKE), for portability to non-GNU make.
468 sc_tests_make_without_am_makeflags:
469 @if grep '^[^#].*(MAKE) ' $(ams) $(srcdir)/automake.in | \
470 grep -v 'AM_MAKEFLAGS'; then \
471 echo 'Use $$(MAKE) $$(AM_MAKEFLAGS).' 1>&2; \
475 ## Look out for some obsolete variables.
476 sc_tests_obsolete_variables:
480 test_prefer_config_shell \
485 for v in $$vars; do \
486 if grep -E "\b$$v\b" \
487 $(xtests) $(srcdir)/tests/defs \
488 $(srcdir)/tests/defs-static.in \
493 if test -n "$$seen"; then \
494 for v in $$seen; do \
495 echo "Variable '$$v' is obsolete, use 'am_$$v' instead." 1>&2; \
500 ## Tests should never call make directly.
502 @if grep -v '^#' $(xtests) | $(EGREP) ':[ ]*make( |$$)'; then \
503 echo 'Do not run "make" in the above tests. Use "$$MAKE" instead.' 1>&2; \
507 ## Tests should never call autoconf directly.
508 sc_tests_plain_autoconf:
509 @if grep -v '^#' $(xtests) | grep ':[ ]*autoconf\>'; then \
510 echo 'Do not run "autoconf" in the above tests. Use "$$AUTOCONF" instead.' 1>&2; \
514 ## Tests should never call autoupdate directly.
515 sc_tests_plain_autoupdate:
516 @if grep -v '^#' $(xtests) | grep ':[ ]*autoupdate\>'; then \
517 echo 'Do not run "autoupdate" in the above tests. Use "$$AUTOUPDATE" instead.' 1>&2; \
521 ## Tests should never call automake directly.
522 sc_tests_plain_automake:
523 @if grep -v '^#' $(xtests) | grep -E ':[ ]*automake\>([^:]|$$)'; then \
524 echo 'Do not run "automake" in the above tests. Use "$$AUTOMAKE" instead.' 1>&2; \
528 ## Tests should never call autoheader directly.
529 sc_tests_plain_autoheader:
530 @if grep -v '^#' $(xtests) | grep ':[ ]*autoheader\>'; then \
531 echo 'Do not run "autoheader" in the above tests. Use "$$AUTOHEADER" instead.' 1>&2; \
535 ## Tests should never call autoreconf directly.
536 sc_tests_plain_autoreconf:
537 @if grep -v '^#' $(xtests) | grep ':[ ]*autoreconf\>'; then \
538 echo 'Do not run "autoreconf" in the above tests. Use "$$AUTORECONF" instead.' 1>&2; \
542 ## Tests should never call autom4te directly.
543 sc_tests_plain_autom4te:
544 @if grep -v '^#' $(xtests) | grep ':[ ]*autom4te\>'; then \
545 echo 'Do not run "autom4te" in the above tests. Use "$$AUTOM4TE" instead.' 1>&2; \
549 ## Tests should only use END and EOF for here documents
550 ## (so that the next test is effective).
551 sc_tests_here_document_format:
552 @if grep '<<' $(xtests) | grep -v 'END' | grep -v 'EOF'; then \
553 echo 'Use here documents with "END" and "EOF" only, for greppability.' 1>&2; \
557 ## Tests should never call exit directly, but use Exit.
558 ## This is so that the exit status is transported correctly across the 0 trap.
559 ## Ignore comments, testsuite self tests, and one perl line in ext2.test.
560 sc_tests_Exit_not_exit:
561 @found=false; for file in $(xtests); do \
562 case $$file in */self-check-*) continue;; esac; \
563 res=`sed -n -e '/^#/d; /^\$$PERL/d' -e '/<<.*END/,/^END/b' \
564 -e '/<<.*EOF/,/^EOF/b' -e '/exit [$$0-9]/p' $$file`; \
565 if test -n "$$res"; then \
566 echo "$$file:$$res"; \
571 echo 'Do not call plain "exit", use "Exit" instead, in above tests.' 1>&2; \
575 ## Use AUTOMAKE_fails when appropriate
576 sc_tests_automake_fails:
577 @if grep -v '^#' $(xtests) | grep '\$$AUTOMAKE.*&&.*[eE]xit'; then \
578 echo 'Use AUTOMAKE_fails + grep to catch automake failures in the above tests.' 1>&2; \
582 ## Tests should never call aclocal directly.
583 sc_tests_plain_aclocal:
584 @if grep -v '^#' $(xtests) | grep ':[ ]*aclocal\>'; then \
585 echo 'Do not run "aclocal" in the above tests. Use "$$ACLOCAL" instead.' 1>&2; \
589 ## Tests should never call perl directly.
591 @if grep -v '^#' $(xtests) | grep ':[ ]*perl\>'; then \
592 echo 'Do not run "perl" in the above tests. Use "$$PERL" instead.' 1>&2; \
596 ## Setting `required' after sourcing `./defs' is a bug.
597 sc_tests_required_after_defs:
598 @for file in $(xtests); do \
599 if out=`sed -n '/defs/,$${/required=/p;}' $$file`; test -n "$$out"; then \
600 echo 'Do not set "required" after sourcing "defs" in '"$$file: $$out" 1>&2; \
605 ## TAP-based test scripts should not forget to declare a TAP plan. In
606 ## case it is not known in advance how many tests will be run, a "lazy"
607 ## plan can be used; but its use should be deliberate, explicitly declared
608 ## with a "plan_ later" call, rather than the result of an oversight.
609 ## This check helps to ensure this is indeed the case.
611 @with_plan=`grep -l '^ *plan_ ' $(srcdir)/tests/*.tap`; \
612 with_plan=`echo $$with_plan`; \
614 for t in $(srcdir)/tests/*.tap; do \
615 case " $$with_plan " in *" $$t "*) continue;; esac; \
616 ## It's ok for an *auto-generated* test sourcing an hand-written one not
617 ## to declare a TAP plan: that will be done by the sourced test.
620 t2=`echo $$t | sed -e 's|.*/||' -e 's/-w\.tap$$/.tap/'` \
621 && grep -E "^ *\\. *[^ ]*/$$t2\\b" $$t >/dev/null \
622 && continue || : ;; \
624 ok=false; echo $$t; \
627 echo 'The tests above do not declare a TAP plan.' 1>&2; \
631 ## Overriding a Makefile macro on the command line is not portable when
632 ## recursive targets are used. Better use an envvar. SHELL is an
633 ## exception, POSIX says it can't come from the environment. V, DESTDIR,
634 ## DISTCHECK_CONFIGURE_FLAGS and DISABLE_HARD_ERRORS are exceptions, too,
635 ## as package authors are urged not to initialize them anywhere.
636 sc_tests_overriding_macros_on_cmdline:
637 @if grep -E '\$$MAKE .*(SHELL=.*=|=.*SHELL=)' $(xtests); then \
638 echo 'Rewrite "$$MAKE foo=bar SHELL=$$SHELL" as "foo=bar $$MAKE -e SHELL=$$SHELL"' 1>&2; \
639 echo ' in the above lines, it is more portable.' 1>&2; \
642 ## Also try to account for usages like "$MAKE || st=$?".
643 @if sed -e 's/ || .*//' -e 's/ && .*//' \
644 -e 's/ DESTDIR=[^ ]*/ /' -e 's/ SHELL=[^ ]*/ /' \
645 -e 's/ V=[^ ]*/ /' -e 's/ DISABLE_HARD_ERRORS=[^ ]*/ /' \
646 ## DISTCHECK_CONFIGURE_FLAGS is allowed to contain whitespace in its
647 ## definition, so the more complex substitutions below.
648 -e "s/ DISTCHECK_CONFIGURE_FLAGS='[^']*'/ /" \
649 -e 's/ DISTCHECK_CONFIGURE_FLAGS="[^"]*"/ /' \
650 -e 's/ DISTCHECK_CONFIGURE_FLAGS=[^ ]/ /' \
651 $(xtests) | grep '\$$MAKE .*='; then \
652 echo 'Rewrite "$$MAKE foo=bar" as "foo=bar $$MAKE -e" in the above lines,' 1>&2; \
653 echo 'it is more portable.' 1>&2; \
656 @if grep 'SHELL=.*\$$MAKE' $(xtests); then \
657 echo '$$MAKE ignores the SHELL envvar, use "$$MAKE SHELL=$$SHELL" in' 1>&2; \
658 echo 'the above lines.' 1>&2; \
662 ## Never use `sleep 1' to create files with different timestamps.
663 ## Use `$sleep' instead. Some filesystems (e.g., Windows') have only
664 ## a 2sec resolution.
665 sc_tests_plain_sleep:
666 @if grep -E '\bsleep +[12345]\b' $(xtests); then \
667 echo 'Do not use "sleep x" in the above tests. Use "$$sleep" instead.' 1>&2; \
671 ## fgrep and egrep are not required by POSIX.
672 sc_tests_plain_egrep_fgrep:
673 @if grep -E '\b[ef]grep\b' $(xtests) ; then \
674 echo 'Do not use egrep or fgrep in test cases. Use $$FGREP or $$EGREP.' 1>&2; \
677 @if grep -E '\b[ef]grep\b' $(ams) $(srcdir)/m4/*.m4; then \
678 echo 'Do not use egrep or fgrep in the above files, they are not portable.' 1>&2; \
682 ## Rule to ensure that the testsuite has been run before. We don't depend on `check'
683 ## here, because that would be very wasteful in the common case. We could run
684 ## `make check RECHECK_LOGS=' and avoid toplevel races with AM_RECURSIVE_TARGETS.
685 ## Suggest keeping test directories around for greppability of the Makefile.in files.
686 sc_ensure_testsuite_has_run:
687 @if test ! -f tests/test-suite.log; then \
688 echo "Run \`env keep_testdirs=yes make check' before \`maintainer-check'" >&2; \
691 .PHONY: sc_ensure_testsuite_has_run
693 ## Ensure our warning and error messages do not contain duplicate 'warning:' prefixes.
694 ## This test actually depends on the testsuite having been run before.
695 sc_tests_logs_duplicate_prefixes: sc_ensure_testsuite_has_run
696 @if grep -E '(warning|error):.*(warning|error):' tests/*.log; then \
697 echo 'Duplicate warning/error message prefixes seen in above tests.' >&2; \
701 ## Ensure variables are listed before rules in Makefile.in files we generate.
702 sc_tests_makefile_variable_order: sc_ensure_testsuite_has_run
703 @for file in `find tests -name Makefile.in -print`; do \
706 -e '/\\\\$$/{' -e N -e 'b x' -e '}' \
709 ## Allow @ so we match conditionals.
710 -e '/^ *[a-zA-Z_@]\{1,\} *=/p' $$file`; \
711 if test -n "$$latevars"; then \
712 echo 'Ensure variables are expanded before rules' >&2; \
713 echo "Variables are expanded too late in $$file:" >&2; \
714 echo "$$latevars" | sed 's/^/ /' >&2; \
719 ## Using `:' as a PATH separator is not portable.
720 sc_tests_PATH_SEPARATOR:
721 @if grep -E '\bPATH=.*:.*' $(xtests) ; then \
722 echo "Use \`\$$PATH_SEPARATOR', not \`:', in PATH definitions above." 1>&2; \
727 @if grep 'mkdir_p' $(srcdir)/automake.in $(ams) $(xtests); then \
728 echo 'Do not use mkdir_p in the above files, use MKDIR_P.' 1>&2; \
732 ## Try to make sure all @...@ substitutions are covered by our
733 ## substitution rule.
735 @if test `grep -E '^[^#]*@[A-Za-z_0-9]+@' aclocal | wc -l` -ne 0; then \
736 echo "Unresolved @...@ substitution in aclocal" 1>&2; \
739 @if test `grep -E '^[^#]*@[A-Za-z_0-9]+@' automake | wc -l` -ne 0; then \
740 echo "Unresolved @...@ substitution in automake" 1>&2; \
745 @if grep -E "[^\'\"]\\\$$\(DESTDIR" $(ams); then \
746 echo 'Suspicious unquoted DESTDIR uses.' 1>&2 ; \
751 @if grep ' ' $(srcdir)/doc/automake.texi; then \
752 echo 'Do not use tabs in the manual.' 1>&2; \
757 @if grep -E '([^@]|^)@([ ][^@]|$$)' $(srcdir)/doc/automake.texi; \
759 echo 'Unescaped @.' 1>&2; \
764 git-dist: maintainer-check
765 ## Make sure the NEWS file is up-to-date.
766 @if sed 1q $(srcdir)/NEWS | grep -e "$(VERSION)" > /dev/null; then :; else \
767 echo "NEWS not updated; not releasing" 1>&2; \
770 ## Build the distribution. We expect the developer to have already run
771 ## "make check" and "make distcheck" on his own (as required in the
772 ## HACKING file, section "Release procedure").
773 $(MAKE) $(AM_MAKEFLAGS) dist
774 ## Finally, if anything was successful, commit the last changes and tag
775 ## the release in the repository. We don't use RCS keywords so it's OK
776 ## to distribute the files before they were committed.
777 $(am__cd) $(srcdir) && git commit -a -s && \
778 git tag -s "v$(VERSION)" -m "Release $(VERSION)"
780 git-release: git-dist
782 *[a-z]) dest=alpha;; \
785 $(srcdir)/lib/gnupload $(GNUPLOADFLAGS) \
786 --to $$dest.gnu.org:automake $(DIST_ARCHIVES)
788 ## Visually comparing differences between the Makefile.in files in
789 ## automake's own build system as generated in two different branches
790 ## might help to catch bugs and blunders. This has already happened a
791 ## few times in the past, when we used to version-control Makefile.in.
794 NEW_COMMIT=$${NEW_COMMIT-"HEAD"}; \
795 OLD_COMMIT=$${OLD_COMMIT-"HEAD~1"}; \
796 am_gitdir='$(abs_top_srcdir)/.git'; \
797 get_autofiles_from_rev () \
800 && echo "$@: will get files from revision $$rev" \
801 && git clone -q --depth 1 "$$am_gitdir" tmp \
803 && git checkout -q "$$rev" \
804 && echo "$@: bootstrapping $$rev" \
805 && $(SHELL) ./bootstrap \
806 && echo "$@: copying files from $$rev" \
807 && makefile_ins=`find . -name Makefile.in` \
808 && (tar cf - configure aclocal.m4 $$makefile_ins) | \
809 (cd .. && cd "$$dir" && tar xf -) \
814 ## Before proceeding, ensure the specified revisions truly exist.
815 && git --git-dir="$$am_gitdir" describe $$OLD_COMMIT >/dev/null \
816 && git --git-dir="$$am_gitdir" describe $$NEW_COMMIT >/dev/null \
821 && get_autofiles_from_rev $$OLD_COMMIT old \
822 && get_autofiles_from_rev $$NEW_COMMIT new \
824 ## With lots of eye candy; we like our developers pampered and spoiled :-)
825 compare-autodiffs: autodiffs
827 : $${COLORDIFF=colordiff} $${DIFF=diff}; \
829 if test ! -d "$$dir"; then \
830 echo "$@: $$dir: Not a directory" >&2; \
833 mydiff=false mypager=false; \
835 if ($$COLORDIFF -r . .) </dev/null >/dev/null 2>&1; then \
836 mydiff=$$COLORDIFF; \
844 if test "$$mydiff" = false; then \
845 if ($$DIFF -r -u . .); then \
848 echo "$@: no good-enough diff program specified" >&2; \
852 st=0; $$mydiff -r -u $$dir/old $$dir/new | $$mypager || st=$$?; \
855 .PHONY: autodiffs compare-autodiffs
857 ## Program to use to fetch files.
859 WGET_SV_CVS = $(WGET) http://savannah.gnu.org/cgi-bin/viewcvs/~checkout~/
860 WGET_SV_GIT_CF = $(WGET) 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;hb=HEAD;f='
861 WGET_SV_GIT_AC = $(WGET) 'http://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=blob_plain;hb=HEAD;f='
862 WGET_SV_GIT_GL = $(WGET) 'http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob_plain;hb=HEAD;f='
864 ## Files that we fetch and which we compare against.
865 ## FIXME should be a lot more here
871 gitlog-to-changelog \
874 ## Fetch the latest versions of files we care about.
876 rm -rf Fetchdir > /dev/null 2>&1
878 ## If a get fails then that is a problem.
879 ($(am__cd) Fetchdir && \
880 $(WGET_SV_GIT_CF)config.guess -O config.guess && \
881 $(WGET_SV_GIT_CF)config.sub -O config.sub && \
882 $(WGET_SV_CVS)texinfo/texinfo/doc/texinfo.tex -O texinfo.tex && \
883 $(WGET_SV_GIT_GL)doc/INSTALL -O INSTALL && \
884 $(WGET_SV_GIT_GL)build-aux/gnupload -O gnupload && \
885 $(WGET_SV_GIT_GL)build-aux/gitlog-to-changelog -O gitlog-to-changelog)
886 ## Don't exit after test because we want to give as many errors as
888 @stat=0; for file in $(FETCHFILES); do \
889 if diff -u $(srcdir)/lib/$$file Fetchdir/$$file \
890 >>Fetchdir/update.patch 2>/dev/null; then :; \
893 echo "Updating $(srcdir)/lib/$$file ..."; \
894 cp Fetchdir/$$file $(srcdir)/lib/$$file; \
898 echo "See Fetchdir/update.patch for a log of the changes."; \
902 ## Generate release statistics, for the table in automake.texi.
903 ## This has to be run in an up to date build tree, but there must
904 ## be no temp files nor unused other files lying around!
907 am=`wc -l < automake` && \
908 acl=`wc -l < aclocal` && \
909 pmfiles="lib/Automake/*.pm" && \
910 if test . != '$(srcdir)'; then pmfiles="$$pmfiles $(srcdir)/lib/Automake/*.pm"; \
912 pm=`cat $$pmfiles | wc -l` && \
913 dot_am_files=`ls -1 $(srcdir)/lib/am/*.am | grep -v Makefile.am` && \
914 amf=`echo "$$dot_am_files" | wc -l` && \
915 aml=`cat $$dot_am_files | wc -l` && \
916 m4f=`ls -1 $(srcdir)/m4/*.m4 | wc -l` && \
917 m4l=`cat $(srcdir)/m4/*.m4 | wc -l` && \
918 doc_text=`$(am__cd) doc && LC_ALL=C pstops 0 automake.ps unused.ps 2>&1` && \
919 echo "$$doc_text" && \
920 rm -f doc/unused.ps && \
921 doc=`echo "$$doc_text" | sed -n 's/.*Wrote \([1-9][0-9]*\) pages.*/\1/p'` && \
922 tests="tests/*.test"; \
923 if test . != '$(srcdir)'; then tests="$$tests $(srcdir)/tests/*.test"; \
925 t=`ls -1 $$tests | wc -l` && \
926 tgen=`grep 'GENERATED AUTOMATICALLY' $$tests | wc -l` && \
927 today=`date +%Y-%m-%d` && \
928 echo "add this to the table in doc/automake.texi after verification:" && \
929 printf '@item %s @tab %-6s @tab %4d @tab %4d @tab %4d @tab %4d %-4s @tab %4d %-4s @tab %3d @tab %d %-4s\n' \
930 $$today $(VERSION) $$am $$acl $$pm $$aml "($$amf)" $$m4l "($$m4f)" $$doc $$t "($$tgen)"
931 .PHONY: release-stats