1 ## Process this file with automake to create Makefile.in
3 ## Makefile for Automake.
5 # Copyright (C) 1995-2012 Free Software Foundation, Inc.
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)
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.
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/>.
20 ## Might be updated later.
23 MAINTAINERCLEANFILES =
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.
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' \
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)"; \
59 chmod a-w $@-t && mv -f $@-t $@
61 bin_SCRIPTS = automake aclocal
63 CLEANFILES += $(bin_SCRIPTS)
64 AUTOMAKESOURCES = automake.in aclocal.in
66 TAGS_FILES = $(AUTOMAKESOURCES)
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.
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"; \
89 @for p in $(bin_SCRIPTS); do \
90 f="`echo $$p|sed '$(transform)'`"; \
91 fv="$$f-$(APIVERSION)"; \
92 rm -f "$(DESTDIR)$(bindir)/$$fv"; \
95 ## These files depend on Makefile so they are rebuilt if $(VERSION),
96 ## $(datadir) or other do_subst'ituted variables change.
99 automake aclocal: Makefile
100 $(AM_V_at)rm -f $@ $@-t
101 $(AM_V_GEN)in=$@.in; $(do_subst) <$(srcdir)/$@.in >$@-t
102 ## We can't use '$(generated_file_finalize)' here, because currently
103 ## Automake contains occurrences of unexpanded @substitutions@ in
104 ## comments, and that is perfectly legit.
105 $(AM_V_at)chmod a+x,a-w $@-t && mv -f $@-t $@
107 ## The master location for INSTALL is lib/INSTALL.
108 ## This is where "make fetch" will install new versions.
109 ## Make sure we also update this copy.
111 $(AM_V_GEN)cp $(srcdir)/lib/INSTALL $@
113 # We don't use the default name for the autom4te cache directory,
115 maintainer-clean-local:
116 rm -rf .autom4te.cache
119 ## -------------------------------------------------------------------- ##
120 ## Auxiliary scripts and files for use with "automake --add-missing". ##
121 ## -------------------------------------------------------------------- ##
123 dist_pkgvdata_DATA = \
128 ## These must all be executable when installed. However, if we use
129 ## _SCRIPTS, then the program transform will be applied, which is not
130 ## what we want. So we make them executable by hand.
149 @for f in $(dist_script_DATA); do echo $$f; done \
153 echo " chmod +x '$(DESTDIR)$(scriptdir)/$$f'"; \
154 chmod +x "$(DESTDIR)$(scriptdir)/$$f" || st=1; \
158 installcheck-local: installcheck-executable-scripts
159 installcheck-executable-scripts:
160 @for f in $(dist_script_DATA); do echo $$f; done \
163 path="$(pkgvdatadir)/$$f"; \
164 test -x "$$path" || echo $$path; \
166 | sed 's/$$/: not executable/' \
167 | grep . 1>&2 && exit 1; exit 0
170 ## ---------------------------------------------------- ##
171 ## Private perl modules used by automake and aclocal. ##
172 ## ---------------------------------------------------- ##
174 perllibdir = $(pkgvdatadir)/Automake
175 dist_perllib_DATA = \
176 lib/Automake/ChannelDefs.pm \
177 lib/Automake/Channels.pm \
178 lib/Automake/Condition.pm \
179 lib/Automake/Configure_ac.pm \
180 lib/Automake/DisjConditions.pm \
181 lib/Automake/FileUtils.pm \
182 lib/Automake/General.pm \
183 lib/Automake/Getopt.pm \
184 lib/Automake/Item.pm \
185 lib/Automake/ItemDef.pm \
186 lib/Automake/Location.pm \
187 lib/Automake/Options.pm \
188 lib/Automake/Rule.pm \
189 lib/Automake/RuleDef.pm \
190 lib/Automake/Variable.pm \
191 lib/Automake/VarDef.pm \
192 lib/Automake/Version.pm \
193 lib/Automake/XFile.pm \
196 nodist_perllib_DATA = lib/Automake/Config.pm
197 CLEANFILES += $(nodist_perllib_DATA)
199 lib/Automake/Config.pm: lib/Automake/Config.in Makefile
200 $(AM_V_at)rm -f $@ $@-t
201 $(AM_V_at)test -d lib/Automake || $(MKDIR_P) lib/Automake
202 $(AM_V_GEN)in=Config.in \
203 && $(do_subst) <$(srcdir)/lib/Automake/Config.in >$@-t
204 $(generated_file_finalize)
205 EXTRA_DIST += lib/Automake/Config.in
208 ## --------------------- ##
209 ## Makefile fragments. ##
210 ## --------------------- ##
215 lib/am/clean-hdr.am \
218 lib/am/configure.am \
225 lib/am/header-vars.am \
228 lib/am/inst-vars.am \
230 lib/am/lang-compile.am \
237 lib/am/ltlibrary.am \
238 lib/am/mans-vars.am \
243 lib/am/remake-hdr.am \
247 lib/am/texi-vers.am \
248 lib/am/texibuild.am \
254 ## ------------------------------ ##
255 ## Automake-provided m4 macros. ##
256 ## ------------------------------ ##
258 dist_automake_ac_DATA = \
292 dist_system_ac_DATA = m4/acdir/README
294 # We build amversion.m4 here, instead of from config.status,
295 # because config.status is rerun each time one of configure's
296 # dependencies change and amversion.m4 happens to be a configure
297 # dependency. configure and amversion.m4 would be rebuilt in
299 # Use '$(top_srcdir)/m4' for the benefit of non-GNU makes: this is
300 # how amversion.m4 appears in our dependencies.
301 $(top_srcdir)/m4/amversion.m4: $(srcdir)/configure.ac $(srcdir)/m4/amversion.in
302 $(AM_V_at)rm -f $@-t $@
303 $(AM_V_GEN)in=amversion.in \
304 && $(do_subst) <$(srcdir)/m4/amversion.in >$@-t
305 $(generated_file_finalize)
306 EXTRA_DIST += m4/amversion.in
313 # Run the tests with a proper shell detected at configure time.
314 LOG_COMPILER = $(AM_TEST_RUNNER_SHELL)
316 TEST_EXTENSIONS = .pl .sh .tap
317 SH_LOG_COMPILER = $(LOG_COMPILER)
318 TAP_LOG_COMPILER = $(LOG_COMPILER)
319 PL_LOG_COMPILER = $(PERL)
320 AM_PL_LOG_FLAGS = -Mstrict -I $(builddir)/lib -I $(srcdir)/lib -w
322 TAP_LOG_DRIVER = AM_TAP_AWK='$(AWK)' $(SHELL) $(srcdir)/lib/tap-driver.sh
324 AM_TAP_LOG_DRIVER_FLAGS = --merge
326 EXTRA_DIST += t/README t/ax/is t/ax/is_newest
328 TESTS = ## Will be updated later.
330 # Some testsuite-influential variables should be overridable from the
331 # test scripts, but not from the environment.
332 # Keep this in sync with the similar list in 'runtest.in'.
333 AM_TESTS_ENVIRONMENT = \
338 am_test_prefer_config_shell \
339 am_original_AUTOMAKE \
340 am_original_ACLOCAL \
341 am_test_lib_sourced \
344 eval test x"\$${$$v}" = x || unset $$v; \
346 # We want warning messages and explanations for skipped tests to go to
347 # the console if possible, so set up 'stderr_fileno_' properly.
348 AM_TESTS_FD_REDIRECT = 9>&2
349 AM_TESTS_ENVIRONMENT += stderr_fileno_=9; export stderr_fileno_;
351 # For sourcing of extra "shell libraries" by our test scripts. As per
352 # POSIX, sourcing a file with '.' will cause it to be looked up in $PATH
353 # in case it is given with a relative name containing no slashes.
354 AM_TESTS_ENVIRONMENT += \
355 if test $(srcdir) != .; then \
356 PATH='$(abs_srcdir)/t/ax'$(PATH_SEPARATOR)$$PATH; \
358 PATH='$(abs_builddir)/t/ax'$(PATH_SEPARATOR)$$PATH; \
361 # Hand-written tests.
363 include $(srcdir)/t/list-of-tests.mk
365 TESTS += $(handwritten_TESTS)
366 EXTRA_DIST += $(handwritten_TESTS)
368 # Automatically-generated tests wrapping hand-written ones.
369 # Also, automatically-computed dependencies for tests.
371 include $(srcdir)/t/testsuite-part.am
373 TESTS += $(generated_TESTS)
374 EXTRA_DIST += $(generated_TESTS)
376 $(srcdir)/t/testsuite-part.am:
377 $(AM_V_at)rm -f t/testsuite-part.tmp $@
378 $(AM_V_GEN)$(PERL) $(srcdir)/gen-testsuite-part \
379 --srcdir $(srcdir) > t/testsuite-part.tmp
380 $(AM_V_at)chmod a-w t/testsuite-part.tmp
381 $(AM_V_at)mv -f t/testsuite-part.tmp $@
382 EXTRA_DIST += gen-testsuite-part
384 ## The dependecies declared here are not truly complete, but such
385 ## completeness would cause more issues than it would solve. See
386 ## automake bug#11347.
387 $(generated_TESTS): $(srcdir)/gen-testsuite-part
388 $(srcdir)/t/testsuite-part.am: $(srcdir)/gen-testsuite-part Makefile.am
390 # Hand-written tests for stuff in 'contrib/'.
391 include $(srcdir)/contrib/t/local.am
392 TESTS += $(contrib_TESTS)
393 EXTRA_DIST += $(contrib_TESTS)
395 # Static dependencies valid for each test case (also further
396 # extended later). Note that use 'noinst_' rather than 'check_'
397 # as the prefix, because we really want them to be built by
398 # "make all". This makes it easier to run the test cases by
399 # hand after having simply configured and built the package.
401 nodist_noinst_SCRIPTS = \
402 t/wrap/aclocal-$(APIVERSION) \
403 t/wrap/automake-$(APIVERSION)
408 t/ax/am-test-lib.sh \
409 t/ax/tap-functions.sh
411 # Few more static dependencies.
412 t/distcheck-missing-m4.log: t/ax/distcheck-hook-m4.am
413 t/distcheck-outdated-m4.log: t/ax/distcheck-hook-m4.am
414 EXTRA_DIST += t/ax/distcheck-hook-m4.am
416 t/ax/test-defs.sh: t/ax/test-defs.in Makefile
417 $(AM_V_at)rm -f $@ $@-t
418 $(AM_V_at)$(MKDIR_P) t/ax
419 $(AM_V_GEN)in=t/ax/test-defs.in \
420 && $(do_subst) <$(srcdir)/$$in >$@-t
421 $(generated_file_finalize)
422 EXTRA_DIST += t/ax/test-defs.in
423 CLEANFILES += t/ax/test-defs.sh
424 nodist_noinst_DATA = t/ax/test-defs.sh
426 noinst_SCRIPTS = # Will be updated soon.
428 t/ax/shell-no-trail-bslash: t/ax/shell-no-trail-bslash.in Makefile
429 $(AM_V_at)rm -f $@ $@-t
430 $(AM_V_GEN)in=t/ax/shell-no-trail-bslash.in \
432 && $(do_subst) <$(srcdir)/$$in >$@-t \
434 $(generated_file_finalize)
435 EXTRA_DIST += t/ax/shell-no-trail-bslash.in
436 CLEANFILES += t/ax/shell-no-trail-bslash
437 noinst_SCRIPTS += t/ax/shell-no-trail-bslash
439 runtest: runtest.in Makefile
440 $(AM_V_at)rm -f $@ $@-t
441 $(AM_V_GEN)in=runtest.in \
443 && $(do_subst) <$(srcdir)/runtest.in >$@-t \
445 $(generated_file_finalize)
446 EXTRA_DIST += runtest.in
447 CLEANFILES += runtest
448 noinst_SCRIPTS += runtest
450 # If two test scripts have the same basename, they will end up sharing
451 # the same log file, leading to all sort of undefined and undesired
453 check-no-repeated-test-name:
454 @LC_ALL=C; export LC_ALL; \
455 lst='$(TEST_LOGS)'; for log in $$lst; do echo $$log; done \
456 | sort | uniq -c | awk '($$1 > 1) { print }' \
457 | sed 's/\.log$$//' | grep . >&2 \
459 echo $@: test names listed above are duplicated >&2; \
462 check-local: check-no-repeated-test-name
463 .PHONY: check-no-repeated-test-name
465 # Check that our test cases are syntactically correct.
466 # See automake bug#11898.
469 err () { echo "$@: $$*" >&2; st=1; }; \
470 ## The user might do something like "make check TESTS=t/foo" or
471 ## "make check TESTS_LOGS=t/foo.log" and expect (say) the test
472 ## 't/foo.sh' to be run; this has worked well until today, and
473 ## we want to continue supporting this use case.
474 bases=`for log in : $(TEST_LOGS); do echo $$log; done \
475 | sed -e '/^:$$/d' -e 's/\.log$$//'`; \
476 for bas in $$bases; do \
477 for suf in sh tap pl; do \
479 ## Emulate VPATH search.
480 if test -f $$tst; then \
482 elif test -f $(srcdir)/$$tst; then \
483 tst=$(srcdir)/$$tst; \
489 test -n "$$tst" || err "couldn't find test '$$bas'"; \
490 ## Don't check that perl tests are valid shell scripts!
491 test $$suf = pl && continue; \
492 $(AM_V_P) && echo " $(AM_TEST_RUNNER_SHELL) -n $$tst"; \
493 $(AM_TEST_RUNNER_SHELL) -n "$$tst" \
494 || err "test '$$tst' syntactically invalid"; \
497 check-local: check-tests-syntax
498 .PHONY: check-tests-syntax
500 # Recipes with a trailing backslash character (possibly followed by
501 # blank characters only) can cause spurious syntax errors with at
502 # least older bash versions (e.g., bash 2.05b), and can be potentially
503 # be unportable to other weaker shells. Run the testsuite in a way
504 # that helps catching such problems in Automake-generated recipes.
505 # See automake bug#10436.
506 check-no-trailing-backslash-in-recipes:
507 $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) check \
508 CONFIG_SHELL='$(abs_top_builddir)/t/ax/shell-no-trail-bslash'
509 .PHONY: check-no-trailing-backslash-in-recipes
511 ## Checking the list of tests.
512 test_subdirs = t t/pm contrib/t
513 include $(srcdir)/t/CheckListOfTests.am
515 # Run the testsuite with the installed aclocal and automake.
516 installcheck-local: installcheck-testsuite
517 installcheck-testsuite:
518 am_running_installcheck=yes $(MAKE) $(AM_MAKEFLAGS) check
523 $(MAKE) $(AM_MAKEFLAGS) TEST_SUITE_LOG='$(PERF_TEST_SUITE_LOG)' \
524 TESTS='$(perf_TESTS)' check
525 PERF_TEST_SUITE_LOG = t/perf/test-suite.log
526 CLEANFILES += $(PERF_TEST_SUITE_LOG)
527 EXTRA_DIST += $(perf_TESTS)
529 clean-local: clean-local-check
530 .PHONY: clean-local-check
532 ## Directories candidate to be test directories match this wildcard.
533 @globs='t/*.dir t/*/*.dir */t/*.dir */t/*/*.dir'; \
534 ## The 'nullglob' bash option is not portable, so use perl.
535 dirs=`$(PERL) -e "print join(' ', glob('$$globs'));"` || exit 1; \
536 if test -n "$$dirs"; then \
537 ## Errors in find are acceptable, errors in rm are not.
538 find $$dirs -type d ! -perm -700 -exec chmod u+rwx {} ';'; \
539 echo " rm -rf $$dirs"; \
540 rm -rf $$dirs || exit 1; \
544 ## ---------------- ##
546 ## ---------------- ##
548 info_TEXINFOS = doc/automake.texi doc/automake-history.texi
549 doc_automake_TEXINFOS = doc/fdl.texi
550 doc_automake_history_TEXINFOS = doc/fdl.texi
555 doc/aclocal-$(APIVERSION).1 \
556 doc/automake-$(APIVERSION).1
558 $(man1_MANS): $(srcdir)/configure.ac
560 CLEANFILES += $(man1_MANS)
561 EXTRA_DIST += doc/help2man
566 && PATH="$(abs_builddir)/t/wrap$(PATH_SEPARATOR)$$PATH" \
568 && $(PERL) $(srcdir)/doc/help2man --output=$@
570 doc/aclocal.1 doc/automake.1:
573 && f=`echo $@ | sed 's|.*/||; s|\.1$$||; $(transform)'` \
574 && echo ".so man1/$$f-$(APIVERSION).1" > $@
576 doc/aclocal-$(APIVERSION).1: aclocal.in aclocal lib/Automake/Config.pm
577 $(update_mans) aclocal-$(APIVERSION)
578 doc/automake-$(APIVERSION).1: automake.in automake lib/Automake/Config.pm
579 $(update_mans) automake-$(APIVERSION)
582 ## ---------------------------- ##
583 ## Example package "amhello". ##
584 ## ---------------------------- ##
587 doc/amhello/configure.ac \
588 doc/amhello/Makefile.am \
590 doc/amhello/src/main.c \
591 doc/amhello/src/Makefile.am
593 amhello_configury = \
604 dist_noinst_DATA += $(amhello_sources)
605 dist_doc_DATA = $(srcdir)/doc/amhello-1.0.tar.gz
607 # We depend on configure.ac so that we regenerate the tarball
608 # whenever the Automake version changes.
609 # aclocal-$(APIVERSION) and automake-$(APIVERSION) are generated by
610 # configure in 't/wrap'.
611 $(srcdir)/doc/amhello-1.0.tar.gz: $(amhello_sources) $(srcdir)/configure.ac
613 && PATH="$(abs_top_builddir)/t/wrap$(PATH_SEPARATOR)$$PATH" \
615 && $(am__cd) $(srcdir)/doc/amhello \
616 && ACLOCAL=aclocal-$(APIVERSION) && export ACLOCAL \
617 && AUTOMAKE=automake-$(APIVERSION) && export AUTOMAKE \
618 && AUTOCONF='$(am_AUTOCONF)' && export AUTOCONF \
619 && AUTOM4TE='$(am_AUTOM4TE)' && export AUTOM4TE \
620 && AUTORECONF='$(am_AUTORECONF)' && export AUTORECONF \
621 && AUTOHEADER='$(am_AUTOHEADER)' && export AUTOHEADER \
622 && AUTOUPDATE='$(am_AUTOUPDATE)' && export AUTOUPDATE \
623 && $(am_AUTORECONF) -vfi \
625 && $(MAKE) $(AM_MAKEFLAGS) distcheck \
626 && $(MAKE) $(AM_MAKEFLAGS) distclean \
627 && rm -rf $(amhello_configury) \
628 && mv -f amhello-1.0.tar.gz ..
631 ## ------------------------------------------------- ##
632 ## Third-party, obsolescent or experimental stuff. ##
633 ## ------------------------------------------------- ##
636 contrib/check-html.am \
637 contrib/multilib/README \
638 contrib/multilib/config-ml.in \
639 contrib/multilib/symlink-tree \
640 contrib/multilib/multilib.am \
641 contrib/multilib/multi.m4 \
645 ## --------------------------------------------------- ##
646 ## Older files, kept mostly for historical interest. ##
647 ## --------------------------------------------------- ##
650 old/ChangeLog-tests \
663 ##########################################################################
665 ## Everything past here is useful to the maintainer, but probably not
668 ##########################################################################
671 ## --------------------------------------------------------- ##
672 ## Automatic generation of the ChangeLog from git history. ##
673 ## --------------------------------------------------------- ##
675 gitlog_to_changelog_command = $(PERL) $(srcdir)/lib/gitlog-to-changelog
676 gitlog_to_changelog_fixes = $(srcdir)/.git-log-fix
677 gitlog_to_changelog_options = --amend=$(gitlog_to_changelog_fixes) \
678 --since='2011-12-28 00:00:00' \
679 --no-cluster --format '%s%n%n%b'
681 EXTRA_DIST += lib/gitlog-to-changelog
682 EXTRA_DIST += $(gitlog_to_changelog_fixes)
684 # When executed from a git checkout, generate the ChangeLog from the git
685 # history. When executed from an extracted distribution tarball, just
686 # copy the distributed ChangeLog in the build directory (and if this
687 # fails, or if no distributed ChangeLog file is present, complain and
690 # We need the apparently useless dependency from another .PHONY target
691 # 'am--changelog-regen-hook' to work around a bug of Solaris make, which
692 # doesn't execute the recipe of a target named as an existing file, even
693 # if such target is declared '.PHONY' (yikes!)
695 .PHONY: am--changelog-regen-hook
696 am--changelog-regen-hook:
697 ChangeLog: am--changelog-regen-hook
698 $(AM_V_GEN)set -e; set -u; \
699 ## The ChangeLog should be regenerated unconditionally when working from
700 ## checked-out sources; otherwise, if we're working from a distribution
701 ## tarball, we expect the ChangeLog to be distributed, so check that it
702 ## is indeed present in the source directory.
703 if test -d $(srcdir)/.git; then \
705 && $(gitlog_to_changelog_command) \
706 $(gitlog_to_changelog_options) >$@-t \
710 elif test ! -f $(srcdir)/$@; then \
711 echo "Source tree is not a git checkout, and no pre-existent" \
712 "$@ file has been found there" >&2; \
717 ## --------------------------- ##
718 ## Perl coverage statistics. ##
719 ## --------------------------- ##
721 PERL_COVERAGE_DB = $(abs_top_builddir)/cover_db
722 PERL_COVERAGE_FLAGS = -MDevel::Cover=-db,$(PERL_COVERAGE_DB),-silent,on,-summary,off
725 check-coverage-run recheck-coverage-run: all
726 $(mkinstalldirs) $(PERL_COVERAGE_DB)
727 PERL5OPT="$$PERL5OPT $(PERL_COVERAGE_FLAGS)"; export PERL5OPT; \
728 WANT_NO_THREADS=yes; export WANT_NO_THREADS; unset AUTOMAKE_JOBS; \
729 $(MAKE) $(AM_MAKEFLAGS) `echo $@ | sed 's/-coverage-run//'`
731 check-coverage-report:
732 @if test ! -d "$(PERL_COVERAGE_DB)"; then \
733 echo "No coverage database found in '$(PERL_COVERAGE_DB)'." >&2; \
734 echo "Please run \"make check-coverage\" first" >&2; \
737 $(PERL_COVER) $(PERL_COVER_FLAGS) "$(PERL_COVERAGE_DB)"
739 # We don't use direct dependencies here because we'd like to be able
740 # to invoke the report even after interrupted check-coverage.
741 check-coverage: check-coverage-run
742 $(MAKE) $(AM_MAKEFLAGS) check-coverage-report
744 recheck-coverage: recheck-coverage-run
745 $(MAKE) $(AM_MAKEFLAGS) check-coverage-report
748 rm -rf "$(PERL_COVERAGE_DB)"
749 clean-local: clean-coverage
751 .PHONY: check-coverage recheck-coverage check-coverage-run \
752 recheck-coverage-run check-coverage-report clean-coverage
755 ## ---------------------------------------------------- ##
756 ## Tagging and/or uploading stable and beta releases. ##
757 ## ---------------------------------------------------- ##
761 EXTRA_DIST += lib/gnupload
763 version_rx = ^[1-9][0-9]*\.[0-9][0-9]*(\.[0-9][0-9]*)?
764 stable_version_rx = $(version_rx)$$
765 beta_version_rx = $(version_rx)[bdfhjlnprtvxz]$$
766 match_version = echo "$(VERSION)" | $(EGREP) >/dev/null
768 ## Check that we don't have uncommitted or unstaged changes.
769 ## TODO: Maybe the git suite already offers a shortcut to verify if the
770 ## TODO: working directory is "clean" or not? If yes, use that instead
771 ## TODO: of duplicating the logic here.
772 git_must_have_clean_workdir = \
773 $(GIT) rev-parse --verify HEAD >/dev/null \
774 && $(GIT) update-index -q --refresh \
775 && $(GIT) diff-files --quiet \
776 && $(GIT) diff-index --quiet --cached HEAD \
777 || fatal "you have uncommitted or unstaged changes"
779 determine_release_type = \
780 if $(match_version) '$(stable_version_rx)'; then \
781 release_type='Release' dest=ftp; \
782 elif $(match_version) '$(beta_version_rx)'; then \
783 release_type='Beta release' dest=alpha; \
785 fatal "invalid version '$(VERSION)' for a release"; \
788 git-tag-release: maintainer-check
790 fatal () { echo "$@: $$*; not tagging" >&2; exit 1; }; \
791 case '$(AM_TAG_DRYRUN)' in \
792 ""|[nN]|[nN]o|NO) run="";; \
793 *) run="echo Running:";; \
795 $(determine_release_type); \
796 $(git_must_have_clean_workdir); \
797 ## If all was successful, tag the release in the local repository.
798 $$run $(GIT) tag -s "v$(VERSION)" -m "$$release_type $(VERSION)"
802 fatal () { echo "$@: $$*; not releasing" >&2; exit 1; }; \
803 $(determine_release_type); \
804 dest=$$dest.gnu.org:automake; \
805 $(git_must_have_clean_workdir); \
806 ## Check that we are releasing from a valid tag.
807 tag=`$(GIT) describe` \
808 && case $$tag in "v$(VERSION)") true;; *) false;; esac \
809 || fatal "you can only create a release from a tagged version"; \
810 ## Build and upload the distribution tarball(s).
811 $(MAKE) $(AM_MAKEFLAGS) dist || exit 1; \
812 echo Will upload to $$dest: $(DIST_ARCHIVES); \
813 $(srcdir)/lib/gnupload $(GNUPLOADFLAGS) --to $$dest $(DIST_ARCHIVES)
815 .PHONY: git-upload-release git-tag-release
818 ## ------------------------------------------------------------------ ##
819 ## Explore differences of autogenerated files in different commits. ##
820 ## ------------------------------------------------------------------ ##
822 ## Visually comparing differences between the Makefile.in files in
823 ## automake's own build system as generated in two different branches
824 ## might help to catch bugs and blunders. This has already happened a
825 ## few times in the past, when we used to version-control Makefile.in.
828 NEW_COMMIT=$${NEW_COMMIT-"HEAD"}; \
829 OLD_COMMIT=$${OLD_COMMIT-"HEAD~1"}; \
830 am_gitdir='$(abs_top_srcdir)/.git'; \
831 get_autofiles_from_rev () \
834 && echo "$@: will get files from revision $$rev" \
835 && $(GIT) clone -q --depth 1 "$$am_gitdir" tmp \
837 && $(GIT) checkout -q "$$rev" \
838 && echo "$@: bootstrapping $$rev" \
839 && $(SHELL) ./bootstrap.sh \
840 && echo "$@: copying files from $$rev" \
841 && makefile_ins=`find . -name Makefile.in` \
842 && (tar cf - configure aclocal.m4 $$makefile_ins) | \
843 (cd .. && $(am__cd) "$$dir" && tar xf -) \
848 ## Before proceeding, ensure the specified revisions truly exist.
849 && $(GIT) --git-dir="$$am_gitdir" describe $$OLD_COMMIT >/dev/null \
850 && $(GIT) --git-dir="$$am_gitdir" describe $$NEW_COMMIT >/dev/null \
853 && $(am__cd) $$outdir \
855 && get_autofiles_from_rev $$OLD_COMMIT old \
856 && get_autofiles_from_rev $$NEW_COMMIT new \
859 ## With lots of eye candy; we like our developers pampered and spoiled :-)
860 compare-autodiffs: autodiffs
862 : $${COLORDIFF=colordiff} $${DIFF=diff}; \
864 if test ! -d "$$dir"; then \
865 echo "$@: $$dir: Not a directory" >&2; \
868 mydiff=false mypager=false; \
870 if ($$COLORDIFF -r . .) </dev/null >/dev/null 2>&1; then \
871 mydiff=$$COLORDIFF; \
879 if test "$$mydiff" = false; then \
880 if ($$DIFF -r -u . .); then \
883 echo "$@: no good-enough diff program specified" >&2; \
887 st=0; $$mydiff -r -u $$dir/old $$dir/new | $$mypager || st=$$?; \
890 .PHONY: autodiffs compare-autodiffs
893 ## --------------------------------------------------------------------- ##
894 ## Synchronize third-party files that are committed in our repository. ##
895 ## --------------------------------------------------------------------- ##
897 ## Program to use to fetch files.
899 WGET_SV_CVS = $(WGET) http://savannah.gnu.org/cgi-bin/viewcvs/~checkout~/
900 WGET_SV_GIT_CF = $(WGET) 'http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;hb=HEAD;f='
901 WGET_SV_GIT_AC = $(WGET) 'http://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=blob_plain;hb=HEAD;f='
902 WGET_SV_GIT_GL = $(WGET) 'http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob_plain;hb=HEAD;f='
904 ## Files that we fetch and which we compare against.
905 ## The 'lib/COPYING' file must still be synced by hand.
911 gitlog-to-changelog \
915 ## Fetch the latest versions of files we care about.
917 rm -rf Fetchdir > /dev/null 2>&1
919 ## If a get fails then that is a problem.
920 ($(am__cd) Fetchdir && \
921 $(WGET_SV_GIT_CF)config.guess -O config.guess && \
922 $(WGET_SV_GIT_CF)config.sub -O config.sub && \
923 $(WGET_SV_CVS)texinfo/texinfo/doc/texinfo.tex -O texinfo.tex && \
924 $(WGET_SV_GIT_GL)doc/INSTALL -O INSTALL && \
925 $(WGET_SV_GIT_GL)build-aux/gnupload -O gnupload && \
926 $(WGET_SV_GIT_GL)build-aux/update-copyright -O update-copyright && \
927 $(WGET_SV_GIT_GL)build-aux/gitlog-to-changelog -O gitlog-to-changelog)
928 ## Don't exit after test because we want to give as many errors as
930 @stat=0; for file in $(FETCHFILES); do \
931 if diff -u $(srcdir)/lib/$$file Fetchdir/$$file \
932 >>Fetchdir/update.patch 2>/dev/null; then :; \
935 echo "Updating $(srcdir)/lib/$$file ..."; \
936 cp Fetchdir/$$file $(srcdir)/lib/$$file; \
940 echo "See Fetchdir/update.patch for a log of the changes."; \
945 ## ------------------------------------------------ ##
946 ## Update copyright years of all committed files. ##
947 ## ------------------------------------------------ ##
949 EXTRA_DIST += lib/update-copyright
951 update_copyright_env = \
952 UPDATE_COPYRIGHT_FORCE=1 \
953 UPDATE_COPYRIGHT_USE_INTERVALS=2
955 .PHONY: update-copyright
958 current_year=`date +%Y` && test -n "$$current_year" \
959 || { echo "$@: cannot get current year" >&2; exit 1; }; \
960 sed -i "/^RELEASE_YEAR=/s/=.*$$/=$$current_year/" \
961 bootstrap.sh configure.ac; \
962 excluded_re=`echo $(FETCHFILES) \
963 | sed -e 's|^|lib/|' -e 's| | lib/|g' -e 's, ,|,g'`; \
965 | grep -Ev '^(lib/)?(COPYING|INSTALL)$$' \
966 | grep -Ev "^($$excluded_re)$$" \
967 | $(update_copyright_env) xargs $(srcdir)/lib/$@