Makefile.am 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. ## Process this with automake to create Makefile.in
  2. SUBDIRS = vorbisfile vorbisenc
  3. docdir = $(datadir)/doc/$(PACKAGE)-$(VERSION)
  4. ### all of the static docs, commited to SVN and included as is
  5. static_docs = \
  6. draft-ietf-avt-rtp-vorbis-06.xml \
  7. draft-ietf-avt-rtp-vorbis-06.txt \
  8. eightphase.png \
  9. evenlsp.png \
  10. floor1_inverse_dB_table.html \
  11. floorval.png \
  12. fourphase.png \
  13. framing.html \
  14. helper.html \
  15. index.html \
  16. lspmap.png \
  17. oddlsp.png \
  18. oggstream.html \
  19. programming.html \
  20. squarepolar.png \
  21. stereo.html \
  22. stream.png \
  23. v-comment.html \
  24. vorbis-clip.txt \
  25. vorbis-errors.txt \
  26. vorbis-fidelity.html \
  27. vorbis.html \
  28. vorbisword2.png \
  29. wait.png \
  30. white-ogg.png \
  31. white-xifish.png
  32. ### FIXME: bits needed by the spec which lives in xml
  33. SPEC_PNG = \
  34. components.png \
  35. floor1-1.png \
  36. floor1-2.png \
  37. floor1-3.png \
  38. floor1-4.png \
  39. hufftree.png \
  40. hufftree-under.png \
  41. residue-pack.png \
  42. residue2.png \
  43. white-xifish.png \
  44. window1.png \
  45. window2.png
  46. SPEC_PDF = xifish.pdf
  47. # FIXME: also needed here
  48. # white-xifish.png
  49. built_docs = Vorbis_I_spec.html Vorbis_I_spec.pdf
  50. # conditionally make the generated documentation
  51. if BUILD_DOCS
  52. doc_DATA = $(static_docs) $(SPEC_PNG) $(built_docs)
  53. else
  54. doc_DATA = $(static_docs) $(SPEC_PNG)
  55. endif
  56. EXTRA_DIST = $(static_docs) $(doc_sources) \
  57. $(SPEC_PNG) $(SPEC_PDF) $(built_docs)
  58. doc_sources = xml/Vorbis_I_spec.xml \
  59. xml/01-introduction.xml \
  60. xml/02-bitpacking.xml \
  61. xml/03-codebook.xml \
  62. xml/04-codec.xml \
  63. xml/05-comment.xml \
  64. xml/06-floor0.xml \
  65. xml/07-floor1.xml \
  66. xml/08-residue.xml \
  67. xml/09-helper.xml \
  68. xml/10-tables.xml \
  69. xml/a1-encapsulation_ogg.xml \
  70. xml/a2-encapsulation_rtp.xml \
  71. xml/footer.xml \
  72. xml/spec-common.xsl \
  73. xml/spec-fo.xsl \
  74. xml/spec-html.xsl
  75. # these are expensive; only remove if we have to
  76. DISTCLEANFILES = $(built_docs)
  77. CLEANFILES = Vorbis_I_spec.fo spec.aux spec.log spec.out
  78. # rules for temporary build dir for spec
  79. BUILDDIR = build
  80. # how to copy images to build dir
  81. SPEC_PNG_BUILD = $(foreach file, $(SPEC_PNG), $(BUILDDIR)/$(file))
  82. SPEC_PDF_BUILD = $(foreach file, $(SPEC_PDF), $(BUILDDIR)/$(file))
  83. $(BUILDDIR)/%: $(srcdir)/%
  84. @echo "Copying $< to $@"
  85. @mkdir -p $(BUILDDIR)
  86. @cp $< $@
  87. # how to copy the xml to build dir; cheat by only targeting the main one
  88. $(BUILDDIR)/Vorbis_I_spec.xml: $(doc_sources)
  89. @mkdir -p $(BUILDDIR)
  90. @for file in $(doc_sources); do cp $(srcdir)/$$file $(BUILDDIR); done
  91. # translate the draft rtp.txt to .xml in the BUILDDIR
  92. $(BUILDDIR)/draft-rtp.xml: draft-ietf-avt-rtp-vorbis-05.txt
  93. cat $< | sed 's/ //g' > $@
  94. # cat $< | sed 's/ //g' | sed 's/</\&lt;/g' | sed 's/>/\&gt;/g' > $@
  95. # explicit rules for generating docs
  96. if BUILD_DOCS
  97. Vorbis_I_spec.html: $(SPEC_PNG_BUILD) $(BUILDDIR)/Vorbis_I_spec.xml
  98. cd build; xsltproc --xinclude --output Vorbis_I_spec.html spec-html.xsl Vorbis_I_spec.xml && mv $@ ..
  99. Vorbis_I_spec.fo: $(BUILDDIR)/Vorbis_I_spec.xml
  100. cd build; xsltproc --xinclude --output $@ spec-fo.xsl Vorbis_I_spec.xml && mv $@ ..
  101. # we add the two newlines to pdfxmltex because this entire XML
  102. # toolchain is built from wishful thinking and bonghits and the
  103. # default supplied passivetex config files are buggy.
  104. Vorbis_I_spec.pdf: Vorbis_I_spec.fo $(SPEC_PNG_BUILD) $(SPEC_PDF_BUILD)
  105. cp $< build/spec.fo # work around a passivetex bug
  106. -cd build; echo -e -n "\n\n" | pdfxmltex spec.fo
  107. -cd build; echo -e -n "\n\n" | pdfxmltex spec.fo
  108. rm build/spec.fo
  109. mv build/spec.pdf $@
  110. else
  111. Vorbis_I_spec.html: NO_DOCS_ERROR
  112. Vorbis_I_spec.pdf: NO_DOCS_ERROR
  113. NO_DOCS_ERROR:
  114. @echo
  115. @echo "*** Documentation has not been built! ***"
  116. @echo "Try re-running after passing --enable-docs to configure."
  117. @echo
  118. endif
  119. # clean up build dir
  120. clean-local:
  121. -$(RM) -r $(BUILDDIR)