This commit has two 'functional changes':
[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         white-xifish.png
35
36 # bits needed by the spec
37 SPEC_PNG = \
38         components.png \
39         fish_xiph_org.png \
40         floor1-1.png \
41         floor1-2.png \
42         floor1-3.png \
43         floor1-4.png \
44         hufftree.png \
45         hufftree-under.png \
46         residue-pack.png \
47         residue2.png \
48         window1.png \
49         window2.png
50
51 SPEC_TEX = \
52         Vorbis_I_spec.tex \
53         01-introduction.tex \
54         02-bitpacking.tex \
55         03-codebook.tex \
56         04-codec.tex   \
57         05-comment.tex \
58         06-floor0.tex  \
59         07-floor1.tex  \
60         08-residue.tex \
61         09-helper.tex  \
62         10-tables.tex  \
63         a1-encapsulation-ogg.tex \
64         a2-encapsulation-rtp.tex \
65         footer.tex
66
67 built_docs = Vorbis_I_spec.pdf Vorbis_I_spec.html Vorbis_I_spec.css
68
69 # conditionally make the generated documentation
70 if BUILD_DOCS
71 doc_DATA = $(static_docs) $(SPEC_PNG) $(built_docs) doxygen-build.stamp
72 else
73 doc_DATA = $(static_docs) doxygen-build.stamp
74 endif
75
76 EXTRA_DIST = $(static_docs) $(built_docs) \
77         $(SPEC_TEX) $(SPEC_PNG) $(SPEC_PDF) Vorbis_I_spec.cfg Doxyfile.in
78
79 # these are expensive; only remove if we have to
80 MAINTAINERCLEANFILES = $(built_docs)
81 CLEANFILES = $(SPEC_TEX:%.tex=%.aux) \
82              Vorbis_I_spec.4ct Vorbis_I_spec.4tc \
83              Vorbis_I_spec.dvi Vorbis_I_spec.idv \
84              Vorbis_I_spec.lg  Vorbis_I_spec.log \
85              Vorbis_I_spec.out Vorbis_I_spec.tmp \
86              Vorbis_I_spec.toc Vorbis_I_spec.xref \
87              Vorbis_I_spec*.png \
88              zzVorbis_I_spec.ps xifish.png
89 DISTCLEANFILES = $(built_docs)
90
91
92 # explicit rules for generating docs
93 if BUILD_DOCS
94 xifish.png: white-xifish.png
95         cp $< $@
96
97 Vorbis_I_spec.html Vorbis_I_spec.css: $(SPEC_TEX) $(SPEC_PNG) xifish.png
98         htlatex $<
99
100 Vorbis_I_spec.pdf: $(SPEC_TEX) $(SPEC_PNG) xifish.png
101         pdflatex $<
102         pdflatex $<
103         pdflatex $<
104 else
105 Vorbis_I_spec.html: NO_DOCS_ERROR
106 Vorbis_I_spec.pdf: NO_DOCS_ERROR
107 NO_DOCS_ERROR:
108         @echo
109         @echo "*** Documentation has not been built! ***"
110         @echo "Try re-running after passing --enable-docs to configure."
111         @echo
112 endif
113
114 if HAVE_DOXYGEN
115 doxygen-build.stamp: Doxyfile $(top_srcdir)/include/vorbis/*.h
116         doxygen
117         touch doxygen-build.stamp
118 else
119 doxygen-build.stamp:
120         echo "*** Warning: Doxygen not found; documentation will not be built."
121         touch doxygen-build.stamp
122 endif
123
124 install-data-local: doxygen-build.stamp
125         $(mkinstalldirs) $(DESTDIR)$(docdir)
126         if test -d vorbis; then \
127           for dir in vorbis/*; do \
128             if test -d $$dir; then \
129               b=`basename $$dir`; \
130               $(mkinstalldirs) $(DESTDIR)$(docdir)/$$b; \
131               for f in $$dir/*; do \
132                 $(INSTALL_DATA) $$f $(DESTDIR)$(docdir)/$$b; \
133               done \
134             fi \
135           done \
136         fi
137
138 uninstall-local:
139         rm -rf $(DESTDIR)$(docdir)
140
141 clean-local:
142         if test -d vorbis; then rm -rf vorbis; fi
143         if test -f doxygen-build.stamp; then rm -f doxygen-build.stamp; fi
144
145