2 # Makefile for Bacula LaTeX Manual
4 # To build everything do
14 # for rapid development do:
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:
27 # typically the latex command will stop indicating the error (e.g. a
28 # missing \ in front of a _ or a missing { or ] ...
30 # The following characters must be preceded by a backslash
31 # to be entered as printable characters:
36 MAINDOC=Bacula_Main_Reference.html
37 IMAGES=../../../images
39 TEXFILES=$(wildcard *tex)
40 MAKEFORWEB=$(DOCDIR)/web.makefile
41 WEBFILESTOLINK=$(DOCDIR)/latex2html-init.pl $(DOCDIR)/bacula.sty $(DOCDIR)/translate_images.pl
43 # Main directory where to find all the documentation
44 DESTDIR=../pdf-and-html
46 # Location of documentation in PDF
47 PDF_DEST_DIR=$(DESTDIR)/$(DOC)
49 # Location of HTML documentation
50 HTML_DEST_DIR=$(DESTDIR)/$(DOC)
52 # Temporary directory to translate tex to HTML
53 WWW_BUILD_DIR=$(DESTDIR)/www-$(DOC)
56 LATEX_TO_PDF=pdflatex --output-directory $(PDF_DEST_DIR)
60 all: pdftex web mini-clean
69 @echo "Making output directories..."
70 @mkdir -p $(PDF_DEST_DIR) $(HTML_DEST_DIR)
71 echo "Output directories done"
75 @echo "Making covers for $(DOC)"
76 @(cd $(IMAGES)/svg ; make pdf)
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
85 @echo "Generating PDF images..."
86 @(cd ${IMAGES}/svg ; make pdf)
90 @echo "Generating PNG images..."
91 @(cd ${IMAGES}/svg ; make png)
95 @echo "Generating EPS images..."
96 @(cd ${IMAGES}/svg ; make eps)
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
109 @echo "Making version `cat version.tex`"
110 @echo -n "Linking shared files..."
111 @(for L in $(LICENCES); do ln -sf $$L .; done)
114 external-references: destdir
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."
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)
129 pdflatex: external-references
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."
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; \
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; \
153 (cd ${DOC}; for i in *.png ; do cp -fp ../${IMAGES}/$${i} . 2>/dev/null; done)
154 @echo "Done making html"
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) ;\
164 cat $$F | sed -f ../pattern-to-handle > $(WWW_BUILD_DIR)/$$F ; \
166 @ln -sf $(MAKEFORWEB) $(WWW_BUILD_DIR)/Makefile
167 @(for F in $(WEBFILESTOLINK);\
169 ln -sf $$F $(WWW_BUILD_DIR)/;\
171 (cd $(WWW_BUILD_DIR) ; make )
172 @echo "Done making web"
176 evince $(PDF_DEST_DIR)/${DOC}.pdf
179 ./check_tex.pl ${DOC}.tex
182 pic2graph -density 100 <main_configs.pic >main_configs.png
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)
200 @rm -f graphicspolicy.tex
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
211 @rm -rf $(WWW_BUILD_DIR)
216 distclean: webclean clean
218 @rm -f images.pl labels.pl internals.pl