Debian Codegraph @

Makefile

raw ◀ ▶
Source reconstructed at patch state 2 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 ## Location and name for the version.tex file
64 VERSION_TEX=$(LATEX_DIR)/version.tex
65 #
66 # Directories required
67 ## images
68 IMAGES_DIR=$(CURDIR)/images
69 PNGIMAGES_DIR=$(IMAGES_DIR)/png
70 JPGIMAGES_DIR=$(IMAGES_DIR)/jpg
71 SVGIMAGES_DIR=$(IMAGES_DIR)/svg
72 ## covers for manuals
73 COVERS_DIR=$(CURDIR)/covers
74 ## PDF covers
75 PDFCOVERS_DIR=$(COVERS_DIR)/pdf
76 ## SVG covers
77 SVGCOVERS_DIR=$(COVERS_DIR)/svg
78 ## Licence files
79 LICENCE_DIR=$(MANUALS_DIR)/licences
80 ## Coverpage name. There is only one coverpage used by the .cls LaTeX class file.
81 BMANUAL_NAME=bcoverpage
82 #
83 # Makefiles
84 ## The following Makefile is unique for PDF building and is used whatever the manual is.
85 GENERAL_MAKEFILE=$(CURDIR)/manuals/Makefile
86 ## The following Makefile is unique for HTML building and is used whatever the manual is.
87 WEB_MAKEFILE=$(CURDIR)/manuals/web.makefile
88
89 export BACULAVERSION
90 export PERL5LIB
91 export LATEX_DIR
92 export IMAGES_DIR
93 export COVERS_DIR
94 export PDFCOVERS_DIR
95 export SVGCOVERS_DIR
96 export LICENCE_DIR
97 export BMANUAL_NAME
98 export COMPILER
99 export COVERPAGE_NAME
100 export GENERAL_MAKEFILE
101 export WEB_MAKEFILE
102 export LATEX2HTMLINIT
103 export TRANSLATEIMGS
104 export LATEX2HTML
105 export TOOLSDIR
106 export VERSION_TEX
107 export TOOLS_DIR
108 export PNGIMAGES_DIR
109 export JPGIMAGES_DIR
110 export SVGIMAGES_DIR
111 export SVGCOVERS_DIR
112
113 externalreferencesfile=$(LATEX_DIR)/external-references.tex
114
115 # Installation target directories & other installation stuff
116 prefix = /usr/local
117 exec_prefix = ${prefix}
118 binprefix =
119 manprefix =
120 sbindir = ${exec_prefix}/sbin
121 sysconfdir = ${prefix}/etc
122 scriptdir = @scriptdir@
123 mandir = ${datarootdir}/man/man1
124 manext = 1
125 datarootdir=${prefix}/share
126
127
128 # Tools & program stuff
129 MV = /bin/mv
130 RM = /bin/rm
131 RMF = /bin/rm -f
132 CP = /bin/cp
133 SED = @SED@
134 AWK = /usr/bin/gawk
135 ECHO = /bin/echo
136 CMP = @CMP@
137 INSTALL = /usr/bin/install -c
138 # add the -s to the following in PRODUCTION mode
139 INSTALL_PROGRAM = /usr/bin/install -c -m @SBINPERM@
140 INSTALL_DATA = /usr/bin/install -c -m 644
141 INSTALL_SCRIPT = /usr/bin/install -c -m @SBINPERM@
142 INSTALL_CONFIG = /usr/bin/install -c -m 640
143
144
145 # End of common section of the Makefile
146 #-------------------------------------------------------------------------
147
148 srcdir = .
149 .PHONY: latex2html
150 .PATH: .
151
152 basedir = ..
153 topdir = ..
154 thisdir = docs
155 TRANSLATE=./htmls.sh
156
157 #
158 # Distribution variables
159 #
160
161 de_dirs = manuals/de/console manuals/de/developers manuals/de/main \
162 manuals/de/misc manuals/de/problems manuals/de/utility
163
164
165 en_dirs = manuals/en/concept manuals/en/console manuals/en/developers manuals/en/main \
166 manuals/en/misc manuals/en/problems manuals/en/utility
167
168 es_dirs = manuals/es/console manuals/es/developers manuals/es/main \
169 manuals/es/misc manuals/es/problems manuals/es/utility
170
171 fr_dirs = manuals/fr/console manuals/fr/developers manuals/fr/main \
172 manuals/fr/misc manuals/fr/problems manuals/fr/utility
173
174 image_dirs = images/svg
175 all_dirs = ${de_dirs} ${en_dirs} ${es_dirs} ${fr_dirs} ${image_dirs}
176
177 #-------------------------------------------------------------------------
178
179 en: all
180
181 all: $(VERSION_TEX) latex2html pdf-manuals html-manuals
182 $(AT)echo ""
183 $(AT)echo "All manuals built ..."
184 $(AT)echo ""
185 $(AT)echo ""
186 $(AT)echo ""
187
188 latex2html: $(BBINDIR)
189
190 $(BBINDIR): $(LATEX2HTMLMAKEFILE)
191 $(AT)$(MAKE) -C $(BLATEX2HTMLDIR) && $(MAKE) -C $(BLATEX2HTMLDIR) install
192
193 $(LATEX2HTMLMAKEFILE):
194 $(AT)echo "Building latex2html Makefile"
195 $(AT)(cd ${BLATEX2HTMLDIR} ; ./configure --prefix=${BBINDIR} --with-texpath=${BTEXDIR})
196 $(AT)echo "Makefile installed."
197
198 pdf-manuals: external-references
199 $(AT)echo " "
200 $(AT)echo "Generating PDF manuals..."
201 $(AT)for I in ${en_dirs}; \
202 do $(MAKE) -C $$I pdflatex || (echo ""; echo ""; echo " ====== Error in `pwd` ======"; echo ""; echo ""; exit 1;); done
203
204 #(cd $$I; echo "==>Entering directory `pwd`"; \
205 done
206 $(AT)echo ""
207 $(AT)echo "All PDF manuals built ..."
208 $(AT)echo ""
209 $(AT)echo ""
210 $(AT)echo ""
211
212 html-manuals:
213 $(AT)echo " "
214 $(AT)echo "Creating Web documentation..."
215 $(AT)for I in ${en_dirs}; \
216 do (cd $$I; echo "==>Entering directory `pwd`"; \
217 $(MAKE) web || (echo ""; echo ""; echo " ====== Error in `pwd` ======"; \
218 echo ""; echo ""; exit 1;)); \
219 done
220 $(AT)echo "Handling external references"
221 $(AT)for I in ${en_dirs} ;\
222 do (cd $$I ; $(MAKE) references || (echo ""; echo ""; echo " ====== Error in `pwd` ======"; \
223 echo ""; echo ""; exit 1;)); \
224 done
225 $(AT)echo "Remove links ..."
226 $(AT)find . -type l -exec rm {} \;
227 $(AT)echo ""
228 $(AT)echo "All HTML manuals built ..."
229 $(AT)echo ""
230 $(AT)echo ""
231 $(AT)echo ""
232
233
234 templates:
235 $(AT)echo " "
236 $(AT)echo -n "Linking templates.."
237 $(AT)mkdir -p ~/texmf/tex/latex/bsys/
238 $(AT)if [ ! -e ~/texmf/tex/latex/bsys/bsysmanual ] || [ -h ~/texmf/tex/latex/bsys/bsysmanual ]; \
239 then\
240 ln -sf `pwd`/bsysmanual ~/texmf/tex/latex/bsys/;\
241 fi
242 mktexlsr ~/texmf
243 $(AT)echo "Done"
244
245 external-references:
246 $(AT)echo " "
247 $(AT)echo -n "Building external references file"
248 $(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}
249 $(AT)for I in ${en_dirs}; \
250 do $(MAKE) -C $$I $@ || (echo ""; echo ""; echo " ====== Error in `pwd` ======"; echo ""; echo ""; exit 1;); done
251 $(AT)echo "All $@ built ..."
252 $(AT)echo "External references for all manuals built."
253
254 bacula-web:
255 $(AT)(if [ -x bacula-web ]; then cd bacula-web; make; fi)
256
257 fr: french
258
259 french:
260 # $(AT)for I in ${fr_dirs}; do (if [ -x $$I ]; then cd $$I; cp -f ../../version.tex .; fi); done
261 $(AT)for I in ${fr_dirs}; \
262 do (cd $$I; echo "==>Entering directory `pwd`"; \
263 $(MAKE) all || (echo ""; echo ""; echo " ====== Error in `pwd` ======"; \
264 echo ""; echo ""; exit 1;)); \
265 done
266
267 de: german
268
269 german:
270 # $(AT)for I in ${de_dirs}; do (if [ -x $$I ]; then cd $$I; cp -f ../../version.tex .; fi); done
271 $(AT)for I in ${de_dirs}; \
272 do (cd $$I; echo "==>Entering directory `pwd`"; \
273 $(MAKE) all || (echo ""; echo ""; echo " ====== Error in `pwd` ======"; \
274 echo ""; echo ""; exit 1;)); \
275 done
276
277 es: spanish
278
279 spanish:
280 # $(AT)for I in ${es_dirs}; do (if [ -x $$I ]; then cd $$I; cp -f ../../version.tex .; fi); done
281 $(AT)for I in ${es_dirs}; \
282 do (cd $$I; echo "==>Entering directory `pwd`"; \
283 $(MAKE) all || (echo ""; echo ""; echo " ====== Error in `pwd` ======"; \
284 echo ""; echo ""; exit 1;)); \
285 done
286
287
288 $(basedir)/$(VERNAME).lsm: LSM.in $(srcdir)/../autoconf/Make.common.in $(srcdir)/../src/version.h
289 $(SED) $(SEDREPLACE) < $(srcdir)/LSM.in > $@
290
291 clean:
292 $(AT)$(RMF) *~ 1 2 3 bacula-doc*.tar.gz
293 $(AT)(if [ -x bacula-web ] ; then cd bacula-web; make clean; fi)
294 $(AT)for I in ${all_dirs}; \
295 do (if [ -x $$I ]; then cd $$I; echo "==>Entering directory `pwd`"; ${MAKE} $@ || exit 1; fi); done
296
297
298 realclean: clean
299
300 distclean: $(LATEX2HTMLMAKEFILE) clean
301 $(AT)(cd $(BLATEX2HTMLDIR) ; make $@)
302 $(AT)rm -rf $(BBINDIR)
303 $(AT)rm -rf $(BTEXDIR)
304 $(AT)$(RMF) -r CVS html-manual/CVS home-page/CVS techlogs/CVS
305 $(AT)$(RMF) -rf autom4te.cache bacula-doc-* config.log config.out
306 $(AT)$(RMF) -f config.status kernsconfig
307 $(AT)(if [ -x bacula-web ] ; then cd bacula-web; make clean; fi)
308 $(AT)for I in ${all_dirs}; \
309 do (if [ -x $$I ]; then ${MAKE} -C $$I $@ || exit 1; fi); done
310 # $(AT)rm -f ${VERSION_TEX}
311 $(AT)rm -f ${externalreferencesfile}
312
313
314
315 devclean:
316
317 depend:
318
319 install:
320 # $(INSTALL_DATA) bacula.1 $(DESTDIR)$(mandir)/$(manprefix)bacula.$(manext)
321
322 uninstall:
323 # -cd $(mandir); $(RMF) $(manprefix)bacula.$(manext)
324
325
326 version: $(VERSION_TEX)
327
328 $(VERSION_TEX): $(VERSION_H)
329 $(info Building version.tex)
330 $(AT)bacula=$(abspath $(SOURCES_DIR)../..) versionh=$(VERSION_H) versiontex=$(VERSION_TEX) ./update_version
331
332
333 verbose:
334 $(AT)echo "version.h file: $(VERSION_H)\n"
335 $(AT)echo "version.h directory: $(SOURCES_DIR)\n"
336 $(AT)echo "version.tex file: $(VERSION_TEX)"
337 $(AT)echo "LATEX2HTML_OK: $(LATEX2HTML_OK)"
338 $(AT)echo "TEX_TO_PDF: >$(TEX_TO_PDF)<"
339 $(AT)echo "TEX_TO_PDF_OK: $(TEX_TO_PDF_OK)"