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