Makefile.am 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. # Make Autoconf commands.
  2. # Copyright (C) 1999-2007, 2009-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. include ../lib/freeze.mk
  14. bin_SCRIPTS = autom4te \
  15. autoconf autoheader autoreconf ifnames autoscan autoupdate
  16. EXTRA_DIST = autoconf.as autoheader.in autoreconf.in autoupdate.in ifnames.in \
  17. autoscan.in autom4te.in
  18. # Files that should be removed, but which Automake does not know.
  19. MOSTLYCLEANFILES = $(bin_SCRIPTS) autoconf.in *.tmp
  20. # Get the release year from ../ChangeLog.
  21. RELEASE_YEAR = \
  22. `sed 's/^\([0-9][0-9][0-9][0-9]\).*/\1/;q' $(top_srcdir)/ChangeLog`
  23. ## ------------- ##
  24. ## The scripts. ##
  25. ## ------------- ##
  26. edit = sed \
  27. -e 's|@SHELL[@]|$(SHELL)|g' \
  28. -e 's|@PERL[@]|$(PERL)|g' \
  29. -e 's|@PERL_FLOCK[@]|$(PERL_FLOCK)|g' \
  30. -e 's|@bindir[@]|$(bindir)|g' \
  31. -e 's|@pkgdatadir[@]|$(pkgdatadir)|g' \
  32. -e 's|@prefix[@]|$(prefix)|g' \
  33. -e 's|@autoconf-name[@]|'`echo autoconf | sed '$(transform)'`'|g' \
  34. -e 's|@autoheader-name[@]|'`echo autoheader | sed '$(transform)'`'|g' \
  35. -e 's|@autom4te-name[@]|'`echo autom4te | sed '$(transform)'`'|g' \
  36. -e 's|@M4[@]|$(M4)|g' \
  37. -e 's|@M4_DEBUGFILE[@]|$(M4_DEBUGFILE)|g' \
  38. -e 's|@M4_GNU[@]|$(M4_GNU)|g' \
  39. -e 's|@AWK[@]|$(AWK)|g' \
  40. -e 's|@RELEASE_YEAR[@]|'$(RELEASE_YEAR)'|g' \
  41. -e 's|@VERSION[@]|$(VERSION)|g' \
  42. -e 's|@PACKAGE_NAME[@]|$(PACKAGE_NAME)|g' \
  43. -e 's|@configure_input[@]|Generated from $@.in; do not edit by hand.|g'
  44. $(top_builddir)/bin/autom4te: autom4te
  45. # autoconf is written in M4sh.
  46. # FIXME: this target should depend on the frozen files below lib/m4sugar,
  47. # otherwise autom4te may pick up a frozen m4sh.m4f from an earlier
  48. # installation below the same $(prefix); work around this with --melt.
  49. autoconf.in: $(srcdir)/autoconf.as $(m4sh_m4f_dependencies)
  50. $(MY_AUTOM4TE) --language M4sh --cache '' --melt $(srcdir)/autoconf.as -o $@
  51. ## All the scripts depend on Makefile so that they are rebuilt when the
  52. ## prefix etc. changes. It took quite a while to have the rule correct,
  53. ## don't break it!
  54. ## Use chmod -w to prevent people from editing the wrong file by accident.
  55. $(bin_SCRIPTS): Makefile
  56. rm -f $@ $@.tmp
  57. srcdir=''; \
  58. test -f ./$@.in || srcdir=$(srcdir)/; \
  59. $(edit) $${srcdir}$@.in >$@.tmp
  60. chmod +x $@.tmp
  61. chmod a-w $@.tmp
  62. mv $@.tmp $@
  63. autoconf: autoconf.in
  64. autoheader: $(srcdir)/autoheader.in
  65. autom4te: $(srcdir)/autom4te.in
  66. autoreconf: $(srcdir)/autoreconf.in
  67. autoscan: $(srcdir)/autoscan.in
  68. autoupdate: $(srcdir)/autoupdate.in
  69. ifnames: $(srcdir)/ifnames.in
  70. ## --------------- ##
  71. ## Building TAGS. ##
  72. ## --------------- ##
  73. TAGS_DEPENDENCIES = $(EXTRA_DIST)
  74. letters = abcdefghijklmnopqrstuvwxyz
  75. LETTERS = ABCDEFGHIJKLMNOPQRSTUVWXYZ
  76. DIGITS = 0123456789
  77. WORD_REGEXP = [$(LETTERS)$(letters)_][$(LETTERS)$(letters)$(DIGITS)_]*
  78. ETAGS_PERL = --lang=perl \
  79. autoheader.in autoreconf.in autoupdate.in autoscan.in autom4te.in \
  80. ifnames.in
  81. ETAGS_SH = --lang=none --regex='/\($(WORD_REGEXP)\)=/\1/' \
  82. autoconf.in
  83. ETAGS_ARGS = $(ETAGS_PERL) $(ETAGS_SH)