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