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=@BUILD_DIR@/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
68 @/bin/bash ../../update_version
72 @echo "Making output directories..."
73 @mkdir -p $(PDF_DEST_DIR) $(HTML_DEST_DIR)
74 echo "Output directories done"
78 @echo "Making covers for $(DOC)"
79 @(cd $(IMAGES)/svg ; make pdf)
83 external-references: updateversion destdir pdfcovers
85 @echo "Building external references for $(DOC)"
86 @echo "\DeclareGraphicsExtensions{.pdf,.png,.jpg,.jpeg,.eps}\n" > graphicspolicy.tex
87 @export TEXINPUTS=.:../../../latex//: ; $(LATEX_TO_PDF) $(DOC)
88 @rm -f $(PDF_DEST_DIR)/$(DOC).pdf
89 @echo "$(DOC) external references done."
91 pdftex: updateversion destdir pdfcovers
93 @echo "Making PDF manual with $(LATEX_TO_PDF)compile..."
94 @echo "\DeclareGraphicsExtensions{.pdf,.png,.jpg,.jpeg,.eps}\n" > graphicspolicy.tex
95 @export TEXINPUTS=.:../../../latex//: ; $(LATEX_TO_PDF) $(DOC); makeindex ${DOC}.idx -o ${DOC}.ind 2>/dev/null ; $(LATEX_TO_PDF) $(DOC); $(LATEX_TO_PDF) $(DOC)
101 @rm -rf $(WWW_BUILD_DIR)
102 @mkdir -p $(WWW_BUILD_DIR)
103 @echo "Adapting $(DOC) tex files for HTML documentation..."
104 @(for F in $(TEXFILES) ;\
106 cat $$F | sed -f ../pattern-to-handle > $(WWW_BUILD_DIR)/$$F ; \
108 @ln -sf $(MAKEFORWEB) $(WWW_BUILD_DIR)/Makefile
109 @(for F in $(WEBFILESTOLINK);\
111 ln -sf $$F $(WWW_BUILD_DIR)/;\
113 (cd $(WWW_BUILD_DIR) ; make )
114 @echo "Done making web"
118 evince $(PDF_DEST_DIR)/${DOC}.pdf
121 ./check_tex.pl ${DOC}.tex
124 pic2graph -density 100 <main_configs.pic >main_configs.png
128 @rm -f *.gif *.jpg *.eps
129 @rm -f *.aux *.cp *.fn *.ky *.log *.pg
130 @rm -f *.backup *.ilg *.lof *.lot
131 @rm -f *.cdx *.cnd *.ddx *.ddn *.fdx *.fnd *.ind *.sdx *.snd
132 @rm -f *.dnd *.old *.out
133 @rm -f ${DOC}/*.gif ${DOC}/*.jpg ${DOC}/*.eps
134 @rm -f ${DOC}/*.aux ${DOC}/*.cp ${DOC}/*.fn ${DOC}/*.ky ${DOC}/*.log ${DOC}/*.pg
135 @rm -f ${DOC}/*.backup ${DOC}/*.ilg ${DOC}/*.lof ${DOC}/*.lot
136 @rm -f ${DOC}/*.cdx ${DOC}/*.cnd ${DOC}/*.ddx ${DOC}/*.ddn ${DOC}/*.fdx ${DOC}/*.fnd ${DOC}/*.ind ${DOC}/*.sdx ${DOC}/*.snd
137 @rm -f ${DOC}/*.dnd ${DOC}/*.old ${DOC}/*.out
138 @rm -f ${DOC}/WARNINGS
139 @rm -rf ../www-$(DOC)
142 @rm -f graphicspolicy.tex
144 @rm -f *.png *.gif *.jpg *.eps
145 @rm -f *.pdf *.aux *.cp *.fn *.ky *.log *.pg
146 @rm -f *.html *.backup *.pdf *.ps *.dvi *.ilg *.lof *.lot
147 @rm -f *.cdx *.cnd *.ddx *.ddn *.fdx *.fnd *.ind *.sdx *.snd
148 @rm -f *.dnd imagename_translations
149 @rm -f *.old WARNINGS *.out *.toc *.idx
150 @rm -f images.pl labels.pl internals.pl
151 @rm -f images.tex ${DOC}i.tex
153 @rm -rf $(WWW_BUILD_DIR)
156 @rm -f ${DOC}.html ${DOC}.pdf
157 @rm -f Makefile version.tex
158 @rm -rf $(WWW_BUILD_DIR)
159 @rm -rf $(HTML_DEST_DIR)