source: trunk/third/gstreamer/docs/manuals.mak @ 21448

Revision 21448, 4.7 KB checked in by ghudson, 20 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r21447, which included commits to RCS files with non-trunk default branches.
Line 
1### These are all generic; we set all the variables we need
2
3# intermediary build path
4BUILDDIR = build
5# same for images
6BUILDIMAGESDIR = $(BUILDDIR)/images
7
8# images
9# right now, we only allow .png and .fig as source
10# we might add more later if we feel the need
11
12# PNG's can be source or built from .fig
13PNG = $(strip $(PNG_SRC) $(FIG_SRC:.fig=.png))
14# EPS .ps files can be built from .png or .fig
15EPS = $(strip $(FIG_SRC:.fig=.ps) $(PNG_SRC:.png=.ps))
16# PDF .pdf files can be built from .png or .fig
17PDF = $(strip $(FIG_SRC:.fig=.pdf) $(PNG_SRC:.png=.pdf))
18
19# where we expect to find images during building, whether by copying
20# or by generating them
21PNG_BUILT = $(foreach file, $(PNG), $(BUILDIMAGESDIR)/$(file))
22EPS_BUILT = $(foreach file, $(EPS), $(BUILDIMAGESDIR)/$(file))
23PDF_BUILT = $(foreach file, $(PDF), $(BUILDIMAGESDIR)/$(file))
24
25SRC = $(XML) $(PNG_SRC) $(FIG_SRC) $(CSS) $(EXTRA_SOURCES)
26
27# generate A4 docs
28PAPER_LOCALE = nl_NL
29
30### generate all documentation by default
31# hook in html generation
32all-local: html
33
34# can we generate HTML ?
35if     DOC_HTML
36HTML_DAT = html
37HTML_TARGET = html/index.html
38else  #!DOC_HTML
39HTML_DAT =
40HTML_TARGET =
41endif #DOC_HTML
42html: $(HTML_TARGET)
43
44# can we generate PS ?
45if     DOC_PS
46PS_DAT = $(DOC).ps
47else  #!DOC_PS
48PS_DAT =
49endif #DOC_PS
50ps: $(PS_DAT)
51
52# can we generate PDF ?
53if     DOC_PDF
54PDF_DAT = $(DOC).pdf
55else  #!DOC_PDF
56PDF_DAT =
57endif #DOC_PDF
58pdf: $(PDF_DAT)
59
60debug:
61        @echo "outputting some useful debug information"
62        @echo "Source XML:"
63        @echo "XML: '$(XML)'"
64        @echo "CSS: '$(CSS)'"
65        @echo "Source image files:"
66        @echo "PNG_SRC: '$(PNG_SRC)'"
67        @echo "FIG_SRC: '$(FIG_SRC)'"
68        @echo "All used image files:"
69        @echo "PNG: '$(PNG)'"
70        @echo "EPS: '$(EPS)'"
71        @echo "PDF: '$(PDF)'"
72        @echo "All used image files in their built path:"
73        @echo "PNG_BUILT: '$(PNG_BUILT)'"
74        @echo "EPS_BUILT: '$(EPS_BUILT)'"
75        @echo "PDF_BUILT: '$(PDF_BUILT)'"
76        @echo "End result products:"
77        @echo "HTML_DAT: '$(HTML_DAT)'"
78        @echo "PS_DAT:   '$(PS_DAT)'"
79        @echo "PDF_DAT:  '$(PDF_DAT)'"
80
81# a rule to copy all of the source for docs into $(builddir)/build
82$(BUILDDIR)/$(MAIN): $(XML) $(CSS) $(EXTRA_SOURCES)
83        @-mkdir -p $(BUILDDIR)
84        @if test "x$(EXTRA_SOURCES)" != "x"; then for a in $(EXTRA_SOURCES); do cp $(srcdir)/$$a $(BUILDDIR); done; fi
85        @for a in $(XML); do cp $(srcdir)/$$a $(BUILDDIR); done
86        @for a in $(CSS); do cp $(srcdir)/$$a $(BUILDDIR); done
87        @cp ../version.entities $(BUILDDIR)
88        @cp $(top_srcdir)/docs/url.entities $(BUILDDIR)
89
90html/index.html: $(BUILDDIR)/$(MAIN) $(PNG_BUILT) $(FIG_SRC)
91        @make check-local
92        @echo "*** Generating HTML output ***"
93        @-mkdir -p html
94        @cp -f $(srcdir)/../image-png $(BUILDDIR)/image.entities
95        @cd $(BUILDDIR) && docbook2html -o ../html -V '%use-id-as-filename%' $(MAIN)
96        @test "x$(CSS)" != "x" && \
97          echo "Copying .css files: $(CSS)" && \
98          cp $(srcdir)/$(CSS) html
99        @test "x$(PNG)" != "x" && \
100          echo "Copying .png images: $(PNG_BUILT)" && \
101          mkdir -p html/images && \
102          cp $(PNG_BUILT) html/images || true
103
104$(DOC).ps: $(BUILDDIR)/$(MAIN) $(EPS_BUILT) $(PNG_SRC) $(FIG_SRC)
105        @make check-local
106        @echo "*** Generating PS output ***"
107        @cp -f $(srcdir)/../image-eps $(BUILDDIR)/image.entities
108        cd $(BUILDDIR) && docbook2ps -o .. $(MAIN)
109#       export LC_PAPER=$(PAPER_LOCALE) && cd $(BUILDDIR) && xmlto ps -o .. $(MAIN)
110
111$(DOC).pdf: $(DOC).ps
112        @make check-local
113        @echo "*** Generating PDF output ***"
114        @ps2pdf $(DOC).ps
115
116#$(DOC).pdf: $(MAIN) $(PDF) $(FIG_SRC)
117#       @echo "*** Generating PDF output ***"
118#       @cp -f $(srcdir)/../image-pdf image.entities
119#       @export LC_PAPER=$(PAPER_LOCALE) && xmlto pdf $(MAIN)
120#       @rm image.entities
121
122clean-local:
123        -$(RM) -r $(BUILDDIR)
124        -$(RM) -r html
125        -$(RM) $(DOC).ps
126        -$(RM) $(DOC).pdf
127        -$(RM) -r www
128
129### image generation
130
131# copy png from source dir png
132$(BUILDIMAGESDIR)/%.png: $(srcdir)/%.png
133        @echo "Copying $< to $@"
134        @mkdir -p $(BUILDIMAGESDIR)
135        @cp $< $@
136# make png from fig
137$(BUILDIMAGESDIR)/%.png: %.fig
138        @echo "Generating $@ from $<"
139        @mkdir -p $(BUILDIMAGESDIR)
140        @fig2dev -Lpng $< $@
141
142# make ps(EPS) from fig
143$(BUILDIMAGESDIR)/%.ps: %.fig
144        @echo "Generating $@ from $<"
145        @mkdir -p $(BUILDIMAGESDIR)
146        @fig2dev -Leps $< $@
147
148# make pdf from fig
149$(BUILDIMAGESDIR)/%.pdf: %.fig
150        @echo "Generating $@ from $<"
151        @mkdir -p $(BUILDIMAGESDIR)
152        @fig2dev -Lpdf $< $@
153
154# make pdf from png
155$(BUILDIMAGESDIR)/%.pdf: %.png
156        @echo "Generating $@ from $<"
157        @mkdir -p $(BUILDIMAGESDIR)
158        @cat $< | pngtopnm | pnmtops -noturn 2> /dev/null | epstopdf --filter --outfile $@ 2> /dev/null
159
160# make ps(EPS) from png
161$(BUILDIMAGESDIR)/%.ps: %.png
162        @echo "Generating $@ from $<"
163        @mkdir -p $(BUILDIMAGESDIR)
164        @cat $< | pngtopnm | pnmtops -noturn > $@ 2> /dev/null
165
166# make sure xml validates properly
167check-local: $(BUILDDIR)/$(MAIN)
168        @cp -f $(srcdir)/../image-png $(BUILDDIR)/image.entities
169        cd $(BUILDDIR) && xmllint -noout -valid $(MAIN)
Note: See TracBrowser for help on using the repository browser.