]> git.sur5r.net Git - bacula/docs/blob - docs/manuals/en/misc/Makefile
3ae5bc3cb3a5066181ef069388c955f82ec236b1
[bacula/docs] / docs / manuals / en / misc / 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 DOC=misc
38 MAINDOC=Bacula_Miscellaneous_Guide.html
39 IMAGES=../../../images
40 DOCDIR=`pwd`
41 TEXFILES=$(wildcard *tex)
42 MAKEFORWEB=$(DOCDIR)/web.makefile
43 WEBFILESTOLINK=$(DOCDIR)/latex2html-init.pl $(DOCDIR)/bacula.sty $(DOCDIR)/translate_images.pl
44 #
45 # Main directory where to find all the documentation
46 DESTDIR=../pdf-and-html
47 #
48 # Location of documentation in PDF
49 PDF_DEST_DIR=$(DESTDIR)/$(DOC)
50 #
51 # Location of HTML documentation
52 HTML_DEST_DIR=$(DESTDIR)/$(DOC)
53 #
54 # Temporary directory to translate tex to HTML
55 WWW_BUILD_DIR=$(DESTDIR)/www-$(DOC)
56 #
57 # LATEX compiler
58 LATEX_TO_PDF= pdflatex --output-directory $(PDF_DEST_DIR)
59
60 first_rule: all
61
62 all: pdftex web mini-clean
63
64 .SUFFIXES:     .tex .html
65 .PHONY:
66 .DONTCARE:
67
68
69 destdir:
70         @echo
71         @echo "Making output directories..."
72         @mkdir -p $(PDF_DEST_DIR) $(HTML_DEST_DIR)
73         echo "Output directories done"
74
75 pdfimages: 
76         @echo "Generating PDF images..."
77         @(cd ${IMAGES}/svg ; make pdf)
78         @echo "Done."
79
80 pngimages:
81         @echo "Generating PNG images..."
82         @(cd ${IMAGES}/svg ; make png)
83         @echo "Done."
84
85 epsimages:
86         @echo "Generating EPS images..."
87         @(cd ${IMAGES}/svg ; make eps)
88         @rm -rf ${IMAGES}/png
89         @rm -rf ${IMAGES}/pdf
90         @echo "Done."
91
92 epscovers:
93         @echo -n "Linking coverpage and background EPS format..."
94         @(cd $(SVGCOVERSDIR) ; make eps)
95         @ln -sf `pwd`/${EPSCOVERSDIR}/${COVERNAME}.eps `pwd`/${BSYSMANUALDIR}/${BSYSMANNAME}.eps
96         @rm -f `pwd`/${BSYSMANUALDIR}/${BSYSMANNAME}.pdf
97         @echo "Done."
98
99 commonfiles:
100         @echo -n "Making version `cat version.tex`"
101         @echo -n "Linking shared files..."
102         @(for L in $(LICENCES); do ln -sf $$L .; done)
103         @echo "Done"
104
105 pdfcovers:
106         @echo ""
107         @echo "Making covers for $(DOC)"
108         @(cd $(IMAGES)/svg ; make pdf)
109         @echo "Covers done."
110         @echo ""
111
112 external-references: destdir
113         @echo " "
114         @echo "Building external references for $(DOC)"
115         @echo "\DeclareGraphicsExtensions{.pdf,.png,.jpg,.jpeg,.eps}\n" > graphicspolicy.tex
116         @export TEXINPUTS=.:../../../latex//: ; $(LATEX_TO_PDF) $(DOC)
117         @rm -f $(PDF_DEST_DIR)/$(DOC).pdf
118         @echo "$(DOC) external references done."
119
120 pdftex: destdir
121         @echo ""
122         @echo "Making PDF manual with $(LATEX_TO_PDF)compile..."
123         @echo "\DeclareGraphicsExtensions{.pdf,.png,.jpg,.jpeg,.eps}\n" > graphicspolicy.tex
124         @export TEXINPUTS=.:../../../latex//: ; $(LATEX_TO_PDF) $(DOC); makeindex ${DOC}.idx -o ${DOC}.ind 2>/dev/null ; $(LATEX_TO_PDF) $(DOC); $(LATEX_TO_PDF) $(DOC)
125         @echo "Done"
126
127
128 web: mini-clean
129         @echo "Making web"
130         @rm -rf $(WWW_BUILD_DIR)
131         @mkdir -p $(WWW_BUILD_DIR)
132         @echo "Adapting $(DOC) tex files for HTML documentation..."
133         @(for F in $(TEXFILES) ;\
134         do \
135         cat $$F | sed -f ../pattern-to-handle > $(WWW_BUILD_DIR)/$$F ; \
136         done)
137         @ln -sf $(MAKEFORWEB) $(WWW_BUILD_DIR)/Makefile
138         @(for F in $(WEBFILESTOLINK);\
139         do \
140         ln -sf $$F $(WWW_BUILD_DIR)/;\
141         done)
142         (cd $(WWW_BUILD_DIR) ; make )
143         @echo "Done making web"
144
145
146 show:
147         evince $(PDF_DEST_DIR)/${DOC}.pdf
148
149 texcheck:
150         ./check_tex.pl ${DOC}.tex
151
152 main_configs:
153         pic2graph -density 100 <main_configs.pic >main_configs.png
154
155 mini-clean:
156         @rm -f 1 2 3 *.tex~
157         @rm -f *.gif *.jpg *.eps
158         @rm -f *.aux *.cp *.fn *.ky *.log *.pg
159         @rm -f *.backup *.ilg *.lof *.lot
160         @rm -f *.cdx *.cnd *.ddx *.ddn *.fdx *.fnd *.ind *.sdx *.snd
161         @rm -f *.dnd *.old *.out 
162         @rm -f ${DOC}/*.gif ${DOC}/*.jpg ${DOC}/*.eps
163         @rm -f ${DOC}/*.aux ${DOC}/*.cp ${DOC}/*.fn ${DOC}/*.ky ${DOC}/*.log ${DOC}/*.pg
164         @rm -f ${DOC}/*.backup ${DOC}/*.ilg ${DOC}/*.lof ${DOC}/*.lot
165         @rm -f ${DOC}/*.cdx ${DOC}/*.cnd ${DOC}/*.ddx ${DOC}/*.ddn ${DOC}/*.fdx ${DOC}/*.fnd ${DOC}/*.ind ${DOC}/*.sdx ${DOC}/*.snd
166         @rm -f ${DOC}/*.dnd ${DOC}/*.old ${DOC}/*.out
167         @rm -f ${DOC}/WARNINGS
168         @rm -rf ../www-$(DOC)
169
170 clean:
171         @rm -f graphicspolicy.tex
172         @rm -f 1 2 3
173         @rm -f *.png *.gif *.jpg *.eps
174         @rm -f *.pdf *.aux *.cp *.fn *.ky *.log *.pg
175         @rm -f *.html *.backup *.pdf *.ps *.dvi *.ilg *.lof *.lot
176         @rm -f *.cdx *.cnd *.ddx *.ddn *.fdx *.fnd *.ind *.sdx *.snd
177         @rm -f *.dnd imagename_translations
178         @rm -f *.old WARNINGS *.out *.toc *.idx
179         @rm -f images.pl labels.pl internals.pl
180         @rm -f images.tex ${DOC}i.tex
181         @rm -f ${DOC}i-*.tex
182         @rm -rf $(WWW_BUILD_DIR)
183
184 distclean:  clean
185         @rm -f ${DOC}.html ${DOC}.pdf
186         @rm -f Makefile version.tex
187         @rm -rf $(WWW_BUILD_DIR)
188         @rm -rf $(HTML_DEST_DIR)