92a57f5753e002422e0c095f64db984673244886
[platform/upstream/libvorbis.git] / doc / Makefile.am
1 ## Process this with automake to create Makefile.in
2
3 SUBDIRS = libvorbis vorbisfile vorbisenc
4
5 docdir = $(datadir)/doc/$(PACKAGE)-$(VERSION)
6
7 ### all of the static docs, commited to SVN and included as is
8 static_docs = \
9         rfc5215.xml \
10         rfc5215.txt \
11         eightphase.png \
12         evenlsp.png \
13         fish_xiph_org.png \
14         floor1_inverse_dB_table.html \
15         floorval.png \
16         fourphase.png \
17         framing.html \
18         helper.html \
19         index.html \
20         lspmap.png \
21         oddlsp.png \
22         oggstream.html \
23         programming.html \
24         squarepolar.png \
25         stereo.html \
26         stream.png \
27         v-comment.html \
28         vorbis-clip.txt \
29         vorbis-errors.txt \
30         vorbis-fidelity.html \
31         vorbis.html \
32         vorbisword2.png \
33         wait.png
34
35 # bits needed by the spec
36 SPEC_PNG = \
37         components.png \
38         fish_xiph_org.png \
39         floor1-1.png \
40         floor1-2.png \
41         floor1-3.png \
42         floor1-4.png \
43         hufftree.png \
44         hufftree-under.png \
45         residue-pack.png \
46         residue2.png \
47         window1.png \
48         window2.png
49
50 SPEC_TEX = \
51         Vorbis_I_spec.tex \
52         01-introduction.tex \
53         02-bitpacking.tex \
54         03-codebook.tex \
55         04-codec.tex   \
56         05-comment.tex \
57         06-floor0.tex  \
58         07-floor1.tex  \
59         08-residue.tex \
60         09-helper.tex  \
61         10-tables.tex  \
62         a1-encapsulation-ogg.tex \
63         a2-encapsulation-rtp.tex \
64         footer.tex
65
66 built_docs = Vorbis_I_spec.pdf Vorbis_I_spec.html Vorbis_I_spec.css
67
68 # conditionally make the generated documentation
69 if BUILD_DOCS
70 doc_DATA = $(static_docs) $(SPEC_PNG) $(built_docs) doxygen-build.stamp
71 else
72 doc_DATA = $(static_docs) doxygen-build.stamp
73 endif
74
75 EXTRA_DIST = $(static_docs) $(built_docs) \
76         $(SPEC_TEX) $(SPEC_PNG) $(SPEC_PDF) Vorbis_I_spec.cfg Doxyfile.in
77
78 # these are expensive; only remove if we have to
79 MAINTAINERCLEANFILES = $(built_docs)
80 CLEANFILES = $(SPEC_TEX:%.tex=%.aux) \
81              Vorbis_I_spec.4ct Vorbis_I_spec.4tc \
82              Vorbis_I_spec.dvi Vorbis_I_spec.idv \
83              Vorbis_I_spec.lg  Vorbis_I_spec.log \
84              Vorbis_I_spec.out Vorbis_I_spec.tmp \
85              Vorbis_I_spec.toc Vorbis_I_spec.xref \
86              Vorbis_I_spec*.png \
87              zzVorbis_I_spec.ps
88 DISTCLEANFILES = $(built_docs)
89
90
91 # explicit rules for generating docs
92 if BUILD_DOCS
93 Vorbis_I_spec.html Vorbis_I_spec.css: $(SPEC_TEX) $(SPEC_PNG)
94         htlatex $<
95
96 Vorbis_I_spec.pdf: $(SPEC_TEX) $(SPEC_PNG)
97         pdflatex $<
98         pdflatex $<
99         pdflatex $<
100 else
101 Vorbis_I_spec.html: NO_DOCS_ERROR
102 Vorbis_I_spec.pdf: NO_DOCS_ERROR
103 NO_DOCS_ERROR:
104         @echo
105         @echo "*** Documentation has not been built! ***"
106         @echo "Try re-running after passing --enable-docs to configure."
107         @echo
108 endif
109
110 if HAVE_DOXYGEN
111 doxygen-build.stamp: Doxyfile $(top_srcdir)/include/vorbis/*.h
112         doxygen
113         touch doxygen-build.stamp
114 else
115 doxygen-build.stamp:
116         echo "*** Warning: Doxygen not found; documentation will not be built."
117         touch doxygen-build.stamp
118 endif
119
120 install-data-local: doxygen-build.stamp
121         $(mkinstalldirs) $(DESTDIR)$(docdir)
122         if test -d vorbis; then \
123           for dir in vorbis/*; do \
124             if test -d $$dir; then \
125               b=`basename $$dir`; \
126               $(mkinstalldirs) $(DESTDIR)$(docdir)/$$b; \
127               for f in $$dir/*; do \
128                 $(INSTALL_DATA) $$f $(DESTDIR)$(docdir)/$$b; \
129               done \
130             fi \
131           done \
132         fi
133
134 uninstall-local:
135         rm -rf $(DESTDIR)$(docdir)
136
137 clean-local:
138         if test -d vorbis; then rm -rf vorbis; fi
139         if test -f doxygen-build.stamp; then rm -f doxygen-build.stamp; fi
140
141