]> git.sur5r.net Git - bacula/docs/blob - docs/manuals/en/main/Makefile
Fix bad control sequence
[bacula/docs] / docs / manuals / en / main / Makefile
1 #
2 #  Makefile for Bacula LaTeX  Manual
3 #
4 # To build everything do
5 #    make tex
6 #    make web
7 #    make html
8 #    make dvipdf
9 #
10 # or simply
11 #
12 #    make
13 #
14 # for rapid development do:
15 #    make tex
16 #    make show
17 #
18 #
19 # If you are having problems getting "make" to work, debugging it is
20 #  easier if can see the output from latex, which is normally redirected
21 #  to /dev/null.  To see it, do the following:
22 #
23 #   cd docs/manual
24 #   make tex
25 #   latex bacula.tex
26 #
27 #  typically the latex command will stop indicating the error (e.g. a
28 #  missing \ in front of a _ or a missing { or ] ...
29 #
30 #  The following characters must be preceded by a backslash
31 #    to be entered as printable characters:
32
33 #    # $ % & ~ _ ^ \ { }
34 #
35 DOC=main
36 MAINDOC=Bacula_Main_Reference.html
37 IMAGES=../../../images
38 DOCDIR=`pwd`
39 TEXFILES=$(wildcard *tex)
40 MAKEFORWEB=$(DOCDIR)/web.makefile
41 WEBFILESTOLINK=$(DOCDIR)/latex2html-init.pl $(DOCDIR)/bacula.sty $(DOCDIR)/translate_images.pl
42 #
43 # Main directory where to find all the documentation
44 DESTDIR=../pdf-and-html
45 #
46 # Location of documentation in PDF
47 PDF_DEST_DIR=$(DESTDIR)/$(DOC)
48 #
49 # Location of HTML documentation
50 HTML_DEST_DIR=$(DESTDIR)/$(DOC)
51 #
52 # Temporary directory to translate tex to HTML
53 WWW_BUILD_DIR=$(DESTDIR)/www-$(DOC)
54 #
55 # LATEX compiler
56 LATEX_TO_PDF=pdflatex --output-directory $(PDF_DEST_DIR)
57
58 first_rule: all
59
60 all: pdftex web mini-clean
61
62 .SUFFIXES:     .tex .html
63 .PHONY:
64 .DONTCARE:
65
66
67 destdir:
68         @echo
69         @echo "Making output directories..."
70         @mkdir -p $(PDF_DEST_DIR) $(HTML_DEST_DIR)
71         echo "Output directories done"
72
73 pdfcovers:
74         @echo ""
75         @echo "Making covers for $(DOC)"
76         @(cd $(IMAGES)/svg ; make pdf)
77         @echo "Covers done."
78         @echo ""
79         @echo -n "Linking coverpage and background PDF format..."
80         @(cd $(SVGCOVERSDIR) ; make pdf)
81         @ln -sf `pwd`/${PDFCOVERSDIR}/${COVERNAME}.pdf `pwd`/${BSYSMANUALDIR}/${BSYSMANNAME}.pdf
82         @echo "Done."
83
84 pdfimages: 
85         @echo "Generating PDF images..."
86         @(cd ${IMAGES}/svg ; make pdf)
87         @echo "Done."
88
89 pngimages:
90         @echo "Generating PNG images..."
91         @(cd ${IMAGES}/svg ; make png)
92         @echo "Done."
93
94 epsimages:
95         @echo "Generating EPS images..."
96         @(cd ${IMAGES}/svg ; make eps)
97         @rm -rf ${IMAGES}/png
98         @rm -rf ${IMAGES}/pdf
99         @echo "Done."
100
101 epscovers:
102         @echo -n "Linking coverpage and background EPS format..."
103         @(cd $(SVGCOVERSDIR) ; make eps)
104         @ln -sf `pwd`/${EPSCOVERSDIR}/${COVERNAME}.eps `pwd`/${BSYSMANUALDIR}/${BSYSMANNAME}.eps
105         @rm -f `pwd`/${BSYSMANUALDIR}/${BSYSMANNAME}.pdf
106         @echo "Done."
107
108 commonfiles:
109         @echo "Making version `cat version.tex`"
110         @echo -n "Linking shared files..."
111         @(for L in $(LICENCES); do ln -sf $$L .; done)
112         @echo "Done"
113
114 external-references: destdir
115         @echo " "
116         @echo "Building external references for $(DOC)"
117         @echo "\DeclareGraphicsExtensions{.pdf,.png,.jpg,.jpeg,.eps}" > graphicspolicy.tex
118         @export TEXINPUTS=.:../../../latex//: ; $(LATEX_TO_PDF) $(DOC)
119         @rm -f $(PDF_DEST_DIR)/$(DOC).pdf
120         @echo "$(DOC) external references done."
121
122 pdftex: destdir
123         @echo ""
124         @echo "Making PDF manual with $(LATEX_TO_PDF)compile..."
125         @echo "\DeclareGraphicsExtensions{.pdf,.png,.jpg,.jpeg,.eps}" > graphicspolicy.tex
126         @export TEXINPUTS=.:../../../latex//: ; $(LATEX_TO_PDF) $(DOC); makeindex ${DOC}.idx -o ${DOC}.ind 2>/dev/null ; $(LATEX_TO_PDF) $(DOC); $(LATEX_TO_PDF) $(DOC)
127         @echo "Done"
128
129 pdflatex: external-references
130         @echo " "
131         @echo " Generating the PDF version of $(DOC)"
132         @echo "   building indexes"
133         @makeindex ${DOC}.idx -o ${DOC}.ind 2>/dev/null
134         @echo -n "   compiling..."
135         @$(PDFLATEX) $(PDFLATEXOPTIONS) ${DOC}.tex
136         @$(PDFLATEX) $(PDFLATEXOPTIONS) ${DOC}.tex
137         @echo "$(DOC).pdf generated."
138
139 html:
140         @echo " "
141         @echo "Making html"
142         @ln -sf $(WEBCOMPILERFILE) $(BSYSCOMPILERFILE)
143 #       @cp -fp ${IMAGES}/*.eps .
144 #       @rm -f next.eps next.png prev.eps prev.png up.eps up.png
145         @(if [ -f imagename_translations ] ; then \
146             ./translate_images.pl --from_meaningful_names ${DOC}.html; \
147          fi)
148         latex2html -white -no_subdir -split 0 -toc_stars -white -notransparent \
149                 -init_file latex2html-init.pl ${DOC} >tex.out 2>&1
150         @(if [ -f imagename_translations ] ; then \
151             ./translate_images.pl --from_meaningful_names ${DOC}.html; \
152          fi)
153         (cd ${DOC}; for i in *.png ; do cp -fp ../${IMAGES}/$${i} . 2>/dev/null; done)
154         @echo "Done making html"
155
156
157 web: mini-clean
158         @echo "Making web"
159         @rm -rf $(WWW_BUILD_DIR)
160         @mkdir -p $(WWW_BUILD_DIR)
161         @echo "Adapting $(DOC) tex files for HTML documentation..."
162         @(for F in $(TEXFILES) ;\
163         do \
164         cat $$F | sed -f ../pattern-to-handle > $(WWW_BUILD_DIR)/$$F ; \
165         done)
166         @ln -sf $(MAKEFORWEB) $(WWW_BUILD_DIR)/Makefile
167         @(for F in $(WEBFILESTOLINK);\
168         do \
169         ln -sf $$F $(WWW_BUILD_DIR)/;\
170         done)
171         (cd $(WWW_BUILD_DIR) ; make )
172         @echo "Done making web"
173
174
175 show:
176         evince $(PDF_DEST_DIR)/${DOC}.pdf
177
178 texcheck:
179         ./check_tex.pl ${DOC}.tex
180
181 main_configs:
182         pic2graph -density 100 <main_configs.pic >main_configs.png
183
184 mini-clean:
185         @rm -f 1 2 3 *.tex~
186         @rm -f *.gif *.jpg *.eps
187         @rm -f *.aux *.cp *.fn *.ky *.log *.pg
188         @rm -f *.backup *.ilg *.lof *.lot
189         @rm -f *.cdx *.cnd *.ddx *.ddn *.fdx *.fnd *.ind *.sdx *.snd
190         @rm -f *.dnd *.old *.out 
191         @rm -f ${DOC}/*.gif ${DOC}/*.jpg ${DOC}/*.eps
192         @rm -f ${DOC}/*.aux ${DOC}/*.cp ${DOC}/*.fn ${DOC}/*.ky ${DOC}/*.log ${DOC}/*.pg
193         @rm -f ${DOC}/*.backup ${DOC}/*.ilg ${DOC}/*.lof ${DOC}/*.lot
194         @rm -f ${DOC}/*.cdx ${DOC}/*.cnd ${DOC}/*.ddx ${DOC}/*.ddn ${DOC}/*.fdx ${DOC}/*.fnd ${DOC}/*.ind ${DOC}/*.sdx ${DOC}/*.snd
195         @rm -f ${DOC}/*.dnd ${DOC}/*.old ${DOC}/*.out
196         @rm -f ${DOC}/WARNINGS
197         @rm -rf ../www-$(DOC)
198
199 clean:
200         @rm -f graphicspolicy.tex
201         @rm -f 1 2 3
202         @rm -f *.png *.gif *.jpg *.eps
203         @rm -f *.pdf *.aux *.cp *.fn *.ky *.log *.pg
204         @rm -f *.html *.backup *.pdf *.ps *.dvi *.ilg *.lof *.lot
205         @rm -f *.cdx *.cnd *.ddx *.ddn *.fdx *.fnd *.ind *.sdx *.snd
206         @rm -f *.dnd imagename_translations
207         @rm -f *.old WARNINGS *.out *.toc *.idx
208         @rm -f images.pl labels.pl internals.pl
209         @rm -f images.tex ${DOC}i.tex
210         @rm -f ${DOC}i-*.tex
211         @rm -rf $(WWW_BUILD_DIR)
212
213 webclean:
214         @rm -rf $(WWWDIR)
215
216 distclean:  webclean clean
217         @rm -f *.pdf
218         @rm -f images.pl labels.pl internals.pl