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