# # # Makefile for LaTeX # # To build everything do # make tex # make web # make html # make dvipdf # # or simply # # make # # for rapid development do: # make tex # make show # # # If you are having problems getting "make" to work, debugging it is # easier if can see the output from latex, which is normally redirected # to /dev/null. To see it, do the following: # # cd docs/manual # make tex # latex bacula.tex # # typically the latex command will stop indicating the error (e.g. a # missing \ in front of a _ or a missing { or ] ... # # The following characters must be preceded by a backslash # to be entered as printable characters: # # # $ % & ~ _ ^ \ { } # IMAGES=../../../images MANUALSDIR=../.. DOC=utility MAINDOC=Bacula_Utility_Programs.html BSYSMANUALDIR=../../../bsysmanual COVERSDIR=../../../covers PDFCOVERSDIR=$(COVERSDIR)/pdf SVGCOVERSDIR=$(COVERSDIR)/svg EPSCOVERSDIR=$(COVERSDIR)/eps LICENSESDIR=$(MANUALSDIR)/licences COVERNAME=coverpage-utility BSYSMANNAME=bsysmanual-coverpagebackground LICENCES=$(wildcard $(LICENSESDIR)/*.tex) BSYSCOMPILERFILE=bsys-compiler-mode.tex PDFCOMPILERFILE=$(MANUALSDIR)/bsys-pdflatex-mode.tex TEXCOMPILERFILE=$(MANUALSDIR)/bsys-latex-mode.tex WEBCOMPILERFILE=$(MANUALSDIR)/bsys-web-mode.tex WWWDIR=../www-$(DOC) DOCDIR=../${DOC} TEXFILES=$(wildcard *.tex) WEBFILESTOLINK=$(DOCDIR)/latex2html-init.pl $(DOCDIR)/bacula.sty $(DOCDIR)/translate_images.pl PDFLATEX=pdflatex PDFLATEXOPTIONS=-interaction=batchmode MAKEFORWEB=$(DOCDIR)/web.makefile first_rule: all all: pdflatex web mini-clean .SUFFIXES: .tex .html .PHONY: .DONTCARE: pdfcovers: @echo -n "Linking coverpage and background PDF format..." @(cd $(SVGCOVERSDIR) ; make pdf) @ln -sf `pwd`/${PDFCOVERSDIR}/${COVERNAME}.pdf `pwd`/${BSYSMANUALDIR}/${BSYSMANNAME}.pdf @echo "Done." pdfimages: @echo "Generating PDF images..." @(cd ${IMAGES}/svg ; make pdf) @echo "Done." pngimages: @echo "Generating PNG images..." @(cd ${IMAGES}/svg ; make png) @echo "Done." epsimages: @echo "Generating EPS images..." @(cd ${IMAGES}/svg ; make eps) @rm -rf ${IMAGES}/png @rm -rf ${IMAGES}/pdf @echo "Done." epscovers: @echo -n "Linking coverpage and background EPS format..." @(cd $(SVGCOVERSDIR) ; make eps) @ln -sf `pwd`/${EPSCOVERSDIR}/${COVERNAME}.eps `pwd`/${BSYSMANUALDIR}/${BSYSMANNAME}.eps @rm -f `pwd`/${BSYSMANUALDIR}/${BSYSMANNAME}.pdf @echo "Done." commonfiles: @../../update_version @echo -n "Making version `cat version.tex`" @echo -n "Linking shared files..." @(for L in $(LICENCES); do ln -sf $$L .; done) @echo "Done" tex: epscovers epsimages commonfiles @ln -sf $(TEXCOMPILERFILE) $(BSYSCOMPILERFILE) @touch ${DOC}i-dir.tex ${DOC}i-fd.tex ${DOC}i-sd.tex \ ${DOC}i-console.tex ${DOC}i-general.tex latex -interaction=batchmode ${DOC}.tex makeindex ${DOC}.idx -o ${DOC}.ind 2>/dev/null latex -interaction=batchmode ${DOC}.tex external-references: pdfcovers pdfimages commonfiles @echo " " @echo "Building external references for $(DOC)" @ln -sf $(PDFCOMPILERFILE) $(BSYSCOMPILERFILE) @$(PDFLATEX) $(PDFLATEXOPTIONS) ${DOC}.tex @echo "$(DOC) external references done." pdflatex: external-references @echo " " @echo " Generating the PDF version of $(DOC)" @echo " building indexes" @makeindex ${DOC}.idx -o ${DOC}.ind 2>/dev/null @echo " compiling..." @$(PDFLATEX) $(PDFLATEXOPTIONS) ${DOC}.tex @$(PDFLATEX) $(PDFLATEXOPTIONS) ${DOC}.tex @echo "$(DOC).pdf generated." html: @echo " " @echo "Making html" @cp -fp ${IMAGES}/*.eps . @rm -f next.eps next.png prev.eps prev.png up.eps up.png @(if [ -f imagename_translations ] ; then \ ./translate_images.pl --from_meaningful_names ${DOC}.html; \ fi) latex2html -white -no_subdir -split 0 -toc_stars -white -notransparent \ -init_file latex2html-init.pl ${DOC} >tex.out 2>&1 @(if [ -f imagename_translations ] ; then \ ./translate_images.pl --from_meaningful_names ${DOC}.html; \ fi) cp ${IMAGES}/bacula-logo.png ${DOC} (cd ${DOC}; for i in *.png ; do cp -fp ../${IMAGES}/$${i} . 2>/dev/null; done) @echo "Done making html" web: mini-clean @echo "Making web" @rm -rf $(WWWDIR) @mkdir -p $(WWWDIR) @echo -"Creating tex files..." @(for F in $(TEXFILES) ;\ do \ 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 ;\ done) @ln -sf $(MAKEFORWEB) $(WWWDIR)/Makefile @(for F in $(WEBFILESTOLINK);\ do \ ln -sf $$F $(WWWDIR)/;\ done) (cd $(WWWDIR) ; make ) @echo "Done making web" # web: # @echo "Making web" # @rm -rf ${DOC} # @mkdir -p ${DOC} # @cp -fp ${IMAGES}/*.eps . # @rm -f next.eps next.png prev.eps prev.png up.eps up.png # @rm -f ${DOC}/xp-*.png # @rm -f ${DOC}/next.eps ${DOC}/next.png ${DOC}/prev.eps ${DOC}/prev.png ${DOC}/up.eps ${DOC}/up.png # latex2html -split 3 -local_icons -t "Bacula Utility Programs" -long_titles 4 \ # -toc_stars -contents_in_nav -init_file latex2html-init.pl \ # -no_antialias -no_antialias_text \ # -white -notransparent ${DOC} >tex.out 2>&1 # @(if [ -f imagename_translations ] ; then \ # ./translate_images.pl --from_meaningful_names ${DOC}.html; \ # fi) # @cp -f ${DOC}/${MAINDOC} ${DOC}/index.html # @echo "Done making web" show: xdvi ${DOC} texcheck: ./check_tex.pl ${DOC}.tex main_configs: pic2graph -density 100 main_configs.png mini-clean: @rm -f 1 2 3 *.tex~ @rm -f *.gif *.jpg *.eps @rm -f *.cp *.fn *.ky *.log *.pg @rm -f *.backup *.ilg *.lof *.lot @rm -f *.cdx *.cnd *.ddx *.ddn *.fdx *.fnd *.ind *.sdx *.snd @rm -f *.dnd *.old *.out @rm -f ${DOC}/*.gif ${DOC}/*.jpg ${DOC}/*.eps @rm -f ${DOC}/*.aux ${DOC}/*.cp ${DOC}/*.fn ${DOC}/*.ky ${DOC}/*.log ${DOC}/*.pg @rm -f ${DOC}/*.backup ${DOC}/*.ilg ${DOC}/*.lof ${DOC}/*.lot @rm -f ${DOC}/*.cdx ${DOC}/*.cnd ${DOC}/*.ddx ${DOC}/*.ddn ${DOC}/*.fdx ${DOC}/*.fnd ${DOC}/*.ind ${DOC}/*.sdx ${DOC}/*.snd @rm -f ${DOC}/*.dnd ${DOC}/*.old ${DOC}/*.out @rm -f ${DOC}/WARNINGS clean: @find . -type f -name "${DOC}.mtc*" -exec rm {} \; @find . -type l -name "*.tex" -exec rm {} \; @rm -f 1 2 3 *.tex~ @rm -f *.png *.gif *.jpg *.eps @rm -f *.aux *.cp *.fn *.ky *.log *.pg @rm -f *.html *.backup *.ps *.dvi *.ilg *.lof *.lot @rm -f *.cdx *.cnd *.ddx *.ddn *.fdx *.fnd *.ind *.sdx *.snd @rm -f *.dnd imagename_translations @rm -f *.old WARNINGS *.out *.toc *.idx @rm -f ${DOC}i-*.tex @rm -rf ${DOC} webclean: @rm -rf $(WWWDIR) distclean: webclean clean @rm -f *.pdf @rm -f images.pl labels.pl internals.pl @rm -f Makefile version.tex