build: auto-generate perl subroutines prototypes for automake and aclocal
[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-2013 Free Software Foundation, Inc.
6
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2, or (at your option)
10 # any later version.
11
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 # GNU General Public License for more details.
16
17 # You should have received a copy of the GNU General Public License
18 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
19
20 ## Might be updated later.
21 CLEANFILES =
22 DISTCLEANFILES =
23 MAINTAINERCLEANFILES =
24 EXTRA_DIST =
25
26 ## ------------ ##
27 ##  Top level.  ##
28 ## ------------ ##
29
30 # We want a handful of substitutions to be fully-expanded by make;
31 # then use config.status to substitute the remainder where a single
32 # expansion is sufficient.  We use a funny notation here to avoid
33 # configure substitutions in our text.
34 do_subst = ( sed \
35   -e "s,[@]configure_input[@],Generated from $$in; do not edit by hand.,g" \
36   -e 's,[@]datadir[@],$(datadir),g' \
37   -e 's,[@]amdir[@],$(amdir),g' \
38   -e 's,[@]bindir[@],$(bindir),g' \
39   -e 's,[@]docdir[@],$(docdir),g' \
40   -e 's,[@]pkgvdatadir[@],$(pkgvdatadir),g' \
41   -e 's,[@]scriptdir[@],$(scriptdir),g' \
42   -e 's,[@]automake_acdir[@],$(automake_acdir),g' \
43   -e 's,[@]system_acdir[@],$(system_acdir),g' \
44 ## Hack to avoid a spurious substitution in the Automake script (part 1).
45   -e 's,[@]am__isrc[@],!!@!!am__isrc!!@!!,g' \
46   | $(SHELL) ./config.status --file=- \
47 ## Hack to avoid a spurious substitution in the Automake script (part 2).
48   | sed -e 's,!!@!!am__isrc!!@!!,@''am__isrc@,g' \
49   )
50
51 # Generated  files shouldn't contain unexpanded '@substitutions@', and
52 # should be made read-only, to prevent them from being edited by mistake
53 # instead of the file the are generated from.
54 generated_file_finalize = $(AM_V_at) \
55   if LC_ALL=C grep '@[a-zA-Z0-9_][a-zA-Z0-9_]*@' $@-t; then \
56     echo "$@ contains unexpanded substitution (see lines above)"; \
57     exit 1; \
58   fi; \
59   chmod a-w $@-t && mv -f $@-t $@
60
61 bin_SCRIPTS = automake aclocal
62
63 CLEANFILES += $(bin_SCRIPTS)
64 AUTOMAKESOURCES = automake.in aclocal.in
65
66 TAGS_FILES = $(AUTOMAKESOURCES)
67
68 EXTRA_DIST += \
69   $(AUTOMAKESOURCES) \
70   bootstrap.sh \
71   GNUmakefile \
72   HACKING \
73   PLANS
74
75 # Make versioned links.  We only run the transform on the root name;
76 # then we make a versioned link with the transformed base name.  This
77 # seemed like the most reasonable approach.
78 install-exec-hook:
79         @$(POST_INSTALL)
80         @for p in $(bin_SCRIPTS); do \
81           f=`echo $$p | sed '$(transform)'`; \
82           fv="$$f-$(APIVERSION)"; \
83           rm -f "$(DESTDIR)$(bindir)/$$fv"; \
84           echo " $(LN) '$(DESTDIR)$(bindir)/$$f' '$(DESTDIR)$(bindir)/$$fv'"; \
85           $(LN) "$(DESTDIR)$(bindir)/$$f" "$(DESTDIR)$(bindir)/$$fv"; \
86         done
87
88 uninstall-hook:
89         @for p in $(bin_SCRIPTS); do \
90           f=`echo $$p | sed '$(transform)'`; \
91           fv="$$f-$(APIVERSION)"; \
92           rm -f "$(DESTDIR)$(bindir)/$$fv"; \
93         done
94
95 # These files depend on Makefile so they are rebuilt if $(VERSION),
96 # $(datadir) or other do_subst'ituted variables change.
97 automake: automake.in
98 aclocal: aclocal.in
99 automake aclocal: Makefile lib/gen-perl-protos
100         $(AM_V_GEN)rm -f $@ $@-t $@-t2 \
101 ## Common substitutions.
102           && in=$@.in && $(do_subst) <$(srcdir)/$$in >$@-t \
103 ## Auto-compute prototypes of perl subroutines.
104           && $(PERL) -w $(srcdir)/lib/gen-perl-protos $@-t > $@-t2 \
105           && mv -f $@-t2 $@-t \
106 ## We can't use '$(generated_file_finalize)' here, because currently
107 ## Automake contains occurrences of unexpanded @substitutions@ in
108 ## comments, and that is perfectly legit.
109           && chmod a+x,a-w $@-t && mv -f $@-t $@
110 EXTRA_DIST += lib/gen-perl-protos
111
112 # The master location for INSTALL is lib/INSTALL.
113 # This is where "make fetch" will install new versions.
114 # Make sure we also update this copy.
115 INSTALL: lib/INSTALL
116         $(AM_V_GEN)cp $(srcdir)/lib/INSTALL $@
117
118 # We don't use the default name for the autom4te cache directory,
119 # so we need this.
120 maintainer-clean-local:
121         rm -rf .autom4te.cache
122
123 # So that automake won't complain about the missing ChangeLog.
124 # The real rule for ChangeLog generation is now in maintainer/maint.mk
125 # (as it is maintainer-specific).
126 ChangeLog:
127
128
129 ## -------------------------------------------------------------------- ##
130 ##  Auxiliary scripts and files for use with "automake --add-missing".  ##
131 ## -------------------------------------------------------------------- ##
132
133 dist_pkgvdata_DATA = \
134   lib/COPYING \
135   lib/INSTALL \
136   lib/texinfo.tex
137
138 # These must all be executable when installed.  However, if we use
139 # _SCRIPTS, then the program transform will be applied, which is not
140 # what we want.  So we make them executable by hand.
141 dist_script_DATA = \
142   lib/config.guess \
143   lib/config.sub \
144   lib/install-sh \
145   lib/mdate-sh \
146   lib/missing \
147   lib/mkinstalldirs \
148   lib/ylwrap \
149   lib/depcomp \
150   lib/compile \
151   lib/py-compile \
152   lib/ar-lib \
153   lib/test-driver \
154   lib/tap-driver.sh \
155   lib/tap-driver.pl
156
157 install-data-hook:
158         @$(POST_INSTALL)
159         @for f in $(dist_script_DATA); do echo $$f; done \
160           | sed 's,^lib/,,' \
161           | ( st=0; \
162               while read f; do \
163                 echo " chmod +x '$(DESTDIR)$(scriptdir)/$$f'"; \
164                 chmod +x "$(DESTDIR)$(scriptdir)/$$f" || st=1; \
165               done; \
166               exit $$st )
167
168 installcheck-local: installcheck-executable-scripts
169 installcheck-executable-scripts:
170         @for f in $(dist_script_DATA); do echo $$f; done \
171           | sed 's,^lib/,,' \
172           | while read f; do \
173               path="$(pkgvdatadir)/$$f"; \
174               test -x "$$path" || echo $$path; \
175             done \
176           | sed 's/$$/: not executable/' \
177           | grep . 1>&2 && exit 1; exit 0
178
179
180 ## ---------------------------------------------------- ##
181 ##  Private perl modules used by automake and aclocal.  ##
182 ## ---------------------------------------------------- ##
183
184 perllibdir = $(pkgvdatadir)/Automake
185 dist_perllib_DATA = \
186   lib/Automake/ChannelDefs.pm \
187   lib/Automake/Channels.pm \
188   lib/Automake/Condition.pm \
189   lib/Automake/Configure_ac.pm \
190   lib/Automake/DisjConditions.pm \
191   lib/Automake/FileUtils.pm \
192   lib/Automake/General.pm \
193   lib/Automake/Getopt.pm \
194   lib/Automake/Item.pm \
195   lib/Automake/ItemDef.pm \
196   lib/Automake/Language.pm \
197   lib/Automake/Location.pm \
198   lib/Automake/Options.pm \
199   lib/Automake/Rule.pm \
200   lib/Automake/RuleDef.pm \
201   lib/Automake/Variable.pm \
202   lib/Automake/VarDef.pm \
203   lib/Automake/Version.pm \
204   lib/Automake/XFile.pm \
205   lib/Automake/Wrap.pm
206
207 nodist_perllib_DATA = lib/Automake/Config.pm
208 CLEANFILES += $(nodist_perllib_DATA)
209
210 lib/Automake/Config.pm: lib/Automake/Config.in Makefile
211         $(AM_V_at)rm -f $@ $@-t
212         $(AM_V_at)test -d lib/Automake || $(MKDIR_P) lib/Automake
213         $(AM_V_GEN)in=Config.in \
214           && $(do_subst) <$(srcdir)/lib/Automake/Config.in >$@-t
215         $(generated_file_finalize)
216 EXTRA_DIST += lib/Automake/Config.in
217
218
219 ## --------------------- ##
220 ##  Makefile fragments.  ##
221 ## --------------------- ##
222
223 dist_am_DATA = \
224   lib/am/check.am \
225   lib/am/check2.am \
226   lib/am/clean-hdr.am \
227   lib/am/clean.am \
228   lib/am/compile.am \
229   lib/am/configure.am \
230   lib/am/data.am \
231   lib/am/dejagnu.am \
232   lib/am/depend.am \
233   lib/am/depend2.am \
234   lib/am/distdir.am \
235   lib/am/footer.am \
236   lib/am/header-vars.am \
237   lib/am/header.am \
238   lib/am/install.am \
239   lib/am/inst-vars.am \
240   lib/am/java.am \
241   lib/am/lang-compile.am \
242   lib/am/lex.am \
243   lib/am/library.am \
244   lib/am/libs.am \
245   lib/am/libtool.am \
246   lib/am/lisp.am \
247   lib/am/ltlib.am \
248   lib/am/ltlibrary.am \
249   lib/am/mans-vars.am \
250   lib/am/mans.am \
251   lib/am/program.am \
252   lib/am/progs.am \
253   lib/am/python.am \
254   lib/am/remake-hdr.am \
255   lib/am/scripts.am \
256   lib/am/subdirs.am \
257   lib/am/tags.am \
258   lib/am/texi-vers.am \
259   lib/am/texibuild.am \
260   lib/am/texinfos.am \
261   lib/am/vala.am \
262   lib/am/yacc.am
263
264
265 ## ------------------------------ ##
266 ##  Automake-provided m4 macros.  ##
267 ## ------------------------------ ##
268
269 dist_automake_ac_DATA = \
270   m4/amversion.m4 \
271   m4/ar-lib.m4 \
272   m4/as.m4 \
273   m4/auxdir.m4 \
274   m4/cond.m4 \
275   m4/cond-if.m4 \
276   m4/depend.m4 \
277   m4/depout.m4 \
278   m4/dmalloc.m4 \
279   m4/extra-recurs.m4 \
280   m4/gcj.m4 \
281   m4/init.m4 \
282   m4/install-sh.m4 \
283   m4/lead-dot.m4 \
284   m4/lex.m4 \
285   m4/lispdir.m4 \
286   m4/maintainer.m4 \
287   m4/make.m4 \
288   m4/minuso.m4 \
289   m4/missing.m4 \
290   m4/mkdirp.m4 \
291   m4/obsolete.m4 \
292   m4/options.m4 \
293   m4/python.m4 \
294   m4/runlog.m4 \
295   m4/sanity.m4 \
296   m4/silent.m4 \
297   m4/strip.m4 \
298   m4/substnot.m4 \
299   m4/tar.m4 \
300   m4/upc.m4 \
301   m4/vala.m4
302
303 automake_internal_acdir = $(automake_acdir)/internal
304 dist_automake_internal_ac_DATA = m4/internal/ac-config-macro-dirs.m4
305
306 dist_system_ac_DATA = m4/acdir/README
307
308 # We build amversion.m4 here, instead of from config.status,
309 # because config.status is rerun each time one of configure's
310 # dependencies change and amversion.m4 happens to be a configure
311 # dependency.  configure and amversion.m4 would be rebuilt in
312 # loop otherwise.
313 # Use '$(top_srcdir)/m4' for the benefit of non-GNU makes: this is
314 # how amversion.m4 appears in our dependencies.
315 $(top_srcdir)/m4/amversion.m4: $(srcdir)/configure.ac $(srcdir)/m4/amversion.in
316         $(AM_V_at)rm -f $@-t $@
317         $(AM_V_GEN)in=amversion.in \
318           && $(do_subst) <$(srcdir)/m4/amversion.in >$@-t
319         $(generated_file_finalize)
320 EXTRA_DIST += m4/amversion.in
321
322
323 ## ------------ ##
324 ##  Testsuite.  ##
325 ## ------------ ##
326
327 # Run the tests with a proper shell detected at configure time.
328 LOG_COMPILER = $(AM_TEST_RUNNER_SHELL)
329
330 TEST_EXTENSIONS = .pl .sh .tap
331 SH_LOG_COMPILER = $(LOG_COMPILER)
332 TAP_LOG_COMPILER = $(LOG_COMPILER)
333 PL_LOG_COMPILER = $(PERL)
334 AM_PL_LOG_FLAGS = -Mstrict -I $(builddir)/lib -I $(srcdir)/lib -w
335
336 TAP_LOG_DRIVER = AM_TAP_AWK='$(AWK)' $(SHELL) $(srcdir)/lib/tap-driver.sh
337
338 AM_TAP_LOG_DRIVER_FLAGS = --merge
339
340 EXTRA_DIST += t/README t/ax/is t/ax/is_newest
341
342 ## Will be updated later.
343 TESTS =
344
345 # Some testsuite-influential variables should be overridable from the
346 # test scripts, but not from the environment.
347 # Keep this in sync with the similar list in 't/ax/runtest.in'.
348 AM_TESTS_ENVIRONMENT = \
349   for v in \
350     required \
351     am_test_protocol \
352     am_serial_tests \
353     am_test_prefer_config_shell \
354     am_original_AUTOMAKE \
355     am_original_ACLOCAL \
356     am_test_lib_sourced \
357     test_lib_sourced \
358   ; do \
359     eval test x"\$${$$v}" = x || unset $$v; \
360   done;
361 # We want warning messages and explanations for skipped tests to go to
362 # the console if possible, so set up 'stderr_fileno_' properly.
363 AM_TESTS_FD_REDIRECT = 9>&2
364 AM_TESTS_ENVIRONMENT += stderr_fileno_=9; export stderr_fileno_;
365
366 # For sourcing of extra "shell libraries" by our test scripts.  As per
367 # POSIX, sourcing a file with '.' will cause it to be looked up in $PATH
368 # in case it is given with a relative name containing no slashes.
369 AM_TESTS_ENVIRONMENT += \
370   if test $(srcdir) != .; then \
371     PATH='$(abs_srcdir)/t/ax'$(PATH_SEPARATOR)$$PATH; \
372   fi; \
373   PATH='$(abs_builddir)/t/ax'$(PATH_SEPARATOR)$$PATH; \
374   export PATH;
375
376 # Hand-written tests.
377
378 include $(srcdir)/t/list-of-tests.mk
379
380 TESTS += $(handwritten_TESTS)
381 EXTRA_DIST += $(handwritten_TESTS)
382
383 # Automatically-generated tests wrapping hand-written ones.
384 # Also, automatically-computed dependencies for tests.
385
386 include $(srcdir)/t/testsuite-part.am
387
388 TESTS += $(generated_TESTS)
389 EXTRA_DIST += $(generated_TESTS)
390
391 $(srcdir)/t/testsuite-part.am:
392         $(AM_V_at)rm -f t/testsuite-part.tmp $@
393         $(AM_V_GEN)$(PERL) $(srcdir)/gen-testsuite-part \
394           --srcdir $(srcdir) > t/testsuite-part.tmp
395         $(AM_V_at)chmod a-w t/testsuite-part.tmp
396         $(AM_V_at)mv -f t/testsuite-part.tmp $@
397 EXTRA_DIST += gen-testsuite-part
398
399 # The dependecies declared here are not truly complete, but such
400 # completeness would cause more issues than it would solve.  See
401 # automake bug#11347.
402 $(generated_TESTS): $(srcdir)/gen-testsuite-part
403 $(srcdir)/t/testsuite-part.am: $(srcdir)/gen-testsuite-part Makefile.am
404
405 # Hand-written tests for stuff in 'contrib/'.
406 include $(srcdir)/contrib/t/local.am
407 TESTS += $(contrib_TESTS)
408 EXTRA_DIST += $(contrib_TESTS)
409
410 # Static dependencies valid for each test case (also further
411 # extended later).  Note that use 'noinst_' rather than 'check_'
412 # as the prefix, because we really want them to be built by
413 # "make all".  This makes it easier to run the test cases by
414 # hand after having simply configured and built the package.
415
416 nodist_noinst_SCRIPTS = \
417   t/wrap/aclocal-$(APIVERSION) \
418   t/wrap/automake-$(APIVERSION)
419
420 dist_noinst_DATA = \
421   t/ax/test-init.sh \
422   t/ax/test-lib.sh \
423   t/ax/am-test-lib.sh \
424   t/ax/tap-functions.sh
425
426 # Few more static dependencies.
427 t/distcheck-missing-m4.log: t/ax/distcheck-hook-m4.am
428 t/distcheck-outdated-m4.log: t/ax/distcheck-hook-m4.am
429 EXTRA_DIST += t/ax/distcheck-hook-m4.am
430
431 t/ax/test-defs.sh: t/ax/test-defs.in Makefile
432         $(AM_V_at)rm -f $@ $@-t
433         $(AM_V_at)$(MKDIR_P) t/ax
434         $(AM_V_GEN)in=t/ax/test-defs.in \
435           && $(do_subst) <$(srcdir)/$$in >$@-t
436         $(generated_file_finalize)
437 EXTRA_DIST += t/ax/test-defs.in
438 CLEANFILES += t/ax/test-defs.sh
439 nodist_noinst_DATA = t/ax/test-defs.sh
440
441 ## Will be updated soon.
442 noinst_SCRIPTS =
443
444 t/ax/shell-no-trail-bslash: t/ax/shell-no-trail-bslash.in Makefile
445         $(AM_V_at)rm -f $@ $@-t
446         $(AM_V_GEN)in=t/ax/shell-no-trail-bslash.in \
447           && $(MKDIR_P) t/ax \
448           && $(do_subst) <$(srcdir)/$$in >$@-t \
449           && chmod a+x $@-t
450         $(generated_file_finalize)
451 EXTRA_DIST += t/ax/shell-no-trail-bslash.in
452 CLEANFILES += t/ax/shell-no-trail-bslash
453 noinst_SCRIPTS += t/ax/shell-no-trail-bslash
454
455 t/ax/cc-no-c-o: t/ax/cc-no-c-o.in Makefile
456         $(AM_V_at)rm -f $@ $@-t
457         $(AM_V_GEN)in=t/ax/cc-no-c-o.in \
458           && $(MKDIR_P) t/ax \
459           && $(do_subst) <$(srcdir)/$$in >$@-t \
460           && chmod a+x $@-t
461         $(generated_file_finalize)
462 EXTRA_DIST += t/ax/cc-no-c-o.in
463 CLEANFILES += t/ax/cc-no-c-o
464 noinst_SCRIPTS += t/ax/cc-no-c-o
465
466 runtest: t/ax/runtest.in Makefile
467         $(AM_V_at)rm -f $@ $@-t
468         $(AM_V_GEN)in=t/ax/runtest.in \
469           && $(MKDIR_P) t/ax \
470           && $(do_subst) <$(srcdir)/$$in >$@-t \
471           && chmod a+x $@-t
472         $(generated_file_finalize)
473 EXTRA_DIST += t/ax/runtest.in
474 CLEANFILES += runtest
475 noinst_SCRIPTS += runtest
476
477 # If two test scripts have the same basename, they will end up sharing
478 # the same log file, leading to all sort of undefined and undesired
479 # behaviours.
480 check-no-repeated-test-name:
481         @LC_ALL=C; export LC_ALL; \
482          lst='$(TEST_LOGS)'; for log in $$lst; do echo $$log; done \
483            | sort | uniq -c | awk '($$1 > 1) { print }' \
484            | sed 's/\.log$$//' | grep . >&2 \
485            && { \
486              echo $@: test names listed above are duplicated >&2; \
487              exit 1; \
488            }; :
489 check-local: check-no-repeated-test-name
490 .PHONY: check-no-repeated-test-name
491
492 # Check that our test cases are syntactically correct.
493 # See automake bug#11898.
494 check-tests-syntax:
495         @st=0; \
496         err () { echo "$@: $$*" >&2; st=1; }; \
497 ## The user might do something like "make check TESTS=t/foo" or
498 ## "make check TESTS_LOGS=t/foo.log" and expect (say) the test
499 ## 't/foo.sh' to be run; this has worked well until today, and
500 ## we want to continue supporting this use case.
501         bases=`for log in : $(TEST_LOGS); do echo $$log; done \
502           | sed -e '/^:$$/d' -e 's/\.log$$//'`; \
503         for bas in $$bases; do \
504           for suf in sh tap pl; do \
505             tst=$$bas.$$suf; \
506 ## Emulate VPATH search.
507             if test -f $$tst; then \
508               break; \
509             elif test -f $(srcdir)/$$tst; then \
510               tst=$(srcdir)/$$tst; \
511               break; \
512             else \
513               tst=''; \
514             fi; \
515           done; \
516           test -n "$$tst" || err "couldn't find test '$$bas'"; \
517 ## Don't check that perl tests are valid shell scripts!
518           test $$suf = pl && continue; \
519           $(AM_V_P) && echo " $(AM_TEST_RUNNER_SHELL) -n $$tst"; \
520           $(AM_TEST_RUNNER_SHELL) -n "$$tst" \
521             || err "test '$$tst' syntactically invalid"; \
522         done; \
523         exit $$st
524 check-local: check-tests-syntax
525 .PHONY: check-tests-syntax
526
527 # Recipes with a trailing backslash character (possibly followed by
528 # blank characters only) can cause spurious syntax errors with at
529 # least older bash versions (e.g., bash 2.05b), and can be potentially
530 # be unportable to other weaker shells.  Run the testsuite in a way
531 # that helps catching such problems in Automake-generated recipes.
532 # See automake bug#10436.
533 check-no-trailing-backslash-in-recipes:
534         $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) check \
535           CONFIG_SHELL='$(abs_top_builddir)/t/ax/shell-no-trail-bslash'
536 .PHONY: check-no-trailing-backslash-in-recipes
537
538 # Some compilers out there (hello, MSVC) still choke on "-c -o" being
539 # passed together on the command line.  Run the whole testsuite faking
540 # the presence of such a compiler, to help catch regressions that would
541 # otherwise only present themselves later "in the wild".  See also the
542 # long discussion about automake bug#13378.
543 check-cc-no-c-o:
544         $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) check \
545           CC='$(abs_top_builddir)/t/ax/cc-no-c-o' \
546           GNU_CC='$(abs_top_builddir)/t/ax/cc-no-c-o'
547 .PHONY: check-cc-no-c-o
548
549 ## Checking the list of tests.
550 test_subdirs = t t/pm contrib/t
551 include $(srcdir)/t/CheckListOfTests.am
552
553 # Run the testsuite with the installed aclocal and automake.
554 installcheck-local: installcheck-testsuite
555 installcheck-testsuite:
556         am_running_installcheck=yes $(MAKE) $(AM_MAKEFLAGS) check
557
558 # Performance tests.
559 .PHONY: perf
560 perf: all
561         $(MAKE) $(AM_MAKEFLAGS) TEST_SUITE_LOG='$(PERF_TEST_SUITE_LOG)' \
562                                 TESTS='$(perf_TESTS)' check
563 PERF_TEST_SUITE_LOG = t/perf/test-suite.log
564 CLEANFILES += $(PERF_TEST_SUITE_LOG)
565 EXTRA_DIST += $(perf_TESTS)
566
567 clean-local: clean-local-check
568 .PHONY: clean-local-check
569 clean-local-check:
570 ## Directories candidate to be test directories match this wildcard.
571         @globs='t/*.dir t/*/*.dir */t/*.dir */t/*/*.dir'; \
572 ## The 'nullglob' bash option is not portable, so use perl.
573         dirs=`$(PERL) -e "print join(' ', glob('$$globs'));"` || exit 1; \
574         if test -n "$$dirs"; then \
575 ## Errors in find are acceptable, errors in rm are not.
576             find $$dirs -type d ! -perm -700 -exec chmod u+rwx {} ';'; \
577             echo " rm -rf $$dirs"; \
578             rm -rf $$dirs || exit 1; \
579         fi
580
581
582 ## ---------------- ##
583 ##  Documentation.  ##
584 ## ---------------- ##
585
586 info_TEXINFOS = doc/automake.texi doc/automake-history.texi
587 doc_automake_TEXINFOS = doc/fdl.texi
588 doc_automake_history_TEXINFOS = doc/fdl.texi
589
590 man1_MANS = \
591   doc/aclocal.1 \
592   doc/automake.1 \
593   doc/aclocal-$(APIVERSION).1 \
594   doc/automake-$(APIVERSION).1
595
596 $(man1_MANS): $(srcdir)/configure.ac
597
598 CLEANFILES += $(man1_MANS)
599 EXTRA_DIST += doc/help2man
600
601 update_mans = \
602   $(AM_V_GEN): \
603     && $(MKDIR_P) doc \
604     && PATH="$(abs_builddir)/t/wrap$(PATH_SEPARATOR)$$PATH" \
605     && export PATH \
606     && $(PERL) $(srcdir)/doc/help2man --output=$@
607
608 doc/aclocal.1 doc/automake.1:
609         $(AM_V_GEN): \
610           && $(MKDIR_P) doc \
611           && f=`echo $@ | sed 's|.*/||; s|\.1$$||; $(transform)'` \
612           && echo ".so man1/$$f-$(APIVERSION).1" > $@
613
614 doc/aclocal-$(APIVERSION).1: aclocal.in aclocal lib/Automake/Config.pm
615         $(update_mans) aclocal-$(APIVERSION)
616 doc/automake-$(APIVERSION).1: automake.in automake lib/Automake/Config.pm
617         $(update_mans) automake-$(APIVERSION)
618
619
620 ## ---------------------------- ##
621 ##  Example package "amhello".  ##
622 ## ---------------------------- ##
623
624 amhello_sources = \
625   doc/amhello/configure.ac \
626   doc/amhello/Makefile.am \
627   doc/amhello/README \
628   doc/amhello/src/main.c \
629   doc/amhello/src/Makefile.am
630
631 amhello_configury = \
632   aclocal.m4 \
633   autom4te.cache \
634   Makefile.in \
635   config.h.in \
636   configure \
637   depcomp \
638   install-sh \
639   missing \
640   src/Makefile.in
641
642 dist_noinst_DATA += $(amhello_sources)
643 dist_doc_DATA = $(srcdir)/doc/amhello-1.0.tar.gz
644
645 # We depend on configure.ac so that we regenerate the tarball
646 # whenever the Automake version changes.
647 # aclocal-$(APIVERSION) and automake-$(APIVERSION) are generated by
648 # configure in 't/wrap'.
649 $(srcdir)/doc/amhello-1.0.tar.gz: $(amhello_sources) $(srcdir)/configure.ac
650         $(AM_V_GEN)tmp=amhello-output.tmp \
651           && PATH="$(abs_top_builddir)/t/wrap$(PATH_SEPARATOR)$$PATH" \
652           && export PATH \
653           && $(am__cd) $(srcdir)/doc/amhello \
654           && ACLOCAL=aclocal-$(APIVERSION) && export ACLOCAL \
655           && AUTOMAKE=automake-$(APIVERSION) && export AUTOMAKE \
656           && AUTOCONF='$(am_AUTOCONF)' && export AUTOCONF \
657           && AUTOM4TE='$(am_AUTOM4TE)' && export AUTOM4TE \
658           && AUTORECONF='$(am_AUTORECONF)' && export AUTORECONF \
659           && AUTOHEADER='$(am_AUTOHEADER)' && export AUTOHEADER \
660           && AUTOUPDATE='$(am_AUTOUPDATE)' && export AUTOUPDATE \
661           && ( \
662             { $(AM_V_P) || exec 5>&2 >$$tmp 2>&1; } \
663               && $(am_AUTORECONF) -vfi \
664               && ./configure \
665               && $(MAKE) $(AM_MAKEFLAGS) distcheck \
666               && $(MAKE) $(AM_MAKEFLAGS) distclean \
667               || { \
668                 if $(AM_V_P); then :; else \
669                   echo "$@: recipe failed." >&5; \
670                   echo "See file '`pwd`/$$tmp' for details" >&5; \
671                 fi; \
672                 exit 1; \
673               } \
674           ) \
675           && rm -rf $(amhello_configury) $$tmp \
676           && mv -f amhello-1.0.tar.gz ..
677
678
679 ## ------------------------------------------------- ##
680 ##  Third-party, obsolescent or experimental stuff.  ##
681 ## ------------------------------------------------- ##
682
683 EXTRA_DIST += \
684   contrib/check-html.am \
685   contrib/multilib/README \
686   contrib/multilib/config-ml.in \
687   contrib/multilib/symlink-tree \
688   contrib/multilib/multilib.am \
689   contrib/multilib/multi.m4 \
690   contrib/README
691
692
693 ## --------------------------------------------------- ##
694 ##  Older files, kept mostly for historical interest.  ##
695 ## --------------------------------------------------- ##
696
697 EXTRA_DIST += \
698   old/ChangeLog-tests \
699   old/ChangeLog.96 \
700   old/ChangeLog.98 \
701   old/ChangeLog.00 \
702   old/ChangeLog.01 \
703   old/ChangeLog.02 \
704   old/ChangeLog.03 \
705   old/ChangeLog.04 \
706   old/ChangeLog.09 \
707   old/ChangeLog.11 \
708   old/TODO
709
710 ## ---------------------------------------- ##
711 ##  Maintainer-specific files and scripts.  ##
712 ## ---------------------------------------- ##
713   
714 EXTRA_DIST += \
715   maintainer/am-ft \
716   maintainer/am-xft \
717   maintainer/rename-tests \
718   maintainer/maint.mk \
719   maintainer/syntax-checks.mk