Makefile.am 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. # Make Autoconf.
  2. # Copyright (C) 1999-2004, 2006-2012 Free Software Foundation, Inc.
  3. # This program is free software: you can redistribute it and/or modify
  4. # it under the terms of the GNU General Public License as published by
  5. # the Free Software Foundation, either version 3 of the License, or
  6. # (at your option) any later version.
  7. # This program is distributed in the hope that it will be useful,
  8. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. # GNU General Public License for more details.
  11. # You should have received a copy of the GNU General Public License
  12. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. # bin/ must be run first, as it builds executables needed for tests.
  14. # autom4te uses autotest.m4f to generate `testsuite', so build tests last.
  15. # Rules in man/ use scripts from both bin/ and tests/, so *it* goes last.
  16. SUBDIRS = bin . lib doc tests man
  17. ACLOCAL_AMFLAGS = -I m4
  18. EXTRA_DIST = ChangeLog.0 ChangeLog.1 ChangeLog.2 ChangeLog.3 \
  19. BUGS COPYINGv3 COPYING.EXCEPTION \
  20. GNUmakefile maint.mk cfg.mk \
  21. build-aux/gendocs.sh \
  22. build-aux/git-version-gen \
  23. build-aux/announce-gen build-aux/gnupload \
  24. build-aux/gitlog-to-changelog \
  25. .prev-version .version
  26. ## --------- ##
  27. ## INSTALL. ##
  28. ## --------- ##
  29. AM_MAKEINFOFLAGS = --no-headers --no-validate --no-split
  30. if MAKE_CASE_SENSITIVE
  31. pkgdata_DATA = $(srcdir)/INSTALL
  32. MAINTAINERCLEANFILES = $(srcdir)/INSTALL
  33. # Don't leave blank line at end of file.
  34. OMIT_TRAILING_EMPTY_LINES = '/^$$/H; /^$$/d; x; s/\n//p; s/\n*//; x'
  35. # Prefer 'plain quotes' over `makeinfo quotes'.
  36. CONVERT_QUOTES = "s/\`\([^']*\)'/'\1'/g"
  37. $(srcdir)/INSTALL: $(top_srcdir)/doc/install.texi
  38. echo @firstparagraphindent insert \
  39. | cat - $(top_srcdir)/doc/install.texi > tmp.texi
  40. $(MAKEINFO) $(AM_MAKEINFOFLAGS) $(MAKEINFOFLAGS) \
  41. --plaintext tmp.texi \
  42. | sed -e $(CONVERT_QUOTES) -e $(OMIT_TRAILING_EMPTY_LINES) \
  43. > $@-t && mv $@-t $@
  44. rm -f tmp.texi
  45. endif
  46. # Generate the ChangeLog from git history.
  47. gen_start_date = 2012-01-15 18:00:00 UTC
  48. .PHONY: gen-ChangeLog
  49. gen-ChangeLog:
  50. if test -d $(top_srcdir)/.git; then \
  51. $(top_srcdir)/build-aux/gitlog-to-changelog \
  52. --since='$(gen_start_date)' > $(distdir)/cl-t \
  53. && rm -f $(distdir)/ChangeLog \
  54. && mv $(distdir)/cl-t $(distdir)/ChangeLog; \
  55. fi
  56. # Dummy rule, to pacify automake "gnu" strictness and allow a clean
  57. # bootstrap. Creates a dummy ChangeLog (unless one is already present,
  58. # as might be the case for users of vc-dwim) that will be overridden
  59. # with a proper one at distribution time.
  60. ChangeLog:
  61. @echo dummy > $@
  62. # Version string management. There are two files to be aware of:
  63. # .tarball-version - present only in a distribution tarball, and not in
  64. # a checked-out repository. Created with contents that were learned at
  65. # the last time autoconf was run, and used by git-version-gen. Must not
  66. # be present in either $(srcdir) or $(builddir) for git-version-gen to
  67. # give accurate answers during normal development with a checked out tree,
  68. # but must be present in a tarball when there is no version control system.
  69. # Therefore, it cannot be used in any dependencies. GNUmakefile has
  70. # hooks to force a reconfigure at distribution time to get the value
  71. # correct, without penalizing normal development with extra reconfigures.
  72. # .version - present in a checked-out repository and in a distribution
  73. # tarball. At least as current as the most recent .tarball-version
  74. # creation. Usable in dependencies, particularly for files that don't
  75. # want to depend on config.h but do want to track version changes.
  76. BUILT_SOURCES = $(top_srcdir)/.version
  77. $(top_srcdir)/.version:
  78. echo $(VERSION) > $@-t && mv $@-t $@
  79. # Arrange so that .tarball-version appears only in distribution tarballs,
  80. # never in a checked-out repository.
  81. dist-hook: gen-ChangeLog
  82. echo $(VERSION) > $(distdir)/.tarball-version
  83. # Arrange to remove the symlink to GNUmakefile in VPATH builds.
  84. # TODO remove this once automake vs. AC_CONFIG_LINKS issue is fixed.
  85. distclean-local:
  86. if test x"$(VPATH)" != x ; then rm -f GNUmakefile ; fi
  87. # Perl coverage statistics.
  88. PERL_COVERAGE_DB = `pwd`/cover_db
  89. PERL_COVERAGE_FLAGS = -MDevel::Cover=-db,$(PERL_COVERAGE_DB),-silent,on,-summary,off
  90. PERL_COVER = cover
  91. check-coverage-run: all
  92. $(mkinstalldirs) $(PERL_COVERAGE_DB)
  93. PERL5OPT="$(PERL_COVERAGE_FLAGS)"; export PERL5OPT; \
  94. $(MAKE) $(AM_MAKEFLAGS) check
  95. check-coverage-report:
  96. @if test ! -d $(PERL_COVERAGE_DB); then \
  97. echo "No coverage database found in \`$(PERL_COVERAGE_DB)'." >&2; \
  98. echo "Please run \`make check-coverage' first" >&2; \
  99. exit 1; \
  100. fi
  101. $(PERL_COVER) $(PERL_COVERAGE_DB) $(PERL_COVER_FLAGS)
  102. # We don't use direct dependencies here because we'd like to be able
  103. # to invoke the report even after interrupted check-coverage.
  104. check-coverage: check-coverage-run
  105. $(MAKE) $(AM_MAKEFLAGS) check-coverage-report
  106. clean-local: clean-coverage
  107. clean-coverage:
  108. rm -rf $(PERL_COVERAGE_DB)
  109. .PHONY: check-coverage check-coverage-run check-coverage-report clean-coverage