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:
37 IMAGES=../../../images
41 MAINDOC=Bacula_Miscellaneous_Guide.html
42 BSYSMANUALDIR=../../../bsysmanual
43 COVERSDIR=../../../covers
44 PDFCOVERSDIR=$(COVERSDIR)/pdf
45 SVGCOVERSDIR=$(COVERSDIR)/svg
46 EPSCOVERSDIR=$(COVERSDIR)/eps
47 LICENSESDIR=$(MANUALSDIR)/licences
48 COVERNAME=coverpage-misc
49 BSYSMANNAME=bsysmanual-coverpagebackground
50 LICENCES=$(wildcard $(LICENSESDIR)/*.tex)
51 BSYSCOMPILERFILE=bsys-compiler-mode.tex
52 PDFCOMPILERFILE=$(MANUALSDIR)/bsys-pdflatex-mode.tex
53 TEXCOMPILERFILE=$(MANUALSDIR)/bsys-latex-mode.tex
54 WEBCOMPILERFILE=$(MANUALSDIR)/bsys-web-mode.tex
57 TEXFILES=$(wildcard *.tex)
58 WEBFILESTOLINK=$(DOCDIR)/latex2html-init.pl $(DOCDIR)/bacula.sty $(DOCDIR)/translate_images.pl
60 PDFLATEXOPTIONS=-interaction=batchmode
61 MAKEFORWEB=$(DOCDIR)/web.makefile
65 all: pdflatex web mini-clean
73 @echo -n "Linking coverpage and background PDF format..."
74 @(cd $(SVGCOVERSDIR) ; make pdf)
75 @ln -sf `pwd`/${PDFCOVERSDIR}/${COVERNAME}.pdf `pwd`/${BSYSMANUALDIR}/${BSYSMANNAME}.pdf
79 @echo "Generating PDF images..."
80 @(cd ${IMAGES}/svg ; make pdf)
84 @echo "Generating PNG images..."
85 @(cd ${IMAGES}/svg ; make png)
89 @echo "Generating EPS images..."
90 @(cd ${IMAGES}/svg ; make eps)
96 @echo -n "Linking coverpage and background EPS format..."
97 @(cd $(SVGCOVERSDIR) ; make eps)
98 @ln -sf `pwd`/${EPSCOVERSDIR}/${COVERNAME}.eps `pwd`/${BSYSMANUALDIR}/${BSYSMANNAME}.eps
99 @rm -f `pwd`/${BSYSMANUALDIR}/${BSYSMANNAME}.pdf
103 @../../update_version
104 @echo -n "Making version `cat version.tex`"
105 @echo -n "Linking shared files..."
106 @(for L in $(LICENCES); do ln -sf $$L .; done)
109 tex: epscovers epsimages commonfiles
110 @ln -sf $(TEXCOMPILERFILE) $(BSYSCOMPILERFILE)
111 @touch ${DOC}i-dir.tex ${DOC}i-fd.tex ${DOC}i-sd.tex \
112 ${DOC}i-console.tex ${DOC}i-general.tex
113 latex -interaction=batchmode ${DOC}.tex
114 makeindex ${DOC}.idx -o ${DOC}.ind 2>/dev/null
115 latex -interaction=batchmode ${DOC}.tex
117 external-references: pdfcovers pdfimages commonfiles
119 @echo "Building external references for $(DOC)"
120 @ln -sf $(PDFCOMPILERFILE) $(BSYSCOMPILERFILE)
121 @$(PDFLATEX) $(PDFLATEXOPTIONS) ${DOC}.tex
122 @echo "$(DOC) external references done."
124 pdflatex: external-references
126 @echo " Generating the PDF version of $(DOC)"
127 @echo " building indexes"
128 @makeindex ${DOC}.idx -o ${DOC}.ind 2>/dev/null
129 @echo " compiling..."
130 @$(PDFLATEX) $(PDFLATEXOPTIONS) ${DOC}.tex
131 @$(PDFLATEX) $(PDFLATEXOPTIONS) ${DOC}.tex
132 @echo "$(DOC).pdf generated."
137 @cp -fp ${IMAGES}/*.eps .
138 @rm -f next.eps next.png prev.eps prev.png up.eps up.png
139 latex2html -white -no_subdir -split 0 -toc_stars -white \
140 -init_file latex2html-init.pl ${DOC} >tex.out 2>&1
141 @(if [ -f imagename_translations ] ; then \
142 ./translate_images.pl --from_meaningful_names ${DOC}/${MAINDOC}; \
144 (cd ${DOC}; for i in *.png ; do cp -fp ../${IMAGES}/$${i} . 2>/dev/null; done)
145 @echo "Done making html"
151 @echo -"Creating tex files..."
152 @(for F in $(TEXFILES) ;\
154 cat $$F | sed -e '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 ;\
156 @ln -sf $(MAKEFORWEB) $(WWWDIR)/Makefile
157 @(for F in $(WEBFILESTOLINK);\
159 ln -sf $$F $(WWWDIR)/;\
161 (cd $(WWWDIR) ; make )
162 @echo "Done making web"
169 # @cp -fp ${IMAGES}/*.eps .
170 # @rm -f next.eps next.png prev.eps prev.png up.eps up.png
171 # @rm -f ${DOC}/xp-*.png
172 # @rm -f ${DOC}/next.eps ${DOC}/next.png ${DOC}/prev.eps ${DOC}/prev.png ${DOC}/up.eps ${DOC}/up.png
173 # latex2html -split 3 -local_icons -t "Bacula Miscellaneous Guide" -long_titles 4 \
174 # -toc_stars -contents_in_nav -init_file latex2html-init.pl \
175 # -no_antialias -no_antialias_text \
176 # -white -notransparent ${DOC} >tex.out 2>&1
177 # @(if [ -f imagename_translations ] ; then \
178 # ./translate_images.pl --from_meaningful_names ${DOC}/${MAINDOC}; \
180 # @cp -f ${DOC}/${MAINDOC} ${DOC}/index.html
181 # @echo "Done making web"
187 ./check_tex.pl ${DOC}.tex
190 pic2graph -density 100 <main_configs.pic >main_configs.png
194 @rm -f *.gif *.jpg *.eps
195 @rm -f *.cp *.fn *.ky *.log *.pg
196 @rm -f *.backup *.ilg *.lof *.lot
197 @rm -f *.cdx *.cnd *.ddx *.ddn *.fdx *.fnd *.ind *.sdx *.snd
198 @rm -f *.dnd *.old *.out
199 @rm -f ${DOC}/*.gif ${DOC}/*.jpg ${DOC}/*.eps
200 @rm -f ${DOC}/*.aux ${DOC}/*.cp ${DOC}/*.fn ${DOC}/*.ky ${DOC}/*.log ${DOC}/*.pg
201 @rm -f ${DOC}/*.backup ${DOC}/*.ilg ${DOC}/*.lof ${DOC}/*.lot
202 @rm -f ${DOC}/*.cdx ${DOC}/*.cnd ${DOC}/*.ddx ${DOC}/*.ddn ${DOC}/*.fdx ${DOC}/*.fnd ${DOC}/*.ind ${DOC}/*.sdx ${DOC}/*.snd
203 @rm -f ${DOC}/*.dnd ${DOC}/*.old ${DOC}/*.out
204 @rm -f ${DOC}/WARNINGS
208 @find . -type f -name "${DOC}.mtc*" -exec rm {} \;
209 @find . -type l -name "*.tex" -exec rm {} \;
211 @rm -f *.png *.gif *.jpg *.eps
212 @rm -f *.aux *.cp *.fn *.ky *.log *.pg
213 @rm -f *.html *.backup *.ps *.dvi *.ilg *.lof *.lot
214 @rm -f *.cdx *.cnd *.ddx *.ddn *.fdx *.fnd *.ind *.sdx *.snd
215 @rm -f *.dnd imagename_translations
216 @rm -f *.old WARNINGS *.out *.toc *.idx
223 distclean: webclean clean
225 @rm -f images.pl labels.pl internals.pl
226 @rm -f Makefile version.tex