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 ## recheck: convenience proxy target for the test suites.
110 for f in x $$MAKEFLAGS; do \
113 *k*) failcom='fail=yes';; \
116 for subdir in $(TEST_SUBDIRS); do \
117 ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@) \
122 ################################################################
124 ## Everything past here is useful to the maintainer, but probably not
128 # Ensure tests are world-executable
130 $(am__cd) $(distdir)/tests && chmod a+rx *.test
133 # Perl coverage statistics.
134 PERL_COVERAGE_DB = $(abs_top_builddir)/cover_db
135 PERL_COVERAGE_FLAGS = -MDevel::Cover=-db,$(PERL_COVERAGE_DB),-silent,on,-summary,off
138 check-coverage-run recheck-coverage-run: all
139 $(mkinstalldirs) $(PERL_COVERAGE_DB)
140 PERL5OPT="$$PERL5OPT $(PERL_COVERAGE_FLAGS)"; export PERL5OPT; \
141 WANT_NO_THREADS=yes; export WANT_NO_THREADS; unset AUTOMAKE_JOBS; \
142 $(MAKE) $(AM_MAKEFLAGS) `echo $@ | sed 's/-coverage-run//'`
144 check-coverage-report:
145 @if test ! -d "$(PERL_COVERAGE_DB)"; then \
146 echo "No coverage database found in \`$(PERL_COVERAGE_DB)'." >&2; \
147 echo "Please run \`make check-coverage' first" >&2; \
150 $(PERL_COVER) $(PERL_COVER_FLAGS) "$(PERL_COVERAGE_DB)"
152 # We don't use direct dependencies here because we'd like to be able
153 # to invoke the report even after interrupted check-coverage.
154 check-coverage: check-coverage-run
155 $(MAKE) $(AM_MAKEFLAGS) check-coverage-report
157 recheck-coverage: recheck-coverage-run
158 $(MAKE) $(AM_MAKEFLAGS) check-coverage-report
161 rm -rf "$(PERL_COVERAGE_DB)"
162 clean-local: clean-coverage
164 .PHONY: check-coverage recheck-coverage check-coverage-run \
165 recheck-coverage-run check-coverage-report clean-coverage
167 # Some simple checks, and then ordinary check. These are only really
168 # guaranteed to work on my machine.
169 syntax_check_rules = \
171 sc_diff_automake_in_automake \
172 sc_diff_aclocal_in_automake \
174 sc_no_brace_variable_expansions \
176 sc_no_for_variable_in_macro \
178 sc_pre_normal_post_install_uninstall \
180 sc_perl_no_split_regex_space \
181 sc_cd_in_backquotes \
183 sc_perl_at_uscore_in_scalar_context \
184 sc_perl_local_no_parens \
186 sc_AMDEP_TRUE_in_automake_in \
187 sc_tests_make_without_am_makeflags \
188 sc_tests_plain_make \
189 sc_tests_plain_autoconf \
190 sc_tests_plain_autoupdate \
191 sc_tests_plain_automake \
192 sc_tests_plain_autom4te \
193 sc_tests_plain_autoheader \
194 sc_tests_plain_autoreconf \
195 sc_tests_here_document_format \
196 sc_tests_Exit_not_exit \
197 sc_tests_automake_fails \
198 sc_tests_plain_aclocal \
199 sc_tests_plain_perl \
200 sc_tests_required_after_defs \
201 sc_tests_overriding_macros_on_cmdline \
202 sc_tests_plain_sleep \
203 sc_tests_plain_egrep_fgrep \
204 sc_tests_PATH_SEPARATOR \
205 sc_tests_logs_duplicate_prefixes \
206 sc_tests_makefile_variable_order \
209 sc_unquoted_DESTDIR \
213 .PHONY: $(syntax_check_rules)
214 $(syntax_check_rules): automake aclocal
216 ## Check that the list of tests given in the Makefile is equal to the
217 ## list of all test scripts in the Automake testsuite.
218 .PHONY: maintainer-check-list-of-tests
219 maintainer-check-list-of-tests:
221 for f in x $$MAKEFLAGS; do \
224 *k*) failcom='fail=yes';; \
227 for subdir in $(TEST_SUBDIRS); do \
228 (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $@) || eval $$failcom; \
232 maintainer-check: $(syntax_check_rules) maintainer-check-list-of-tests
234 ## Look for test whose names can cause spurious failures when used as
235 ## first argument to AC_INIT (chiefly because they might contain an
236 ## m4/m4sugar builtin or macro name).
286 @m4_builtin_rx=`echo $(m4_builtins) | sed 's/ /|/g'`; \
287 m4_macro_rx="\\<($$m4_builtin_rx)\\>|\\<_?(A[CUMHS]|m4)_"; \
288 if ls tests/*.test | LC_ALL=C grep -E "$$m4_macro_rx"; then \
289 echo "the names of the tests above can be problematic" 1>&2; \
290 echo "Avoid test names that contain names of m4 macros" 1>&2; \
294 ## These check avoids accidental configure substitutions in the source.
295 ## There are exactly 9 lines that should be modified from automake.in to
296 ## automake, and 10 lines that should be modified from aclocal.in to
297 ## aclocal; these wors out to 32 and 34 lines of diffs, respectively.
298 sc_diff_automake_in_automake:
299 @if test `diff $(srcdir)/automake.in automake | wc -l` -ne 32; then \
300 echo "found too many diffs between automake.in and automake" 1>&2; \
301 diff -c $(srcdir)/automake.in automake; \
304 sc_diff_aclocal_in_aclocal:
305 @if test `diff $(srcdir)/aclocal.in aclocal | wc -l` -ne 34; then \
306 echo "found too many diffs between aclocal.in and aclocal" 1>&2; \
307 diff -c $(srcdir)/aclocal.in aclocal; \
311 ## Syntax check with default Perl (on my machine, Perl 5).
313 perllibdir="./lib$(PATH_SEPARATOR)$(srcdir)/lib" $(PERL) -c -w automake
314 perllibdir="./lib$(PATH_SEPARATOR)$(srcdir)/lib" $(PERL) -c -w aclocal
316 ## expect no instances of '${...}'. However, $${...} is ok, since that
317 ## is a shell construct, not a Makefile construct.
318 sc_no_brace_variable_expansions:
319 @if grep -F '$${' $(srcdir)/lib/am/[a-z]*.am | \
320 grep -F -v '$$$$'; then \
321 echo "Found too many uses of '\$${' in the lines above." 1>&2; \
325 ## Make sure `rm' is called with `-f'.
327 @if grep -v '^#' $(srcdir)/lib/am/[a-z]*.am $(srcdir)/tests/*.test | \
328 grep -E '\<rm ([^-]|\-[^f ]*\>)'; then \
329 echo "Suspicious 'rm' invocation." 1>&2; \
333 ## Never use something like `for file in $(FILES)', this doesn't work
334 ## if FILES is empty or if it contains shell meta characters (e.g. $ is
335 ## commonly used in Java filenames).
336 sc_no_for_variable_in_macro:
337 @if grep 'for .* in \$$(' $(srcdir)/lib/am/[a-z]*.am; then \
338 echo 'Use "list=$$(mumble); for var in $$$$list".' 1>&2 ; \
342 ## Make sure all invocations of mkinstalldirs are correct.
344 @if grep -n 'mkinstalldirs' $(srcdir)/lib/am/[a-z]*.am | \
345 grep -F -v '$$(mkinstalldirs)'; then \
346 echo "Found incorrect use of mkinstalldirs in the lines above" 1>&2; \
350 ## Make sure all calls to PRE/NORMAL/POST_INSTALL/UNINSTALL
351 sc_pre_normal_post_install_uninstall:
352 @if grep -E -n '\((PRE|NORMAL|POST)_(|UN)INSTALL\)' \
353 $(srcdir)/lib/am/[a-z]*.am | \
354 grep -v ':##' | grep -v ': @\$$('; then \
355 echo "Found incorrect use of PRE/NORMAL/POST_INSTALL/UNINSTALL in the lines above" 1>&2; \
359 ## We never want to use "undef", only "delete", but for $/.
361 @if grep -n -w 'undef ' $(srcdir)/automake.in | \
362 grep -F -v 'undef $$/'; then \
363 echo "Found undef in automake.in; use delete instead" 1>&2; \
367 ## We never want split (/ /,...), only split (' ', ...).
368 sc_perl_no_split_regex_space:
369 @if grep -n 'split (/ /' $(srcdir)/automake.in; then \
370 echo "Found bad split in the lines above." 1>&2; \
374 ## Look for cd within backquotes
376 @if grep -n '^[^#]*` *cd ' $(srcdir)/automake.in \
377 $(srcdir)/lib/am/*.am; then \
378 echo "Consider using \$$(am__cd) in the lines above." 1>&2; \
382 ## Look for cd to a relative directory (may be influenced by CDPATH).
383 ## Skip some known directories that are OK.
385 @if grep -n '^[^#]*cd ' $(srcdir)/automake.in \
386 $(srcdir)/lib/am/*.am | \
387 grep -v 'echo.*cd ' | \
388 grep -v 'am__cd =' | \
389 grep -v '^[^#]*cd [./]' | \
390 grep -v '^[^#]*cd \$$(top_builddir)' | \
391 grep -v '^[^#]*cd "\$$\$$am__cwd' | \
392 grep -v '^[^#]*cd \$$(abs' | \
393 grep -v '^[^#]*cd "\$$(DESTDIR)'; then \
394 echo "Consider using \$$(am__cd) in the lines above." 1>&2; \
398 ## Using @_ in a scalar context is most probably a programming error.
399 sc_perl_at_uscore_in_scalar_context:
400 @if grep -Hn '[^@_A-Za-z0-9][_A-Za-z0-9]*[^) ] *= *@_' $(srcdir)/automake.in; then \
401 echo "Using @_ in a scalar context in the lines above." 1>&2; \
405 ## Forbid using parens with `local' to ease counting.
406 sc_perl_local_no_parens:
407 @if grep '^[ \t]*local *(' $(srcdir)/automake.in; then \
408 echo "Don't use \`local' with parens: use several \`local' above." >&2; \
412 ## Allow only `local $_' in Automake.
414 @if grep -v '^[ \t]*local \$$_;' $(srcdir)/automake.in | \
415 grep '^[ \t]*local [^*]'; then \
416 echo "Please avoid \`local'." 1>&2; \
420 ## Don't let AMDEP_TRUE substitution appear in automake.in.
421 sc_AMDEP_TRUE_in_automake_in:
422 @if grep '@AMDEP''_TRUE@' $(srcdir)/automake.in; then \
423 echo "Don't put AMDEP_TRUE substitution in automake.in" 1>&2; \
427 ## Tests should never call make directly.
428 sc_tests_make_without_am_makeflags:
429 @if grep '^[^#].*(MAKE) ' $(srcdir)/lib/am/*.am $(srcdir)/automake.in |\
430 grep -v 'AM_MAKEFLAGS'; then \
431 echo 'Use $$(MAKE) $$(AM_MAKEFLAGS).' 1>&2; \
435 ## Tests should never call make directly.
437 @if grep -v '^#' $(srcdir)/tests/*.test | $(EGREP) ':[ ]*make( |$$)'; then \
438 echo 'Do not run "make" in the above tests. Use "$$MAKE" instead.' 1>&2; \
442 ## Tests should never call autoconf directly.
443 sc_tests_plain_autoconf:
444 @if grep -v '^#' $(srcdir)/tests/*.test | grep ':[ ]*autoconf\>'; then \
445 echo 'Do not run "autoconf" in the above tests. Use "$$AUTOCONF" instead.' 1>&2; \
449 ## Tests should never call autoupdate directly.
450 sc_tests_plain_autoupdate:
451 @if grep -v '^#' $(srcdir)/tests/*.test | grep ':[ ]*autoupdate\>'; then \
452 echo 'Do not run "autoupdate" in the above tests. Use "$$AUTOUPDATE" instead.' 1>&2; \
456 ## Tests should never call automake directly.
457 sc_tests_plain_automake:
458 @if grep -v '^#' $(srcdir)/tests/*.test | grep -E ':[ ]*automake\>([^:]|$$)'; then \
459 echo 'Do not run "automake" in the above tests. Use "$$AUTOMAKE" instead.' 1>&2; \
463 ## Tests should never call autoheader directly.
464 sc_tests_plain_autoheader:
465 @if grep -v '^#' $(srcdir)/tests/*.test | grep ':[ ]*autoheader\>'; then \
466 echo 'Do not run "automake" in the above tests. Use "$$AUTOHEADER" instead.' 1>&2; \
470 ## Tests should never call autoreconf directly.
471 sc_tests_plain_autoreconf:
472 @if grep -v '^#' $(srcdir)/tests/*.test | grep ':[ ]*autoreconf\>'; then \
473 echo 'Do not run "automake" in the above tests. Use "$$AUTORECONF" instead.' 1>&2; \
477 ## Tests should never call autom4te directly.
478 sc_tests_plain_autom4te:
479 @if grep -v '^#' $(srcdir)/tests/*.test | grep ':[ ]*autom4te\>'; then \
480 echo 'Do not run "automake" in the above tests. Use "$$AUTOM4TE" instead.' 1>&2; \
484 ## Tests should only use END and EOF for here documents
485 ## (so that the next test is effective).
486 sc_tests_here_document_format:
487 @if grep '<<' $(srcdir)/tests/*.test | grep -v 'END' | grep -v 'EOF'; then \
488 echo 'Use here documents with "END" and "EOF" only, for greppability.' 1>&2; \
492 ## Tests should never call exit directly, but use Exit.
493 ## This is so that the exit status is transported correctly across the 0 trap.
494 ## Ignore comments, testsuite self tests, and one perl line in ext2.test.
495 sc_tests_Exit_not_exit:
496 @found=false; for file in $(srcdir)/tests/*.test; do \
497 case $$file in */self-check-*.test) continue;; esac; \
498 res=`sed -n -e '/^#/d; /^\$$PERL/d' -e '/<<.*END/,/^END/b' \
499 -e '/<<.*EOF/,/^EOF/b' -e '/exit [$$0-9]/p' $$file`; \
500 if test -n "$$res"; then \
501 echo "$$file:$$res"; \
506 echo 'Do not call plain "exit", use "Exit" instead, in above tests.' 1>&2; \
510 ## Use AUTOMAKE_fails when appropriate
511 sc_tests_automake_fails:
512 @if grep -v '^#' $(srcdir)/tests/*.test | grep '\$$AUTOMAKE.*&&.*[eE]xit'; then \
513 echo 'Use AUTOMAKE_fails + grep to catch automake failures in the above tests.' 1>&2; \
517 ## Tests should never call aclocal directly.
518 sc_tests_plain_aclocal:
519 @if grep -v '^#' $(srcdir)/tests/*.test | grep ':[ ]*aclocal\>'; then \
520 echo 'Do not run "aclocal" in the above tests. Use "$$ACLOCAL" instead.' 1>&2; \
524 ## Tests should never call perl directly.
526 @if grep -v '^#' $(srcdir)/tests/*.test | grep ':[ ]*perl\>'; then \
527 echo 'Do not run "perl" in the above tests. Use "$$PERL" instead.' 1>&2; \
531 ## Setting `required' after sourcing `./defs' is a bug.
532 sc_tests_required_after_defs:
533 @for file in $(srcdir)/tests/*.test; do \
534 if out=`sed -n '/defs/,$${/required=/p;}' $$file`; test -n "$$out"; then \
535 echo 'Do not set "required" after sourcing "defs" in '"$$file: $$out" 1>&2; \
540 ## Overriding a Makefile macro on the command line is not portable when
541 ## recursive targets are used. Better use an envvar. SHELL is an
542 ## exception, POSIX says it can't come from the environment. DESTDIR and
543 ## DISTCHECK_CONFIGURE_FLAGS and V are exceptions, too, as package authors
544 ## are urged not to initialize them anywhere.
545 sc_tests_overriding_macros_on_cmdline:
546 @if grep -E '\$$MAKE .*(SHELL=.*=|=.*SHELL=)' $(srcdir)/tests/*.test; then \
547 echo 'Rewrite "$$MAKE foo=bar SHELL=$$SHELL" as "foo=bar $$MAKE -e SHELL=$$SHELL"' 1>&2; \
548 echo ' in the above lines, it is more portable.' 1>&2; \
551 @if sed -e 's/ DESTDIR=[^ ]*/ /' -e 's/ SHELL=[^ ]*/ /' \
552 -e 's/ V=[^ ]*/ /' -e 's///' \
553 ## DISTCHECK_CONFIGURE_FLAGS is allowed to contain whitespace in its
554 ## definition, so the more complex substitutions below.
555 -e "s/ DISTCHECK_CONFIGURE_FLAGS='[^']*'/ /" \
556 -e 's/ DISTCHECK_CONFIGURE_FLAGS="[^"]*"/ /' \
557 -e 's/ DISTCHECK_CONFIGURE_FLAGS=[^ ]/ /' \
558 $(srcdir)/tests/*.test | grep '\$$MAKE .*='; then \
559 echo 'Rewrite "$$MAKE foo=bar" as "foo=bar $$MAKE -e" in the above lines,' 1>&2; \
560 echo 'it is more portable.' 1>&2; \
563 @if grep 'SHELL=.*\$$MAKE' $(srcdir)/tests/*.test; then \
564 echo '$$MAKE ignores the SHELL envvar, use "$$MAKE SHELL=$$SHELL" in' 1>&2; \
565 echo 'the above lines.' 1>&2; \
569 ## Never use `sleep 1' to create files with different timestamps.
570 ## Use `$sleep' instead. Some filesystems (e.g., Windows') have only
571 ## a 2sec resolution.
572 sc_tests_plain_sleep:
573 @if grep -E '\bsleep +[12345]\b' $(srcdir)/tests/*.test; then \
574 echo 'Do not use "sleep x" in the above tests. Use "$$sleep" instead.' 1>&2; \
578 ## fgrep and egrep are not required by POSIX.
579 sc_tests_plain_egrep_fgrep:
580 @if grep -E '\b[ef]grep\b' $(srcdir)/tests/*.test ; then \
581 echo 'Do not use egrep or fgrep in test cases. Use $$FGREP or $$EGREP.' 1>&2; \
584 @if grep -E '\b[ef]grep\b' $(srcdir)/lib/am/*.am $(srcdir)/m4/*.m4; then \
585 echo 'Do not use egrep or fgrep in the above files, they are not portable.' 1>&2; \
589 ## Rule to ensure that the testsuite has been run before. We don't depend on `check'
590 ## here, because that would be very wasteful in the common case. We could run
591 ## `make check RECHECK_LOGS=' and avoid toplevel races with AM_RECURSIVE_TARGETS.
592 ## Suggest keeping test directories around for greppability of the Makefile.in files.
593 sc_ensure_testsuite_has_run:
594 @if test ! -f tests/test-suite.log; then \
595 echo "Run \`env keep_testdirs=yes make check' before \`maintainer-check'" >&2; \
598 .PHONY: sc_ensure_testsuite_has_run
600 ## Ensure our warning and error messages do not contain duplicate 'warning:' prefixes.
601 ## This test actually depends on the testsuite having been run before.
602 sc_tests_logs_duplicate_prefixes: sc_ensure_testsuite_has_run
603 @if grep -E '(warning|error):.*(warning|error):' tests/*.log; then \
604 echo 'Duplicate warning/error message prefixes seen in above tests.' >&2; \
608 ## Ensure variables are listed before rules in Makefile.in files we generate.
609 sc_tests_makefile_variable_order: sc_ensure_testsuite_has_run
610 @for file in `find tests -name Makefile.in -print`; do \
613 -e '/\\\\$$/{' -e N -e 'b x' -e '}' \
616 ## Allow @ so we match conditionals.
617 -e '/^ *[a-zA-Z_@]\{1,\} *=/p' $$file`; \
618 if test -n "$$latevars"; then \
619 echo 'Ensure variables are expanded before rules' >&2; \
620 echo "Variables are expanded too late in $$file:" >&2; \
621 echo "$$latevars" | sed 's/^/ /' >&2; \
626 ## Using `:' as a PATH separator is not portable.
627 sc_tests_PATH_SEPARATOR:
628 @if grep -E '\bPATH=.*:.*' $(srcdir)/tests/*.test ; then \
629 echo "Use \`\$$PATH_SEPARATOR', not \`:', in PATH definitions above." 1>&2; \
634 @if grep 'mkdir_p' $(srcdir)/automake.in \
635 $(srcdir)/lib/am/*.am $(srcdir)/tests/*.test; then \
636 echo 'Do not use mkdir_p in the above files, use MKDIR_P.' 1>&2; \
640 ## Try to make sure all @...@ substitutions are covered by our
641 ## substitution rule.
643 @if test `grep -E '^[^#]*@[A-Za-z_0-9]+@' aclocal | wc -l` -ne 0; then \
644 echo "Unresolved @...@ substitution in aclocal" 1>&2; \
647 @if test `grep -E '^[^#]*@[A-Za-z_0-9]+@' automake | wc -l` -ne 0; then \
648 echo "Unresolved @...@ substitution in automake" 1>&2; \
653 @if grep -E "[^\'\"]\\\$$\(DESTDIR" $(srcdir)/lib/am/*.am; then \
654 echo 'Suspicious unquoted DESTDIR uses.' 1>&2 ; \
659 @if grep ' ' $(srcdir)/doc/automake.texi; then \
660 echo 'Do not use tabs in the manual.' 1>&2; \
665 @if grep -E '([^@]|^)@([ ][^@]|$$)' $(srcdir)/doc/automake.texi; \
667 echo 'Unescaped @.' 1>&2; \
672 git-dist: maintainer-check
673 ## Make sure the NEWS file is up-to-date.
674 @if sed 1q $(srcdir)/NEWS | grep -e "$(VERSION)" > /dev/null; then :; else \
675 echo "NEWS not updated; not releasing" 1>&2; \
678 ## Build the distribution
679 $(MAKE) $(AM_MAKEFLAGS) distcheck
680 ## Finally, if anything was successful, commit the last changes and tag
681 ## the release in the repository. We don't use RCS keywords so it's OK
682 ## to distribute the files before they were committed.
683 $(am__cd) $(srcdir) && git commit -a -s && \
684 git tag -s "v$(VERSION)" -m "Release $(VERSION)"
686 git-release: git-dist
688 *[a-z]) dest=alpha;; \
691 $(srcdir)/lib/gnupload $(GNUPLOADFLAGS) \
692 --to $$dest.gnu.org:automake $(DIST_ARCHIVES)
695 thisver="v$(VERSION)"; \
696 if test -z "$$OLDVERSION"; then \
697 prevno=`echo "$(VERSION)" - 0.01 | bc | sed 's/^\./0./'`; \
698 else prevno="$$OLDVERSION"; fi; \
700 git diff $$prevver..$$thisver $(PACKAGE) \
701 > $(PACKAGE)-$$prevno-$(VERSION).diff
703 ## Check our path lengths.
705 ($(am__cd) $(distdir) && \
706 ## FIXME there's got to be a better way! pathchk should take the list
707 ## of files on stdin, at least.
708 find . -print | xargs pathchk -p); \
710 find $(distdir) -type d '!' -perm -200 -exec chmod u+w {} ';'; \
714 ## Program to use to fetch files.
716 WGET_SV_CVS = $(WGET) http://savannah.gnu.org/cgi-bin/viewcvs/~checkout~/
717 WGET_SV_GIT_CF = $(WGET) 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;hb=HEAD;f='
718 WGET_SV_GIT_AC = $(WGET) 'http://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=blob_plain;hb=HEAD;f='
719 WGET_SV_GIT_GL = $(WGET) 'http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob_plain;hb=HEAD;f='
720 WGET_GCC = $(WGET) 'http://gcc.gnu.org/viewcvs/*checkout*/trunk/'
722 ## Files that we fetch and which we compare against.
723 ## FIXME should be a lot more here
732 ## Fetch the latest versions of files we care about.
734 rm -rf Fetchdir > /dev/null 2>&1
736 ## If a get fails then that is a problem.
737 ($(am__cd) Fetchdir && \
738 $(WGET_SV_GIT_CF)config.guess -O config.guess && \
739 $(WGET_SV_GIT_CF)config.sub -O config.sub && \
740 $(WGET_SV_CVS)texinfo/texinfo/doc/texinfo.tex -O texinfo.tex && \
741 $(WGET_SV_GIT_GL)doc/INSTALL -O INSTALL && \
742 $(WGET_GCC)config-ml.in -O config-ml.in && \
743 $(WGET_GCC)symlink-tree -O symlink-tree)
744 ## Don't exit after test because we want to give as many errors as
746 @stat=0; for file in $(FETCHFILES); do \
747 if diff -u $(srcdir)/lib/$$file Fetchdir/$$file \
748 >>Fetchdir/update.patch 2>/dev/null; then :; \
751 echo "Updating $(srcdir)/lib/$$file ..."; \
752 cp Fetchdir/$$file $(srcdir)/lib/$$file; \
756 echo "See Fetchdir/update.patch for a log of the changes."; \
759 ## Generate release statistics, for the table in automake.texi.
760 ## This has to be run in an up to date build tree, but there must
761 ## be no temp files nor unused other files lying around!
763 @am=`wc -l < automake` && \
764 acl=`wc -l < aclocal` && \
765 pmfiles="lib/Automake/*.pm" && \
766 if test . != '$(srcdir)'; then pmfiles="$$pmfiles $(srcdir)/lib/Automake/*.pm"; \
768 pm=`cat $$pmfiles | wc -l` && \
769 dot_am_files=`ls -1 $(srcdir)/lib/am/*.am | grep -v Makefile.am` && \
770 amf=`echo "$$dot_am_files" | wc -l` && \
771 aml=`cat $$dot_am_files | wc -l` && \
772 m4f=`ls -1 $(srcdir)/m4/*.m4 | wc -l` && \
773 m4l=`cat $(srcdir)/m4/*.m4 | wc -l` && \
774 doc_text=`$(am__cd) doc && LC_ALL=C pstops 0 automake.ps unused.ps 2>&1` && \
775 echo "$$doc_text" && \
776 rm -f doc/unused.ps && \
777 doc=`echo "$$doc_text" | sed -n 's/.*Wrote \([1-9][0-9]*\) pages.*/\1/p'` && \
778 tests="tests/*.test"; \
779 if test . != '$(srcdir)'; then tests="$$tests $(srcdir)/tests/*.test"; \
781 t=`ls -1 $$tests | wc -l` && \
782 tgen=`grep 'GENERATED AUTOMATICALLY' $$tests | wc -l` && \
783 today=`date +%Y-%m-%d` && \
784 echo "add this to the table in doc/automake.texi after verification:" && \
785 printf '@item %s @tab %-6s @tab %4d @tab %4d @tab %4d @tab %4d %-4s @tab %4d %-4s @tab %3d @tab %d %-4s\n' \
786 $$today $(VERSION) $$am $$acl $$pm $$aml "($$amf)" $$m4l "($$m4f)" $$doc $$t "($$tgen)"
787 .PHONY: release-stats