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