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