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