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