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