5 # To build everything do
15 # for rapid development do:
20 # If you are having problems getting "make" to work, debugging it is
21 # easier if can see the output from latex, which is normally redirected
22 # to /dev/null. To see it, do the following:
28 # typically the latex command will stop indicating the error (e.g. a
29 # missing \ in front of a _ or a missing { or ] ...
31 # The following characters must be preceded by a backslash
32 # to be entered as printable characters:
36 IMAGES=../../../images
40 MAINDOC=Bacula_Utility_Programs.html
41 BSYSMANUALDIR=../../../bsysmanual
42 COVERSDIR=../../../covers
43 PDFCOVERSDIR=$(COVERSDIR)/pdf
44 SVGCOVERSDIR=$(COVERSDIR)/svg
45 EPSCOVERSDIR=$(COVERSDIR)/eps
46 LICENSESDIR=$(MANUALSDIR)/licences
47 COVERNAME=coverpage-utility
48 BSYSMANNAME=bsysmanual-coverpagebackground
49 LICENCES=$(wildcard $(LICENSESDIR)/*.tex)
50 BSYSCOMPILERFILE=bsys-compiler-mode.tex
51 PDFCOMPILERFILE=$(MANUALSDIR)/bsys-pdflatex-mode.tex
52 TEXCOMPILERFILE=$(MANUALSDIR)/bsys-latex-mode.tex
53 WEBCOMPILERFILE=$(MANUALSDIR)/bsys-web-mode.tex
56 TEXFILES=$(wildcard *.tex)
57 WEBFILESTOLINK=$(DOCDIR)/latex2html-init.pl $(DOCDIR)/bacula.sty $(DOCDIR)/translate_images.pl
59 PDFLATEXOPTIONS=-interaction=batchmode
60 MAKEFORWEB=$(DOCDIR)/web.makefile
64 all: pdflatex web mini-clean
74 @echo -n "Linking coverpage and background PDF format..."
75 @(cd $(SVGCOVERSDIR) ; make pdf)
76 @ln -sf `pwd`/${PDFCOVERSDIR}/${COVERNAME}.pdf `pwd`/${BSYSMANUALDIR}/${BSYSMANNAME}.pdf
80 @echo "Generating PDF images..."
81 @(cd ${IMAGES}/svg ; make pdf)
85 @echo "Generating PNG images..."
86 @(cd ${IMAGES}/svg ; make png)
90 @echo "Generating EPS images..."
91 @(cd ${IMAGES}/svg ; make eps)
97 @echo -n "Linking coverpage and background EPS format..."
98 @(cd $(SVGCOVERSDIR) ; make eps)
99 @ln -sf `pwd`/${EPSCOVERSDIR}/${COVERNAME}.eps `pwd`/${BSYSMANUALDIR}/${BSYSMANNAME}.eps
100 @rm -f `pwd`/${BSYSMANUALDIR}/${BSYSMANNAME}.pdf
104 @../../update_version
105 @echo -n "Making version `cat version.tex`"
106 @echo -n "Linking shared files..."
107 @(for L in $(LICENCES); do ln -sf $$L .; done)
110 tex: epscovers epsimages commonfiles
111 @ln -sf $(TEXCOMPILERFILE) $(BSYSCOMPILERFILE)
112 @touch ${DOC}i-dir.tex ${DOC}i-fd.tex ${DOC}i-sd.tex \
113 ${DOC}i-console.tex ${DOC}i-general.tex
114 latex -interaction=batchmode ${DOC}.tex
115 makeindex ${DOC}.idx -o ${DOC}.ind 2>/dev/null
116 latex -interaction=batchmode ${DOC}.tex
118 external-references: pdfcovers pdfimages commonfiles
120 @echo "Building external references for $(DOC)"
121 @ln -sf $(PDFCOMPILERFILE) $(BSYSCOMPILERFILE)
122 @$(PDFLATEX) $(PDFLATEXOPTIONS) ${DOC}.tex
123 @echo "$(DOC) external references done."
126 pdflatex: external-references
128 @echo " Generating the PDF version of $(DOC)"
129 @echo " building indexes"
130 @makeindex ${DOC}.idx -o ${DOC}.ind 2>/dev/null
131 @echo " compiling..."
132 @$(PDFLATEX) $(PDFLATEXOPTIONS) ${DOC}.tex
133 @$(PDFLATEX) $(PDFLATEXOPTIONS) ${DOC}.tex
134 @echo "$(DOC).pdf generated."
139 @cp -fp ${IMAGES}/*.eps .
140 @rm -f next.eps next.png prev.eps prev.png up.eps up.png
141 @(if [ -f imagename_translations ] ; then \
142 ./translate_images.pl --from_meaningful_names ${DOC}.html; \
144 latex2html -white -no_subdir -split 0 -toc_stars -white -notransparent \
145 -init_file latex2html-init.pl ${DOC} >tex.out 2>&1
146 @(if [ -f imagename_translations ] ; then \
147 ./translate_images.pl --from_meaningful_names ${DOC}.html; \
149 cp ${IMAGES}/bacula-logo.png ${DOC}
150 (cd ${DOC}; for i in *.png ; do cp -fp ../${IMAGES}/$${i} . 2>/dev/null; done)
151 @echo "Done making html"
157 @echo -"Creating tex files..."
158 @(for F in $(TEXFILES) ;\
160 cat $$F | sed -e 's/\\vb{}/\|/g;s/lstlisting/verbatim/g;s/lstinline/verb/g;s/\\lstset.*//g;s/bsysimage.{\(.*\)}{.*}{.*}/includegraphics{\1}/g;s/\\input{head.*//g;s/bsysmanual/book/g;s/bsysitemize/itemize/g;s/\\listoffigures//g;s/\\listoftables//g;s/\\LTXtable{.*}{\(.*\)}/\\include{\1}/g' > $(WWWDIR)/$$F ;\
162 @ln -sf $(MAKEFORWEB) $(WWWDIR)/Makefile
163 @(for F in $(WEBFILESTOLINK);\
165 ln -sf $$F $(WWWDIR)/;\
167 (cd $(WWWDIR) ; make )
168 @echo "Done making web"
174 # @cp -fp ${IMAGES}/*.eps .
175 # @rm -f next.eps next.png prev.eps prev.png up.eps up.png
176 # @rm -f ${DOC}/xp-*.png
177 # @rm -f ${DOC}/next.eps ${DOC}/next.png ${DOC}/prev.eps ${DOC}/prev.png ${DOC}/up.eps ${DOC}/up.png
178 # latex2html -split 3 -local_icons -t "Bacula Utility Programs" -long_titles 4 \
179 # -toc_stars -contents_in_nav -init_file latex2html-init.pl \
180 # -no_antialias -no_antialias_text \
181 # -white -notransparent ${DOC} >tex.out 2>&1
182 # @(if [ -f imagename_translations ] ; then \
183 # ./translate_images.pl --from_meaningful_names ${DOC}.html; \
185 # @cp -f ${DOC}/${MAINDOC} ${DOC}/index.html
186 # @echo "Done making web"
191 ./check_tex.pl ${DOC}.tex
194 pic2graph -density 100 <main_configs.pic >main_configs.png
198 @rm -f *.gif *.jpg *.eps
199 @rm -f *.cp *.fn *.ky *.log *.pg
200 @rm -f *.backup *.ilg *.lof *.lot
201 @rm -f *.cdx *.cnd *.ddx *.ddn *.fdx *.fnd *.ind *.sdx *.snd
202 @rm -f *.dnd *.old *.out
203 @rm -f ${DOC}/*.gif ${DOC}/*.jpg ${DOC}/*.eps
204 @rm -f ${DOC}/*.aux ${DOC}/*.cp ${DOC}/*.fn ${DOC}/*.ky ${DOC}/*.log ${DOC}/*.pg
205 @rm -f ${DOC}/*.backup ${DOC}/*.ilg ${DOC}/*.lof ${DOC}/*.lot
206 @rm -f ${DOC}/*.cdx ${DOC}/*.cnd ${DOC}/*.ddx ${DOC}/*.ddn ${DOC}/*.fdx ${DOC}/*.fnd ${DOC}/*.ind ${DOC}/*.sdx ${DOC}/*.snd
207 @rm -f ${DOC}/*.dnd ${DOC}/*.old ${DOC}/*.out
208 @rm -f ${DOC}/WARNINGS
212 @find . -type f -name "${DOC}.mtc*" -exec rm {} \;
213 @find . -type l -name "*.tex" -exec rm {} \;
215 @rm -f *.png *.gif *.jpg *.eps
216 @rm -f *.aux *.cp *.fn *.ky *.log *.pg
217 @rm -f *.html *.backup *.ps *.dvi *.ilg *.lof *.lot
218 @rm -f *.cdx *.cnd *.ddx *.ddn *.fdx *.fnd *.ind *.sdx *.snd
219 @rm -f *.dnd imagename_translations
220 @rm -f *.old WARNINGS *.out *.toc *.idx
227 distclean: webclean clean
229 @rm -f images.pl labels.pl internals.pl
230 @rm -f Makefile version.tex