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