Makefile.am 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. # $Id$
  2. # Makefile.am for texinfo/texindex.
  3. # Run automake in .. to produce Makefile.in from this.
  4. #
  5. # Copyright 2015 Free Software Foundation, Inc.
  6. #
  7. # This file is free software; as a special exception the author gives
  8. # unlimited permission to copy and/or distribute it, with or without
  9. # modifications, as long as this notice is preserved.
  10. #
  11. # This program is distributed in the hope that it will be useful, but
  12. # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the
  13. # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  14. # basic plan: what users invoke will be texindex, a shell script wrapper
  15. # created from texindex.in by configure.
  16. # texindex.awk does the real work; it is created from ti.twjr
  17. # using rules here invoking the texiwebjr utilities.
  18. # what we want installed in $(bindir).
  19. dist_bin_SCRIPTS = texindex
  20. # since it's generated, have to clean it explicitly.
  21. CLEANFILES = texindex
  22. # and mention the original sources explicitly.
  23. EXTRA_DIST = texindex.in ti.twjr
  24. # let's install the awk script in $(sharedir)/texinfo.
  25. dist_pkgdata_SCRIPTS = texindex.awk
  26. # since we generate it, have to clean it (at maintainer-clean) explicitly.
  27. MAINTAINERCLEANFILES = texindex.awk
  28. # mention the texiwebjr utilities. they are maintained in another
  29. # repository (see their sources), and updated here manually (see
  30. # ../util/srclist.txt).
  31. noinst_SCRIPTS = jrtangle jrweave
  32. EXTRA_DIST += $(noinst_SCRIPTS)
  33. # configure-time variables we use in texindex.in or ti.twjr.
  34. # Unlike regular Automake, we have to allow for @@VERSION@@,
  35. # which jrweave generates in the code segment.
  36. do_subst = sed -e 's,[@]pkgdatadir[@],$(pkgdatadir),g' \
  37. -e 's,[@]AWK[@],$(AWK),g' \
  38. -e 's,[@]PACKAGE[@],$(PACKAGE),g' \
  39. -e 's,[@][@]*VERSION[@][@]*,$(VERSION),g'
  40. # build the texindex shell wrapper from texindex.in, following automake.
  41. texindex: texindex.in Makefile
  42. $(do_subst) <$(srcdir)/texindex.in >texindex
  43. chmod +x texindex
  44. # build texindex.awk from ti.twjr using jrtangle; that creates
  45. # texindex.awk (hardwired). Then we substitute configure-time variables
  46. # to avoid manual updates of the version number.
  47. texindex.awk: ti.twjr
  48. $(AWK) -f $(srcdir)/jrtangle $(srcdir)/ti.twjr || rm -f texindex.awk
  49. $(do_subst) <texindex.awk >texindex.awk-tmp
  50. mv texindex.awk-tmp texindex.awk
  51. # how to build the pdf of the program-as-document.
  52. ti.pdf: ti.texi
  53. texi2pdf --tidy ti.texi
  54. ti.info: ti.texi
  55. makeinfo --no-split ti.texi -o ti.info
  56. ti.html: ti.texi
  57. makeinfo --no-split --html ti.texi -o ti.html
  58. # unlike jrtangle, jrweave outputs to stdout; use the usual UPDATED string.
  59. ti.texi: ti.twjr
  60. UPDATED=`$(top_srcdir)/build-aux/mdate-sh $(srcdir)/ti.twjr`; \
  61. $(AWK) -f $(srcdir)/jrweave $(srcdir)/ti.twjr \
  62. | $(do_subst) -e "s,[@]UPDATED[@],$$UPDATED,g" \
  63. >ti.texi || rm -f ti.texi
  64. # a fun cartoon used in the literate program.
  65. EXTRA_DIST += dek_idx.png
  66. TESTS = \
  67. tests/ti-helpversion.sh
  68. EXTRA_DIST += $(TESTS)