Makefile.am 3.4 KB

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