Debian Codegraph @

Makefile

raw ◀ ▶
Source reconstructed at patch state 1 of 3 — not the installed (fully patched) source.
3 Debian patches touch this file
1 #
2 #-------------------------------------------------------------------------
3 SHELL = /bin/sh
4
5 # if BUILD_VERBOSE is set to 1, output everything to the console
6 ifeq ($(BUILD_VERBOSE),1)
7 AT=
8 else
9 AT=@
10 endif
11
12 #
13 # bacula.env file is a local file to define specific values if any
14 # bacula.env.dist is a template for it.
15 BACULAENVFILE=bacula.env
16 ENVFILE=$(shell [ -e ./$(BACULAENVFILE) ] && echo "OK")
17 ifeq ($(ENVFILE),OK)
18 include $(BACULAENVFILE)
19 $(info Found env file $(BACULAENVFILE).)
20 else
21 $(error No environment file "$(BACULAENVFILE)" found. You can copy "$(BACULAENVFILE).dist" to "$(BACULAENVFILE)" and adjust some definitions.)
22 endif
23 #
24 # Where is latex2html tool
25 BLATEX2HTMLDIR=$(CURDIR)/latex2html-2016
26 #
27 # LaTeX directory to build bacula documentation (classes and layout)
28 LATEX_DIR=$(CURDIR)/latex
29 #
30 # latex2html requirements:
31 ## - The latex2html Makefile is required to build latex2html accordingly to our needs
32 LATEX2HTMLMAKEFILE=$(BLATEX2HTMLDIR)/Makefile
33 ## Destination of the build of latex2html (make install)
34 BBINDIR=$(CURDIR)/latex2html
35 ## tex files location for latex2html
36 BTEXDIR=$(LATEX_DIR)/latex2html
37 ## Perl5 libraries to build
38 PERL5LIB=$(BLATEX2HTMLDIR)
39 ## Files required for latex2html process when compiling tex files.
40 TRANSLATEIMGS=$(CURDIR)/manuals/translate_images.pl
41 LATEX2HTMLINIT=$(CURDIR)/manuals/latex2html-init.pl
42 ## latex2html binary
43 LATEX2HTML=$(BBINDIR)/bin/latex2html
44 ## Tool directory for the post-process
45 TOOLS_DIR=$(CURDIR)/tools
46 #
47 # PDF to latex compiler
48 ifneq ($(TEX_TO_PDF),)
49 $(info Using $(TEX_TO_PDF) compiler.)
50 else
51 $(info PDF compiler $(TEX_TO_PDF) undefined.)
52 TEX_TO_PDF=pdflatex
53 endif
54 COMPILER=$(shell which $(TEX_TO_PDF))
55 ifneq ($(COMPILER),)
56 $(info Compiler $(COMPILER) found.)
57 else
58 # This will *stop* the Makefile
59 $(error Unable to find $(TEX_TO_PDF))
60 endif
61 #
62 # For version.tex building process
63 ## bacula source directory
64 ifeq ($(BACULASRC),)
65 BACULASRC=$(HOME)
66 endif
67 # Location of the version.h file
68 VERSION_H=$(shell find $(BACULASRC) -name "version.h" -print)
69 ifeq ($(VERSION_H),)
70 $(error Unable to find version.h in Bacula source tree $(BACULASRC).)
71 else
72 $(info $(VERSION_H) file found into $(dir $(VERSION_H)))
73 endif
74 ## Bacula source directory (in the version.h point of view)
75 SOURCES_DIR=$(dir $(VERSION_H))
76 ## Location and name for the version.tex file
77 VERSION_TEX=$(LATEX_DIR)/version.tex
78 #
79 # Directories required
80 ## images
81 IMAGES_DIR=$(CURDIR)/images
82 PNGIMAGES_DIR=$(IMAGES_DIR)/png
83 JPGIMAGES_DIR=$(IMAGES_DIR)/jpg
84 SVGIMAGES_DIR=$(IMAGES_DIR)/svg
85 ## covers for manuals
86 COVERS_DIR=$(CURDIR)/covers
87 ## PDF covers
88 PDFCOVERS_DIR=$(COVERS_DIR)/pdf
89 ## SVG covers
90 SVGCOVERS_DIR=$(COVERS_DIR)/svg
91 ## Licence files
92 LICENCE_DIR=$(MANUALS_DIR)/licences
93 ## Coverpage name. There is only one coverpage used by the .cls LaTeX class file.
94 BMANUAL_NAME=bcoverpage
95 #
96 # Makefiles
97 ## The following Makefile is unique for PDF building and is used whatever the manual is.
98 GENERAL_MAKEFILE=$(CURDIR)/manuals/Makefile
99 ## The following Makefile is unique for HTML building and is used whatever the manual is.
100 WEB_MAKEFILE=$(CURDIR)/manuals/web.makefile
101
102 export BACULAVERSION
103 export PERL5LIB
104 export LATEX_DIR
105 export IMAGES_DIR
106 export COVERS_DIR
107 export PDFCOVERS_DIR
108 export SVGCOVERS_DIR
109 export LICENCE_DIR
110 export BMANUAL_NAME
111 export COMPILER
112 export COVERPAGE_NAME
113 export GENERAL_MAKEFILE
114 export WEB_MAKEFILE
115 export LATEX2HTMLINIT
116 export TRANSLATEIMGS
117 export LATEX2HTML
118 export TOOLSDIR
119 export VERSION_TEX
120 export TOOLS_DIR
121 export PNGIMAGES_DIR
122 export JPGIMAGES_DIR
123 export SVGIMAGES_DIR
124 export SVGCOVERS_DIR
125
126 externalreferencesfile=$(LATEX_DIR)/external-references.tex
127
128 # Installation target directories & other installation stuff
129 prefix = /usr/local
130 exec_prefix = ${prefix}
131 binprefix =
132 manprefix =
133 sbindir = ${exec_prefix}/sbin
134 sysconfdir = ${prefix}/etc
135 scriptdir = @scriptdir@
136 mandir = ${datarootdir}/man/man1
137 manext = 1
138 datarootdir=${prefix}/share
139
140
141 # Tools & program stuff
142 MV = /bin/mv
143 RM = /bin/rm
144 RMF = /bin/rm -f
145 CP = /bin/cp
146 SED = @SED@
147 AWK = /usr/bin/gawk
148 ECHO = /bin/echo
149 CMP = @CMP@
150 INSTALL = /usr/bin/install -c
151 # add the -s to the following in PRODUCTION mode
152 INSTALL_PROGRAM = /usr/bin/install -c -m @SBINPERM@
153 INSTALL_DATA = /usr/bin/install -c -m 644
154 INSTALL_SCRIPT = /usr/bin/install -c -m @SBINPERM@
155 INSTALL_CONFIG = /usr/bin/install -c -m 640
156
157
158 # End of common section of the Makefile
159 #-------------------------------------------------------------------------
160
161 srcdir = .
162 .PHONY: latex2html
163 .PATH: .
164
165 basedir = ..
166 topdir = ..
167 thisdir = docs
168 TRANSLATE=./htmls.sh
169
170 #
171 # Distribution variables
172 #
173
174 de_dirs = manuals/de/console manuals/de/developers manuals/de/main \
175 manuals/de/misc manuals/de/problems manuals/de/utility
176
177
178 en_dirs = manuals/en/concept manuals/en/console manuals/en/developers manuals/en/main \
179 manuals/en/misc manuals/en/problems manuals/en/utility
180
181 es_dirs = manuals/es/console manuals/es/developers manuals/es/main \
182 manuals/es/misc manuals/es/problems manuals/es/utility
183
184 fr_dirs = manuals/fr/console manuals/fr/developers manuals/fr/main \
185 manuals/fr/misc manuals/fr/problems manuals/fr/utility
186
187 image_dirs = images/svg
188 all_dirs = ${de_dirs} ${en_dirs} ${es_dirs} ${fr_dirs} ${image_dirs}
189
190 #-------------------------------------------------------------------------
191
192 en: all
193
194 all: $(VERSION_TEX) latex2html pdf-manuals html-manuals
195 $(AT)echo ""
196 $(AT)echo "All manuals built ..."
197 $(AT)echo ""
198 $(AT)echo ""
199 $(AT)echo ""
200
201 latex2html: $(BBINDIR)
202
203 $(BBINDIR): $(LATEX2HTMLMAKEFILE)
204 $(AT)$(MAKE) -C $(BLATEX2HTMLDIR) && $(MAKE) -C $(BLATEX2HTMLDIR) install
205
206 $(LATEX2HTMLMAKEFILE):
207 $(AT)echo "Building latex2html Makefile"
208 $(AT)(cd ${BLATEX2HTMLDIR} ; ./configure --prefix=${BBINDIR} --with-texpath=${BTEXDIR})
209 $(AT)echo "Makefile installed."
210
211 pdf-manuals: external-references
212 $(AT)echo " "
213 $(AT)echo "Generating PDF manuals..."
214 $(AT)for I in ${en_dirs}; \
215 do $(MAKE) -C $$I pdflatex || (echo ""; echo ""; echo " ====== Error in `pwd` ======"; echo ""; echo ""; exit 1;); done
216
217 #(cd $$I; echo "==>Entering directory `pwd`"; \
218 done
219 $(AT)echo ""
220 $(AT)echo "All PDF manuals built ..."
221 $(AT)echo ""
222 $(AT)echo ""
223 $(AT)echo ""
224
225 html-manuals:
226 $(AT)echo " "
227 $(AT)echo "Creating Web documentation..."
228 $(AT)for I in ${en_dirs}; \
229 do (cd $$I; echo "==>Entering directory `pwd`"; \
230 $(MAKE) web || (echo ""; echo ""; echo " ====== Error in `pwd` ======"; \
231 echo ""; echo ""; exit 1;)); \
232 done
233 $(AT)echo "Handling external references"
234 $(AT)for I in ${en_dirs} ;\
235 do (cd $$I ; $(MAKE) references || (echo ""; echo ""; echo " ====== Error in `pwd` ======"; \
236 echo ""; echo ""; exit 1;)); \
237 done
238 $(AT)echo "Remove links ..."
239 $(AT)find . -type l -exec rm {} \;
240 $(AT)echo ""
241 $(AT)echo "All HTML manuals built ..."
242 $(AT)echo ""
243 $(AT)echo ""
244 $(AT)echo ""
245
246
247 templates:
248 $(AT)echo " "
249 $(AT)echo -n "Linking templates.."
250 $(AT)mkdir -p ~/texmf/tex/latex/bsys/
251 $(AT)if [ ! -e ~/texmf/tex/latex/bsys/bsysmanual ] || [ -h ~/texmf/tex/latex/bsys/bsysmanual ]; \
252 then\
253 ln -sf `pwd`/bsysmanual ~/texmf/tex/latex/bsys/;\
254 fi
255 mktexlsr ~/texmf
256 $(AT)echo "Done"
257
258 external-references:
259 $(AT)echo " "
260 $(AT)echo -n "Building external references file"
261 $(AT)find ${en_dirs} -mindepth 0 -maxdepth 1 -name "*tex" -exec grep -q '\label' {} \; -print| awk -F/ '{ print "\\externaldocument[" $$3 "-]{../"$$3"/"$$4"}"}'|sed -e 's/.tex//g' > ${externalreferencesfile}
262 $(AT)for I in ${en_dirs}; \
263 do $(MAKE) -C $$I $@ || (echo ""; echo ""; echo " ====== Error in `pwd` ======"; echo ""; echo ""; exit 1;); done
264 $(AT)echo "All $@ built ..."
265 $(AT)echo "External references for all manuals built."
266
267 bacula-web:
268 $(AT)(if [ -x bacula-web ]; then cd bacula-web; make; fi)
269
270 fr: french
271
272 french:
273 # $(AT)for I in ${fr_dirs}; do (if [ -x $$I ]; then cd $$I; cp -f ../../version.tex .; fi); done
274 $(AT)for I in ${fr_dirs}; \
275 do (cd $$I; echo "==>Entering directory `pwd`"; \
276 $(MAKE) all || (echo ""; echo ""; echo " ====== Error in `pwd` ======"; \
277 echo ""; echo ""; exit 1;)); \
278 done
279
280 de: german
281
282 german:
283 # $(AT)for I in ${de_dirs}; do (if [ -x $$I ]; then cd $$I; cp -f ../../version.tex .; fi); done
284 $(AT)for I in ${de_dirs}; \
285 do (cd $$I; echo "==>Entering directory `pwd`"; \
286 $(MAKE) all || (echo ""; echo ""; echo " ====== Error in `pwd` ======"; \
287 echo ""; echo ""; exit 1;)); \
288 done
289
290 es: spanish
291
292 spanish:
293 # $(AT)for I in ${es_dirs}; do (if [ -x $$I ]; then cd $$I; cp -f ../../version.tex .; fi); done
294 $(AT)for I in ${es_dirs}; \
295 do (cd $$I; echo "==>Entering directory `pwd`"; \
296 $(MAKE) all || (echo ""; echo ""; echo " ====== Error in `pwd` ======"; \
297 echo ""; echo ""; exit 1;)); \
298 done
299
300
301 $(basedir)/$(VERNAME).lsm: LSM.in $(srcdir)/../autoconf/Make.common.in $(srcdir)/../src/version.h
302 $(SED) $(SEDREPLACE) < $(srcdir)/LSM.in > $@
303
304 clean:
305 $(AT)$(RMF) *~ 1 2 3 bacula-doc*.tar.gz
306 $(AT)(if [ -x bacula-web ] ; then cd bacula-web; make clean; fi)
307 $(AT)for I in ${all_dirs}; \
308 do (if [ -x $$I ]; then cd $$I; echo "==>Entering directory `pwd`"; ${MAKE} $@ || exit 1; fi); done
309
310
311 realclean: clean
312
313 distclean: $(LATEX2HTMLMAKEFILE) clean
314 $(AT)(cd $(BLATEX2HTMLDIR) ; make $@)
315 $(AT)rm -rf $(BBINDIR)
316 $(AT)rm -rf $(BTEXDIR)
317 $(AT)$(RMF) -r CVS html-manual/CVS home-page/CVS techlogs/CVS
318 $(AT)$(RMF) -rf autom4te.cache bacula-doc-* config.log config.out
319 $(AT)$(RMF) -f config.status kernsconfig
320 $(AT)(if [ -x bacula-web ] ; then cd bacula-web; make clean; fi)
321 $(AT)for I in ${all_dirs}; \
322 do (if [ -x $$I ]; then ${MAKE} -C $$I $@ || exit 1; fi); done
323 $(AT)rm -f ${VERSION_TEX}
324 $(AT)rm -f ${externalreferencesfile}
325
326
327
328 devclean:
329
330 depend:
331
332 install:
333 # $(INSTALL_DATA) bacula.1 $(DESTDIR)$(mandir)/$(manprefix)bacula.$(manext)
334
335 uninstall:
336 # -cd $(mandir); $(RMF) $(manprefix)bacula.$(manext)
337
338
339 version: $(VERSION_TEX)
340
341 $(VERSION_TEX): $(VERSION_H)
342 $(info Building version.tex)
343 $(AT)bacula=$(abspath $(SOURCES_DIR)../..) versionh=$(VERSION_H) versiontex=$(VERSION_TEX) ./update_version
344
345
346 verbose:
347 $(AT)echo "version.h file: $(VERSION_H)\n"
348 $(AT)echo "version.h directory: $(SOURCES_DIR)\n"
349 $(AT)echo "version.tex file: $(VERSION_TEX)"
350 $(AT)echo "LATEX2HTML_OK: $(LATEX2HTML_OK)"
351 $(AT)echo "TEX_TO_PDF: >$(TEX_TO_PDF)<"
352 $(AT)echo "TEX_TO_PDF_OK: $(TEX_TO_PDF_OK)"