Makefile.am 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. #----------------------------------------------------------------
  2. #
  3. # Makefile.am
  4. #
  5. # Automake source file TNT documentation
  6. #
  7. # This file, along with aclocal, configure.ac autoconf,
  8. # and automake can produce a highly functional configuration
  9. # script and Makefile.
  10. #
  11. # This makefile is separate from the toplevel makefile, as
  12. # we want to capture this functionality separately from
  13. # the main program's build procedure.
  14. #
  15. # This makefile uses pdflatex and latex2html to generate
  16. # both PDF and HTML versions of the docs.
  17. # "Local" rules are used to build and cleanup.
  18. #
  19. #
  20. # Bob Techentin
  21. # June 30, 2004
  22. #
  23. # Copyright 2004 (C) Mayo Foundation. All Rights Reserved
  24. #
  25. # $Id: Makefile.am,v 1.1 2004/07/21 15:45:26 techenti Exp $
  26. #
  27. #----------------------------------------------------------------
  28. #----------------------------------------------------------------
  29. # Just for the record, this isn't a GNU project, and
  30. # doesn't have all the support files like LICENSE and
  31. # ChangeLog. We're also compiling in a subdirectory, so
  32. # we supply a couple of options to automake.
  33. #----------------------------------------------------------------
  34. AUTOMAKE_OPTIONS = foreign
  35. #---------------------------------------------------------------
  36. # Documentation Targets
  37. #
  38. # Note that automake doesn't support Latex documentation
  39. # generation, so we're calling it "data", but installed
  40. # in a special 'doc' dir.
  41. #
  42. #---------------------------------------------------------------
  43. docdir = $(pkgdatadir)
  44. doc_DATA = \
  45. user-guide.pdf
  46. #---------------------------------------------------------------
  47. # Compile both PDF and HTML documents
  48. #
  49. # Support is added for latex documents using bibtex,
  50. # but the '.bib' file must have the same name as
  51. # the .tex file.
  52. #
  53. # Also note that we've got both PDF and HTML targets.
  54. # But the autotools aren't happy with the idea of
  55. # an indeterminate number of html files, so we use the
  56. # PDF file as the target, supply a rule to compile both
  57. # the PDF and the HTML, then an installation procedure
  58. # which copies both the PDF and HTML to the
  59. # destination "doc" directory.
  60. #---------------------------------------------------------------
  61. %.pdf : %.tex
  62. pdflatex $*
  63. if [ -f $*.bib ]; then \
  64. echo Generating bibliography for $*; \
  65. bibtex $*; \
  66. fi
  67. echo Run latex again to get references right $*
  68. pdflatex $*
  69. latex2html -split 4 -show_section_numbers -local_icons $<
  70. # Custom installation rule
  71. install-data-local:
  72. for f in $(doc_DATA); do \
  73. $(mkinstalldirs) $(DESTDIR)$(docdir); \
  74. $(INSTALL_DATA) $$f $(DESTDIR)$(docdir)/$$f; \
  75. d=`basename $$f .pdf`; \
  76. $(mkinstalldirs) $(DESTDIR)$(docdir)/$$d; \
  77. $(INSTALL_DATA) $$d/* $(DESTDIR)$(docdir)/$$d; \
  78. done
  79. #---------------------------------------------------------------
  80. # clean
  81. #
  82. # On a good day, we would use a "clean-local" target to
  83. # describe cleanup after both latex2html and pdflatex.
  84. # But as of this writing, we don't have a good latex,
  85. # pdflatex, or latex2html set for the Windows (cygwin)
  86. # environment. Without a standard autotools clean
  87. # target, 'make clean' and 'make distclean' will
  88. # leave the generated PDF and HTML intact.
  89. #
  90. #---------------------------------------------------------------
  91. #clean-local:
  92. very-clean:
  93. for f in $(doc_DATA); do \
  94. rm -f $$f; \
  95. d=`basename $$f .pdf`; \
  96. rm -f $$d.aux $$d.bbl $$d.blg $$d.dvi; \
  97. rm -f $$d.lof $$d.log $$d.out $$d.toc; \
  98. rm -rf $$d; \
  99. done