Support more C++ file extensions for MSVC in the compile script.
[platform/upstream/automake.git] / Makefile.am
1 ## Process this file with automake to create Makefile.in
2
3 ## Makefile for Automake.
4
5 # Copyright (C) 1995, 1996, 1997, 1998, 1999, 2001, 2002, 2003, 2004,
6 # 2005, 2006, 2007, 2008, 2009, 2010  Free Software Foundation, Inc.
7
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2, or (at your option)
11 # any later version.
12
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 # GNU General Public License for more details.
17
18 # You should have received a copy of the GNU General Public License
19 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
20
21 ## lib goes first, because it builds Config.pm, used by aclocal and
22 ## automake (run in doc, tests, and in the rebuild rules.)
23 ## `.' goes before doc and tests, because the latter two directories
24 ## run aclocal and automake.
25 SUBDIRS = lib . doc m4 tests
26
27 bin_SCRIPTS = automake aclocal
28
29 CLEANFILES = $(bin_SCRIPTS)
30 AUTOMAKESOURCES = automake.in aclocal.in
31
32 TAGS_FILES = $(AUTOMAKESOURCES)
33
34 EXTRA_DIST = \
35   ChangeLog.96 \
36   ChangeLog.98 \
37   ChangeLog.00 \
38   ChangeLog.01 \
39   ChangeLog.02 \
40   ChangeLog.03 \
41   ChangeLog.04 \
42   ChangeLog.09 \
43   bootstrap \
44   $(AUTOMAKESOURCES)
45
46 ## Make versioned links.  We only run the transform on the root name;
47 ## then we make a versioned link with the transformed base name.  This
48 ## seemed like the most reasonable approach.
49 install-exec-hook:
50         @$(POST_INSTALL)
51         @for p in $(bin_SCRIPTS); do \
52           f="`echo $$p|sed '$(transform)'`"; \
53           fv="$$f-$(APIVERSION)"; \
54           rm -f $(DESTDIR)$(bindir)/$$fv; \
55           echo " $(LN) $(DESTDIR)$(bindir)/$$f $(DESTDIR)$(bindir)/$$fv"; \
56           $(LN) $(DESTDIR)$(bindir)/$$f $(DESTDIR)$(bindir)/$$fv; \
57         done
58
59 uninstall-hook:
60         @for p in $(bin_SCRIPTS); do \
61           f="`echo $$p|sed '$(transform)'`"; \
62           fv="$$f-$(APIVERSION)"; \
63           rm -f $(DESTDIR)$(bindir)/$$fv; \
64         done
65
66
67 ## We can't use configure to do the substitution here; we must do it
68 ## by hand.  We use a funny notation here to avoid configure
69 ## substitutions in our text.
70 do_subst = sed \
71   -e 's,[@]APIVERSION[@],$(APIVERSION),g' \
72   -e 's,[@]PACKAGE[@],$(PACKAGE),g' \
73   -e 's,[@]PACKAGE_BUGREPORT[@],$(PACKAGE_BUGREPORT),g' \
74   -e 's,[@]PACKAGE_URL[@],$(PACKAGE_URL),g' \
75   -e 's,[@]PATH_SEPARATOR[@],$(PATH_SEPARATOR),g' \
76   -e 's,[@]PERL[@],$(PERL),g' \
77   -e 's,[@]PERL_THREADS[@],$(PERL_THREADS),g' \
78   -e 's,[@]SHELL[@],$(SHELL),g' \
79   -e 's,[@]VERSION[@],$(VERSION),g' \
80   -e 's,[@]configure_input[@],Generated from $@.in; do not edit by hand.,g' \
81   -e 's,[@]datadir[@],$(datadir),g'
82
83 ## These files depend on Makefile so they are rebuilt if $(VERSION),
84 ## $(datadir) or other do_subst'ituted variables change.
85 ## Use chmod a-w to prevent people from editing the wrong file by accident.
86 automake: automake.in
87 aclocal: aclocal.in
88 automake aclocal: Makefile
89         rm -f $@ $@.tmp
90         $(do_subst) $(srcdir)/$@.in >$@.tmp
91         chmod +x $@.tmp
92         chmod a-w $@.tmp
93         mv -f $@.tmp $@
94
95 ## The master location for INSTALL is lib/INSTALL.
96 ## This is where `make fetch' will install new versions.
97 ## Make sure we also update this copy.
98 INSTALL: lib/INSTALL
99         cp $(srcdir)/lib/INSTALL $@
100
101 ################################################################
102 ##
103 ## Everything past here is useful to the maintainer, but probably not
104 ## to anybody else
105 ##
106
107 # Ensure tests are world-executable
108 dist-hook:
109         cd $(distdir)/tests && chmod a+rx *.test
110
111 # Some simple checks, and then ordinary check.  These are only really
112 # guaranteed to work on my machine.
113 syntax_check_rules = \
114 sc_diff_automake_in_automake \
115 sc_perl_syntax \
116 sc_no_brace_variable_expansions \
117 sc_rm_minus_f \
118 sc_no_for_variable_in_macro \
119 sc_mkinstalldirs \
120 sc_pre_normal_post_install_uninstall \
121 sc_perl_no_undef \
122 sc_perl_no_split_regex_space \
123 sc_cd_in_backquotes \
124 sc_cd_relative_dir \
125 sc_perl_at_uscore_in_scalar_context \
126 sc_perl_local_no_parens \
127 sc_perl_local \
128 sc_AMDEP_TRUE_in_automake_in \
129 sc_tests_make_without_am_makeflags \
130 sc_tests_plain_make \
131 sc_tests_plain_autoconf \
132 sc_tests_plain_autoupdate \
133 sc_tests_plain_automake \
134 sc_tests_here_document_format \
135 sc_tests_Exit_not_exit \
136 sc_tests_automake_fails \
137 sc_tests_plain_aclocal \
138 sc_tests_plain_perl \
139 sc_tests_required_after_defs \
140 sc_tests_overriding_macros_on_cmdline \
141 sc_tests_plain_sleep \
142 sc_tests_plain_egrep_fgrep \
143 sc_mkdir_p \
144 sc_perl_at_substs \
145 sc_unquoted_DESTDIR \
146 sc_tabs_in_texi \
147 sc_at_in_texi
148
149 .PHONY: $(syntax_check_rules)
150 $(syntax_check_rules): automake aclocal
151 maintainer-check: $(syntax_check_rules)
152
153 ## This check avoids accidental configure substitutions in the source.
154 ## There are exactly 8 lines that should be modified.  This works out
155 ## to 28 lines of diffs.
156 sc_diff_automake_in_automake:
157         @if test `diff $(srcdir)/automake.in automake | wc -l` -ne 28; then \
158           echo "found too many diffs between automake.in and automake" 1>&2; \
159           diff -c $(srcdir)/automake.in automake; \
160           exit 1; \
161         fi
162
163 ## Syntax check with default Perl (on my machine, Perl 5).
164 sc_perl_syntax:
165         perllibdir="./lib$(PATH_SEPARATOR)$(srcdir)/lib" $(PERL) -c -w automake
166         perllibdir="./lib$(PATH_SEPARATOR)$(srcdir)/lib" $(PERL) -c -w aclocal
167
168 ## expect no instances of '${...}'.  However, $${...} is ok, since that
169 ## is a shell construct, not a Makefile construct.
170 sc_no_brace_variable_expansions:
171         @if grep -F '$${' $(srcdir)/lib/am/[a-z]*.am | \
172                grep -F -v '$$$$'; then \
173           echo "Found too many uses of '\$${' in the lines above." 1>&2; \
174           exit 1;                               \
175         else :; fi
176
177 ## Make sure `rm' is called with `-f'.
178 sc_rm_minus_f:
179         @if grep -v '^#' $(srcdir)/lib/am/[a-z]*.am $(srcdir)/tests/*.test | \
180             grep -E '\<rm ([^-]|\-[^f ]*\>)'; then \
181           echo "Suspicious 'rm' invocation." 1>&2; \
182           exit 1;                               \
183         else :; fi
184
185 ## Never use something like `for file in $(FILES)', this doesn't work
186 ## if FILES is empty or if it contains shell meta characters (e.g. $ is
187 ## commonly used in Java filenames).
188 sc_no_for_variable_in_macro:
189         @if grep 'for .* in \$$(' $(srcdir)/lib/am/[a-z]*.am; then \
190           echo 'Use "list=$$(mumble); for var in $$$$list".' 1>&2 ; \
191           exit 1; \
192         else :; fi
193
194 ## Make sure all invocations of mkinstalldirs are correct.
195 sc_mkinstalldirs:
196         @if grep -n 'mkinstalldirs' $(srcdir)/lib/am/[a-z]*.am | \
197               grep -F -v '$$(mkinstalldirs)'; then \
198           echo "Found incorrect use of mkinstalldirs in the lines above" 1>&2; \
199           exit 1; \
200         else :; fi
201
202 ## Make sure all calls to PRE/NORMAL/POST_INSTALL/UNINSTALL
203 sc_pre_normal_post_install_uninstall:
204         @if grep -E -n '\((PRE|NORMAL|POST)_(|UN)INSTALL\)' \
205                  $(srcdir)/lib/am/[a-z]*.am | \
206               grep -v ':##' | grep -v ':        @\$$('; then \
207           echo "Found incorrect use of PRE/NORMAL/POST_INSTALL/UNINSTALL in the lines above" 1>&2; \
208           exit 1; \
209         else :; fi
210
211 ## We never want to use "undef", only "delete", but for $/.
212 sc_perl_no_undef:
213         @if grep -n -w 'undef ' $(srcdir)/automake.in | \
214               grep -F -v 'undef $$/'; then \
215           echo "Found undef in automake.in; use delete instead" 1>&2; \
216           exit 1; \
217         fi
218
219 ## We never want split (/ /,...), only split (' ', ...).
220 sc_perl_no_split_regex_space:
221         @if grep -n 'split (/ /' $(srcdir)/automake.in; then \
222           echo "Found bad split in the lines above." 1>&2; \
223           exit 1; \
224         fi
225
226 ## Look for cd within backquotes
227 sc_cd_in_backquotes:
228         @if grep -n '^[^#]*` *cd ' $(srcdir)/automake.in \
229               $(srcdir)/lib/am/*.am; then \
230           echo "Consider using \$$(am__cd) in the lines above." 1>&2; \
231           exit 1; \
232         fi
233
234 ## Look for cd to a relative directory (may be influenced by CDPATH).
235 ## Skip some known directories that are OK.
236 sc_cd_relative_dir:
237         @if grep -n '^[^#]*cd ' $(srcdir)/automake.in \
238               $(srcdir)/lib/am/*.am | \
239               grep -v 'echo.*cd ' | \
240               grep -v 'am__cd =' | \
241               grep -v '^[^#]*cd [./]' | \
242               grep -v '^[^#]*cd \$$(top_builddir)' | \
243               grep -v '^[^#]*cd "\$$\$$am__cwd' | \
244               grep -v '^[^#]*cd \$$(abs' | \
245               grep -v '^[^#]*cd "\$$(DESTDIR)'; then \
246           echo "Consider using \$$(am__cd) in the lines above." 1>&2; \
247           exit 1; \
248         fi
249
250 ## Using @_ in a scalar context is most probably a programming error.
251 sc_perl_at_uscore_in_scalar_context:
252         @if grep -Hn '[^@_A-Za-z0-9][_A-Za-z0-9]*[^) ] *= *@_' $(srcdir)/automake.in; then \
253           echo "Using @_ in a scalar context in the lines above." 1>&2; \
254           exit 1; \
255         fi
256
257 ## Forbid using parens with `local' to ease counting.
258 sc_perl_local_no_parens:
259         @if grep '^[ \t]*local *(' $(srcdir)/automake.in; then \
260           echo "Don't use \`local' with parens: use several \`local' above." >&2; \
261           exit 1; \
262         fi
263
264 ## Allow only `local $_' in Automake.
265 sc_perl_local:
266         @if grep -v '^[ \t]*local \$$_;' $(srcdir)/automake.in | \
267                 grep '^[ \t]*local [^*]'; then \
268           echo "Please avoid \`local'." 1>&2; \
269           exit 1; \
270         fi
271
272 ## Don't let AMDEP_TRUE substitution appear in automake.in.
273 sc_AMDEP_TRUE_in_automake_in:
274         @if grep '@AMDEP''_TRUE@' $(srcdir)/automake.in; then \
275           echo "Don't put AMDEP_TRUE substitution in automake.in" 1>&2; \
276           exit 1; \
277         fi
278
279 ## Tests should never call make directly.
280 sc_tests_make_without_am_makeflags:
281         @if grep '^[^#].*(MAKE) ' $(srcdir)/lib/am/*.am $(srcdir)/automake.in |\
282                 grep -v 'AM_MAKEFLAGS'; then \
283           echo 'Use $$(MAKE) $$(AM_MAKEFLAGS).' 1>&2; \
284           exit 1; \
285         fi
286
287 ## Tests should never call make directly.
288 sc_tests_plain_make:
289         @if grep -v '^#' $(srcdir)/tests/*.test | grep ':[      ]*make'; then \
290           echo 'Do not run "make" in the above tests.  Use "$$MAKE" instead.' 1>&2; \
291           exit 1; \
292         fi
293
294 ## Tests should never call autoconf directly.
295 sc_tests_plain_autoconf:
296         @if grep -v '^#' $(srcdir)/tests/*.test | grep ':[      ]*autoconf'; then \
297           echo 'Do not run "autoconf" in the above tests.  Use "$$AUTOCONF" instead.' 1>&2; \
298           exit 1; \
299         fi
300
301 ## Tests should never call autoupdate directly.
302 sc_tests_plain_autoupdate:
303         @if grep -v '^#' $(srcdir)/tests/*.test | grep ':[      ]*autoupdate'; then \
304           echo 'Do not run "autoupdate" in the above tests.  Use "$$AUTOUPDATE" instead.' 1>&2; \
305           exit 1; \
306         fi
307
308 ## Tests should never call automake directly.
309 sc_tests_plain_automake:
310         @if grep -v '^#' $(srcdir)/tests/*.test | grep -E ':[   ]*automake([^:]|$$)'; then \
311           echo 'Do not run "automake" in the above tests.  Use "$$AUTOMAKE" instead.' 1>&2;  \
312           exit 1; \
313         fi
314
315 ## Tests should only use END and EOF for here documents
316 ## (so that the next test is effective).
317 sc_tests_here_document_format:
318         @if grep '<<' $(srcdir)/tests/*.test | grep -v 'END' | grep -v 'EOF'; then \
319           echo 'Use here documents with "END" and "EOF" only, for greppability.' 1>&2; \
320           exit 1; \
321         fi
322
323 ## Tests should never call exit directly, but use Exit.
324 ## This is so that the exit status is transported correctly across the 0 trap.
325 ## Ignore comments, and ignore one perl line in ext2.test.
326 sc_tests_Exit_not_exit:
327         @found=false; for file in $(srcdir)/tests/*.test; do \
328           res=`sed -n -e '/^#/d; /^\$$PERL/d' -e '/<<.*END/,/^END/b' \
329                       -e '/<<.*EOF/,/^EOF/b' -e '/exit [$$0-9]/p' $$file`; \
330           if test -n "$$res"; then \
331             echo "$$file:$$res"; \
332             found=true; \
333           fi; \
334         done; \
335         if $$found; then \
336           echo 'Do not call plain "exit", use "Exit" instead, in above tests.' 1>&2; \
337           exit 1; \
338         fi
339
340 ## Use AUTOMAKE_fails when appropriate
341 sc_tests_automake_fails:
342         @if grep -v '^#' $(srcdir)/tests/*.test | grep '\$$AUTOMAKE.*&&.*[eE]xit'; then \
343           echo 'Use AUTOMAKE_fails + grep to catch automake failures in the above tests.' 1>&2;  \
344           exit 1; \
345         fi
346
347 ## Tests should never call aclocal directly.
348 sc_tests_plain_aclocal:
349         @if grep -v '^#' $(srcdir)/tests/*.test | grep ':[      ]*aclocal'; then \
350           echo 'Do not run "aclocal" in the above tests.  Use "$$ACLOCAL" instead.' 1>&2;  \
351           exit 1; \
352         fi
353
354 ## Tests should never call perl directly.
355 sc_tests_plain_perl:
356         @if grep -v '^#' $(srcdir)/tests/*.test | grep ':[      ]*perl'; then \
357           echo 'Do not run "perl" in the above tests.  Use "$$PERL" instead.' 1>&2; \
358           exit 1; \
359         fi
360
361 ## Setting `required' after sourcing `./defs' is a bug.
362 sc_tests_required_after_defs:
363         @for file in $(srcdir)/tests/*.test; do \
364           if out=`sed -n '/defs/,$${/required=/p;}' $$file`; test -n "$$out"; then \
365             echo 'Do not set "required" after sourcing "defs" in '"$$file: $$out" 1>&2; \
366             exit 1; \
367           fi; \
368         done
369
370 ## Overriding a Makefile macro on the command line is not portable when
371 ## recursive targets are used.  Better use an envvar.  SHELL is an exception,
372 ## POSIX says it can't come from the environment.  V and DESTDIRS are exceptions,
373 ## too, as package authors are urged not to initialize them anywhere.
374 sc_tests_overriding_macros_on_cmdline:
375         @if grep -E '\$$MAKE .*(SHELL=.*=|=.*SHELL=)' $(srcdir)/tests/*.test; then \
376           echo 'Rewrite "$$MAKE foo=bar SHELL=$$SHELL" as "foo=bar $$MAKE -e SHELL=$$SHELL"' 1>&2; \
377           echo ' in the above lines, it is more portable.' 1>&2; \
378           exit 1; \
379         fi
380         @if sed 's/DESTDIR=[^ ]*//; s/SHELL=[^ ]*//; s/V=[^ ]*//' $(srcdir)/tests/*.test | \
381             grep '\$$MAKE .*=' ; then \
382           echo 'Rewrite "$$MAKE foo=bar" as "foo=bar $$MAKE -e" in the above lines,' 1>&2; \
383           echo 'it is more portable.' 1>&2; \
384           exit 1; \
385         fi
386         @if grep 'SHELL=.*\$$MAKE' $(srcdir)/tests/*.test; then \
387           echo '$$MAKE ignores the SHELL envvar, use "$$MAKE SHELL=$$SHELL" in' 1>&2; \
388           echo 'the above lines.' 1>&2; \
389           exit 1; \
390         fi
391
392 ## Never use `sleep 1' to create files with different timestamps.
393 ## Use `$sleep' instead.  Some filesystems (e.g., Windows') have only
394 ## a 2sec resolution.
395 sc_tests_plain_sleep:
396         @if grep -E '\bsleep +[12345]\b' $(srcdir)/tests/*.test; then \
397           echo 'Do not use "sleep x" in the above tests.  Use "$$sleep" instead.' 1>&2; \
398           exit 1; \
399         fi
400
401 ## fgrep and egrep are not required by POSIX.
402 sc_tests_plain_egrep_fgrep:
403         @if grep -E '\b[ef]grep\b' $(srcdir)/tests/*.test ; then \
404           echo 'Do not use egrep or fgrep in test cases.  Use $$FGREP or $$EGREP.' 1>&2; \
405           exit 1; \
406         fi
407         @if grep -E '\b[ef]grep\b' $(srcdir)/lib/am/*.am $(srcdir)/m4/*.m4; then \
408           echo 'Do not use egrep or fgrep in the above files, they are not portable.' 1>&2; \
409           exit 1; \
410         fi
411
412 sc_mkdir_p:
413         @if grep 'mkdir_p' $(srcdir)/automake.in \
414               $(srcdir)/lib/am/*.am $(srcdir)/tests/*.test; then \
415           echo 'Do not use mkdir_p in the above files, use MKDIR_P.' 1>&2; \
416           exit 1; \
417         fi
418
419 ## Try to make sure all @...@ substitutions are covered by our
420 ## substitution rule.
421 sc_perl_at_substs:
422         @if test `grep -E '^[^#]*@[A-Za-z_0-9]+@' aclocal | wc -l` -ne 0; then \
423           echo "Unresolved @...@ substitution in aclocal" 1>&2; \
424           exit 1; \
425         fi
426         @if test `grep -E '^[^#]*@[A-Za-z_0-9]+@' automake | wc -l` -ne 0; then \
427           echo "Unresolved @...@ substitution in automake" 1>&2; \
428           exit 1; \
429         fi
430
431 sc_unquoted_DESTDIR:
432         @if grep -E "[^\'\"]\\\$$\(DESTDIR" $(srcdir)/lib/am/*.am; then \
433           echo 'Suspicious unquoted DESTDIR uses.' 1>&2 ; \
434           exit 1; \
435         fi
436
437 sc_tabs_in_texi:
438         @if grep '      ' $(srcdir)/doc/automake.texi; then \
439           echo 'Do not use tabs in the manual.' 1>&2; \
440           exit 1; \
441         fi
442
443 sc_at_in_texi:
444         @if grep -E '([^@]|^)@([         ][^@]|$$)' $(srcdir)/doc/automake.texi; \
445         then \
446           echo 'Unescaped @.' 1>&2; \
447           exit 1; \
448         fi
449
450
451 git-dist: maintainer-check
452 ## Make sure the NEWS file is up-to-date.
453         @if sed 1q $(srcdir)/NEWS | grep -e "$(VERSION)" > /dev/null; then :; else \
454           echo "NEWS not updated; not releasing" 1>&2; \
455           exit 1;                               \
456         fi
457 ## Build the distribution
458         $(MAKE) $(AM_MAKEFLAGS) distcheck
459 ## Finally, if anything was successful, commit the last changes and tag
460 ## the release in the repository.  We don't use RCS keywords so it's OK
461 ## to distribute the files before they were committed.
462         cd $(srcdir) && git commit -a -s && \
463            git tag -s "v$(VERSION)" -m "Release $(VERSION)"
464
465 git-release: git-dist
466         case $(VERSION) in \
467           *[a-z]) dest=alpha;; \
468           *)      dest=ftp;; \
469         esac; \
470         $(srcdir)/lib/gnupload $(GNUPLOADFLAGS) \
471           --to $$dest.gnu.org:automake $(DIST_ARCHIVES)
472
473 git-diff:
474         thisver="v$(VERSION)"; \
475         if test -z "$$OLDVERSION"; then \
476           prevno=`echo "$(VERSION)" - 0.01 | bc | sed 's/^\./0./'`; \
477         else prevno="$$OLDVERSION"; fi; \
478         prevver=v$$prevno; \
479         git diff $$prevver..$$thisver $(PACKAGE) \
480             > $(PACKAGE)-$$prevno-$(VERSION).diff
481
482 ## Check our path lengths.
483 path-check: distdir
484         (cd $(distdir) && \
485 ## FIXME there's got to be a better way!  pathchk should take the list
486 ## of files on stdin, at least.
487           find . -print | xargs pathchk -p); \
488           estatus=$$?; \
489           find $(distdir) -type d '!' -perm -200 -exec chmod u+w {} ';'; \
490           rm -rf $(distdir); \
491           exit $$estatus
492
493 ## Program to use to fetch files.
494 WGET = wget
495 WGET_SV_CVS = $(WGET) http://savannah.gnu.org/cgi-bin/viewcvs/~checkout~/
496 WGET_SV_GIT_CF = $(WGET) 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;hb=HEAD;f='
497 WGET_SV_GIT_AC = $(WGET) 'http://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=blob_plain;hb=HEAD;f='
498 WGET_SV_GIT_GL = $(WGET) 'http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob_plain;hb=HEAD;f='
499 WGET_GCC = $(WGET) 'http://gcc.gnu.org/viewcvs/*checkout*/trunk/'
500
501 ## Files that we fetch and which we compare against.
502 ## FIXME should be a lot more here
503 FETCHFILES = \
504 INSTALL \
505 config-ml.in \
506 config.guess \
507 config.sub \
508 symlink-tree \
509 texinfo.tex
510
511 ## Fetch the latest versions of files we care about.
512 fetch:
513         rm -rf Fetchdir > /dev/null 2>&1
514         mkdir Fetchdir
515 ## If a get fails then that is a problem.
516         (cd Fetchdir && \
517         $(WGET_SV_GIT_CF)config.guess -O config.guess && \
518         $(WGET_SV_GIT_CF)config.sub -O config.sub && \
519         $(WGET_SV_CVS)texinfo/texinfo/doc/texinfo.tex -O texinfo.tex && \
520         $(WGET_SV_GIT_GL)doc/INSTALL -O INSTALL && \
521         $(WGET_GCC)config-ml.in -O config-ml.in && \
522         $(WGET_GCC)symlink-tree -O symlink-tree)
523 ## Don't exit after test because we want to give as many errors as
524 ## possible.
525         @stat=0; for file in $(FETCHFILES); do \
526           if diff -u $(srcdir)/lib/$$file Fetchdir/$$file \
527                   >>Fetchdir/update.patch 2>/dev/null; then :; \
528           else \
529             stat=1; \
530             echo "Updating $(srcdir)/lib/$$file..."; \
531             cp Fetchdir/$$file $(srcdir)/lib/$$file; \
532           fi; \
533         done; \
534         test $$stat = 0 || \
535           echo "See Fetchdir/update.patch for a log of the changes."; \
536         exit $$stat
537
538 ## Generate release statistics, for the table in automake.texi.
539 ## This has to be run in an up to date build tree, but there must
540 ## be no temp files nor unused other files lying around!
541 release-stats: ps
542         @am=`wc -l < automake` && \
543         acl=`wc -l < aclocal` && \
544         pmfiles="lib/Automake/*.pm" && \
545         if test . != '$(srcdir)'; then pmfiles="$$pmfiles $(srcdir)/lib/Automake/*.pm"; \
546         else :; fi && \
547         pm=`cat $$pmfiles | wc -l` && \
548         dot_am_files=`ls -1 $(srcdir)/lib/am/*.am | grep -v Makefile.am` && \
549         amf=`echo "$$dot_am_files" | wc -l` && \
550         aml=`cat $$dot_am_files | wc -l` && \
551         m4f=`ls -1 $(srcdir)/m4/*.m4 | wc -l` && \
552         m4l=`cat $(srcdir)/m4/*.m4 | wc -l` && \
553         doc_text=`cd doc && LC_ALL=C pstops 0 automake.ps unused.ps 2>&1` && \
554         echo "$$doc_text" && \
555         rm -f doc/unused.ps && \
556         doc=`echo "$$doc_text" | sed -n 's/.*Wrote \([1-9][0-9]*\) pages.*/\1/p'` && \
557         tests="tests/*.test"; \
558         if test . != '$(srcdir)'; then tests="$$tests $(srcdir)/tests/*.test"; \
559         else :; fi && \
560         t=`ls -1 $$tests | wc -l` && \
561         tgen=`ls -1 $$tests | grep '.-p\.test' | wc -l` && \
562         today=`date +%Y-%m-%d` && \
563         echo "add this to the table in doc/automake.texi after verification:" && \
564         printf '@item %s @tab %-6s @tab %4d @tab %4d @tab %4d @tab %4d %-4s @tab %4d %-4s @tab %3d @tab %d %-4s\n' \
565                       $$today $(VERSION) $$am    $$acl    $$pm   $$aml "($$amf)" $$m4l "($$m4f)" $$doc $$t "($$tgen)"
566 .PHONY: release-stats