]> git.sur5r.net Git - bacula/docs/blob - docs/manuals/en/console/Makefile
Fix bad control sequence
[bacula/docs] / docs / manuals / en / console / Makefile
1 #
2 #
3 #  Makefile for LaTeX  
4 #
5 # To build everything do
6 #    make tex
7 #    make web
8 #    make html
9 #    make dvipdf
10 #
11 # or simply
12 #
13 #    make
14 #
15 # for rapid development do:
16 #    make tex
17 #    make show
18 #
19 #
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:
23 #
24 #   cd docs/manual
25 #   make tex
26 #   latex bacula.tex
27 #
28 #  typically the latex command will stop indicating the error (e.g. a
29 #  missing \ in front of a _ or a missing { or ] ...
30 #
31 #  The following characters must be preceded by a backslash
32 #    to be entered as printable characters:
33
34 #    # $ % & ~ _ ^ \ { }
35 #
36
37 IMAGES=../../../images/
38
39 DOC=console
40 MAINDOC=Bacula_Console_Operators_Gu.html
41 DOCDIR=`pwd`
42 TEXFILES=$(wildcard *tex)
43 MAKEFORWEB=$(DOCDIR)/web.makefile
44 WEBFILESTOLINK=$(DOCDIR)/latex2html-init.pl $(DOCDIR)/bacula.sty $(DOCDIR)/translate_images.pl
45 #
46 # Main directory where to find all the documentation
47 DESTDIR=../pdf-and-html
48 #
49 # Location of documentation in PDF
50 PDF_DEST_DIR=$(DESTDIR)/$(DOC)
51 #
52 # Location of HTML documentation
53 HTML_DEST_DIR=$(DESTDIR)/$(DOC)
54 #
55 # Temporary directory to translate tex to HTML
56 WWW_BUILD_DIR=$(DESTDIR)/www-$(DOC)
57 #
58 # LATEX compiler
59 LATEX_TO_PDF=pdflatex --output-directory $(PDF_DEST_DIR)
60 first_rule: all
61
62 all: pdftex web mini-clean
63
64 .SUFFIXES:     .tex .html
65 .PHONY:
66 .DONTCARE:
67
68 destdir:
69         @echo
70         @echo "Making output directories..."
71         @mkdir -p $(PDF_DEST_DIR) $(HTML_DEST_DIR)
72         echo "Output directories done"
73
74 pdfcovers:
75         @echo ""
76         @echo "Making covers for $(DOC)"
77         @(cd $(IMAGES)/svg ; make pdf)
78         @echo "Covers done."
79         @echo ""
80
81 external-references: destdir
82         @echo " "
83         @echo "Building external references for $(DOC)"
84         @echo "\DeclareGraphicsExtensions{.pdf,.png,.jpg,.jpeg,.eps}" > graphicspolicy.tex
85         @export TEXINPUTS=.:../../../latex//: ; $(LATEX_TO_PDF) $(DOC)
86         @rm -f $(PDF_DEST_DIR)/$(DOC).pdf
87         @echo "$(DOC) external references done."
88
89 pdftex: destdir
90         @echo ""
91         @echo "Making PDF manual with PDFLATEX compile..."
92         @echo "\DeclareGraphicsExtensions{.pdf,.png,.jpg,.jpeg,.eps}" > graphicspolicy.tex
93         @export TEXINPUTS=.:../../../latex//: ; $(LATEX_TO_PDF) $(DOC); makeindex ${DOC}.idx -o ${DOC}.ind 2>/dev/null ; $(LATEX_TO_PDF) $(DOC); $(LATEX_TO_PDF) $(DOC)
94 epscovers:
95         @echo " "
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
100         @echo "Done."
101
102 commonfiles:
103         @echo "Making version `cat version.tex`"
104         @echo -n "Linking shared files..."
105         @(for L in $(LICENCES); do ln -sf $$L .; done)
106         @echo "Done"
107
108
109 web: mini-clean
110         @echo "Making web"
111         @rm -rf $(WWW_BUILD_DIR)
112         @mkdir -p $(WWW_BUILD_DIR)
113         @echo "Adapting $(DOC) tex files for HTML documentation..."
114         @(for F in $(TEXFILES) ;\
115         do \
116         cat $$F | sed -f ../pattern-to-handle > $(WWW_BUILD_DIR)/$$F ; \
117         done)
118         @ln -sf $(MAKEFORWEB) $(WWW_BUILD_DIR)/Makefile
119         @(for F in $(WEBFILESTOLINK);\
120         do \
121         ln -sf $$F $(WWW_BUILD_DIR)/;\
122         done)
123         (cd $(WWW_BUILD_DIR) ; make )
124         @echo "Done making web"
125
126 show:
127         evince $(PDF_DEST_DIR)/${DOC}.pdf
128
129 texcheck:
130         ./check_tex.pl ${DOC}.tex
131
132 main_configs:
133         pic2graph -density 100 <main_configs.pic >main_configs.png
134
135 mini-clean:
136         @rm -f 1 2 3 *.tex~
137         @rm -f *.gif *.jpg *.eps
138         @rm -f *.aux *.cp *.fn *.ky *.log *.pg
139         @rm -f *.backup *.ilg *.lof *.lot
140         @rm -f *.cdx *.cnd *.ddx *.ddn *.fdx *.fnd *.ind *.sdx *.snd
141         @rm -f *.dnd *.old *.out 
142         @rm -f ${DOC}/*.gif ${DOC}/*.jpg ${DOC}/*.eps
143         @rm -f ${DOC}/*.aux ${DOC}/*.cp ${DOC}/*.fn ${DOC}/*.ky ${DOC}/*.log ${DOC}/*.pg
144         @rm -f ${DOC}/*.backup ${DOC}/*.ilg ${DOC}/*.lof ${DOC}/*.lot
145         @rm -f ${DOC}/*.cdx ${DOC}/*.cnd ${DOC}/*.ddx ${DOC}/*.ddn ${DOC}/*.fdx ${DOC}/*.fnd ${DOC}/*.ind ${DOC}/*.sdx ${DOC}/*.snd
146         @rm -f ${DOC}/*.dnd ${DOC}/*.old ${DOC}/*.out
147         @rm -f ${DOC}/WARNINGS
148         @rm -rf $(WWW_BUILD_DIR)
149
150 clean:
151         @rm -f graphicspolicy.tex
152         @rm -f 1 2 3 *.tex~
153         @rm -f *.png *.gif *.jpg *.eps
154         @rm -f *.pdf *.aux *.cp *.fn *.ky *.log *.pg
155         @rm -f *.html *.backup *.ps *.dvi *.ilg *.lof *.lot
156         @rm -f *.cdx *.cnd *.ddx *.ddn *.fdx *.fnd *.ind *.sdx *.snd
157         @rm -f *.dnd imagename_translations
158         @rm -f *.old WARNINGS *.out *.toc *.idx
159         @rm -f ${DOC}i-*.tex
160         @rm -rf $(WWW_BUILD_DIR)
161
162 distclean: clean
163         @rm -f images.pl labels.pl internals.pl
164         @rm -rf $(WWW_BUILD_DIR)
165         @rm -rf $(HTML_DEST_DIR)