Debian Codegraph @

texmf-dist/source/generic/tex4ht/Makefile

raw
1 # $Id: Makefile 1807 2026-05-13 00:45:05Z karl $
2 # This file is public domain. Originally written 2010, Karl Berry.
3 # Assumes GNU make.
4
5 # todo: look for xx below, among much more.
6
7 # need bash for the set -o pipefail used in some update pipelines.
8 SHELL = /bin/sh
9
10 # setting PATH as it's nice to find our own (development) scripts,
11 # e.g., look for xmlint and vcss in ./extra-bin.
12 extra_bin = ./extra-bin
13 ht_bin = ../bin/ht/unix
14 PATH := $(shell echo $$PATH)
15 #
16 # per-user addition to PATH. We need to use LaTeX out of current TeX Live,
17 # since changes that affect tex4ht are often made. If set, include trailing :.
18 user_bin :=
19 #
20 export PATH := $(ht_bin):$(extra_bin):$(user_bin)$(PATH)
21
22 homedir ?= tex4ht.dir
23 wd = work.dir
24 htmldir = html.dir
25 xtpipesdir = xtpipes.dir
26 deriveddir = derived.dir
27 texmf_t4ht_bin = texmf/tex4ht/bin
28 # List of directories we'll substitute into the tex4ht-dir.tex file
29 # in target below:
30 dirs = homedir wd htmldir xtpipesdir deriveddir texmf_t4ht_bin
31
32 # The do_java variable controls whether the .java files are output
33 # by calls within the .tex files (never done any more), or through the
34 # Makefile as usual (what we always do).
35 # 0 = in Makefile only (leave it set to this)
36 # 1 = in .tex only (don't use this)
37 #
38 do_java ?= 0
39 java_in_make := false
40 java_in_tex := false
41 ifeq ($(do_java),0)
42 java_in_make := true
43 else ifeq ($(do_java),1)
44 java_in_tex := true
45 else
46 $(error Invalid do_java ($(do_java)), value must be 0)
47 endif
48
49 # The xtpipes.jar is an intermediate product that is needed only when
50 # java compilation is made through t4ht system call (do_java=1),
51 # not when the java compilation is made in Makefile (do_java=0).
52 # We never try to use t4ht/java_in_tex any more, but leaving this
53 # here for posterity anyway.
54 ifeq ($(java_in_tex),true)
55 xtpipes_jar = $(wd)/bin/xtpipes.jar
56 else
57 xtpipes_jar = #
58 endif
59
60 tex_opts = --interaction=nonstopmode -recorder #--file-line-error
61 tex_1opt = "$(tex_opts)" # must be quoted, passing to shell script
62 dev_null = </dev/null # when we don't call tex directly.
63
64 HTTEX = ht "etex $(tex_opts)" # set tex options for plain tex
65
66 # Although many of the source files say to use xhlatex, we always use
67 # htlatex instead. xhlatex generates XHTML from the literate source and
68 # then validates each (sub)file with xmllint (as defined in tex4ht.env),
69 # which is hundreds of calls, none of which we care about. It's fine for
70 # us to just generate regular HTML, in the unlikely event of wanting to
71 # look at those generated files anyway.
72
73 default: all
74
75 # tex4ht.sty is read by most (all?) files, but we have to avoid
76 # depending on it for the file which generates it (tex4ht-sty.tex), so
77 # we need two different variables.
78 #
79 common_no_tex4ht_sty = tex4ht-cpright.tex common.tex common-code.tex \
80 ProTex.sty AlProTex.sty tex4ht-dir.tex
81 common = tex4ht.sty $(common_no_cond_sty)
82 common_info = $(common) common-info.tex
83 #
84 # mktex4ht.4ht is read by almost everything, but since it is mostly just
85 # the list of packages, it changes often, without any particular need to
86 # rebuild everything when it does. So leave it out.
87
88 # Substitute directories used for use in TeX, especially for Java.
89 tex4ht-dir.tex: tex4ht-dir.m4
90 m4 $(foreach def,$(dirs) java_in_tex,-D $(def)="$($(def))") $< >$@ \
91 || { rm -f $@; exit 1; }
92
93 # Start long list of generated files from the literate sources. Needs more.
94 derived =
95
96 derived += $(tex4ht_cond4ht_derived)
97 tex4ht_cond4ht_derived = cond4ht.4ht mktex4ht.4ht
98 derived += $(tex4ht_4ht_derived)
99 tex4ht_4ht_derived = \
100 abstract.4ht adjustbox.4ht algorithmic.4ht amsmath.4ht \
101 animate.4ht authblk.4ht appendix.4ht \
102 biblatex.4ht biblatex-chicago.4ht book.4ht bussproofs.4ht \
103 caption.4ht cleveref.4ht color.4ht colortbl.4ht csbulletin.4ht \
104 fontspec.4ht fontspec-4ht.lua fontspec-luatex.4ht fontspec-xetex.4ht \
105 footmisc.4ht framed.4ht frenchb.4ht floatpag.4ht \
106 geometry.4ht graphics.4ht graphicx.4ht \
107 hyperref.4ht hyperxmp.4ht \
108 imakeidx.4ht \
109 jurabib.4ht \
110 latex.4ht lettrine.4ht listings.4ht longtable.4ht \
111 ltugboat.4ht ltugboat-a.4ht ltugproc.4ht ltugproc-a.4ht \
112 magyar.4ht mdframed.4ht memoir.4ht minted.4ht multicol.4ht multirow.4ht \
113 nameref.4ht natbib.4ht \
114 parallel.4ht proof.4ht pstricks.4ht pythontex.4ht \
115 quoting.4ht \
116 reading.4ht \
117 scrartcl.4ht scrbook.4ht scrreprt.4ht scrjura.4ht sectionbreak.4ht \
118 skak.4ht spanish.4ht subscript.4ht svg.4ht \
119 tabu.4ht tcolorbox.4ht texpower.4ht titlesec.4ht tocloft.4ht \
120 tuenc-luatex.4ht tuenc-xetex.4ht \
121 tugboat.4ht \
122 usepackage.4ht usepackage-fontspec.4ht \
123 wrapfig.4ht \
124 xcolor.4ht xr.4ht xr-hyper.4ht
125 # xx and many, many more.
126
127 derived += $(tex4ht_bibtex2_derived)
128 tex4ht_bibtex2_derived = bibtex2.4ht
129
130 derived += $(tex4ht_c_derived)
131 tex4ht_c_derived = tex4ht.c
132
133 derived += $(tex4ht_docbook_derived)
134 tex4ht_docbook_derived = docbook.4ht docbook-math.4ht docbook-mml.4ht
135
136 derived += $(tex4ht_docbook_xtpipes_derived)
137 tex4ht_docbook_xtpipes_derived = docbook.4xt DbUtilities.java
138 derived_all_java += DbUtilities.java
139
140 derived += $(tex4ht_env_derived)
141 tex4ht_env_derived = tex4ht.env-unix tex4ht.env-win32
142
143 derived += $(tex4ht_fonts_cjk_derived)
144 tex4ht_fonts_cjk_derived = \
145 $(ht_fonts_devdir)/unicode/cjk/gbksong/gbksong01.htf
146 # and a whole lot more
147
148 derived += $(tex4ht_fonts_cjk_utf8_derived)
149 tex4ht_fonts_cjk_utf8_derived = \
150 $(ht_fonts_devdir)/unicode/cjk/utf8/unisonga0.htf
151
152 # noncjk.tex \input's modern, but seems more maintainable
153 # to have separate lists.
154 ht_fonts_devdir = $(homedir)/texmf/tex4ht/ht-fonts
155 derived += $(tex4ht_fonts_noncjk_derived)
156 tex4ht_fonts_noncjk_derived = \
157 $(ht_fonts_devdir)/alias/bera/fveb8r.htf \
158 $(ht_fonts_devdir)/alias/bera/fveb8t.htf \
159 $(ht_fonts_devdir)/alias/bera/fver8r.htf \
160 $(ht_fonts_devdir)/alias/bera/fver8t.htf \
161 $(ht_fonts_devdir)/alias/bera/fvero8r.htf \
162 $(ht_fonts_devdir)/alias/bera/fvero8t.htf \
163 $(ht_fonts_devdir)/alias/ec/eccc.htf \
164 $(ht_fonts_devdir)/alias/fontawesome/fa6.htf \
165 $(ht_fonts_devdir)/alias/t1fonts/ClearSans-BoldItalic-lf-t1.htf \
166 $(ht_fonts_devdir)/alias/t1fonts/XCharter-Bold-tlf-t1--base.htf \
167 $(ht_fonts_devdir)/alias/t1fonts/XCharter-Italic-tlf-t1--base.htf \
168 $(ht_fonts_devdir)/alias/t1fonts/XCharter-Roman-tlf-t1--base.htf \
169 $(ht_fonts_devdir)/alias/t1fonts/ipxg-r-t1.htf \
170 $(ht_fonts_devdir)/iso8859/1/tibetan/ctib.htf \
171 $(ht_fonts_devdir)/unicode/adobe/courier/pcrro8r.htf \
172 $(ht_fonts_devdir)/unicode/ccicons/ccicons.htf \
173 $(ht_fonts_devdir)/unicode/ec/eccc-uni.htf \
174 $(ht_fonts_devdir)/unicode/jknappen/tc/tcrm.htf \
175 $(ht_fonts_devdir)/unicode/misc/SkakNew.htf \
176 $(ht_fonts_devdir)/unicode/pl/plbsy.htf \
177 $(ht_fonts_devdir)/unicode/tibetan/ctib.htf
178
179 # Although SearchFonts.java is created by fonts-noncjk, it's a
180 # development tool that we don't use and have no need for, so don't list
181 # it or try to compile it. (See source for a little more info.)
182 # $(wd)/src/SearchFonts.java
183
184 derived += $(tex4ht_fonts_modern_derived)
185 tex4ht_fonts_modern_derived = \
186 $(ht_fonts_devdir)/alias/lm/rm-lmt.htf \
187 $(ht_fonts_devdir)/alias/lm/rm-lmvt.htf \
188 $(ht_fonts_devdir)/unicode/lm/l7x-lm.htf \
189 $(ht_fonts_devdir)/unicode/lm/l7x-lmcsc.htf \
190 $(ht_fonts_devdir)/unicode/lm/lm-ts1.htf \
191 $(ht_fonts_devdir)/unicode/lm/rm-lm.htf \
192 lm-htf.tex
193
194 derived += $(tex4ht_fonts_ebgaramond_derived)
195 tex4ht_fonts_ebgaramond_derived = \
196 $(ht_fonts_devdir)/unicode/EB_Garamond_Regular/EBGaramond-Regular-lf-t1.htf \
197 $(ht_fonts_devdir)/alias/EB_Garamond_Bold/EBGaramond-Bold-osf-t1.htf
198
199 derived += $(tex4ht_fonts_libertine_derived)
200 tex4ht_fonts_libertine_derived = \
201 $(ht_fonts_devdir)/unicode/Linux_Biolinum_T/LinBiolinumT-lf-sc-ly1.htf
202
203 derived += $(tex4ht_fonts_libertinus_derived)
204 tex4ht_fonts_libertinus_derived = \
205 $(ht_fonts_devdir)/unicode/libertinus/LibertinusSans-Italic-lf-lgr.htf
206
207 derived += $(tex4ht_fonts_newtx_derived)
208 tex4ht_fonts_newtx_derived = \
209 $(ht_fonts_devdir)/unicode/txbmiaX/ntxbmia.htf
210
211 derived += $(tex4ht_fonts_fourier_derived)
212 tex4ht_fonts_fourier_derived = \
213 $(ht_fonts_devdir)/unicode/Fourier-Math-Letters/futmi.htf
214
215 derived += $(tex4ht_fonts_spectral_derived)
216 tex4ht_fonts_spectral_derived = \
217 $(ht_fonts_devdir)/unicode/Spectral/Spectral-Regular-lf-sc-ly1.htf
218
219 derived += $(tex4ht_fonts_kpfonts_derived)
220 tex4ht_fonts_kpfonts_derived = \
221 $(ht_fonts_devdir)/unicode/Kp-Light-M-Syd/jkplsyd.htf
222
223 derived += $(tex4ht_fonts_opensans_derived)
224 tex4ht_fonts_opensans_derived = \
225 $(ht_fonts_devdir)/unicode/Open_Sans_Light/OpenSans-LightItalic-OT1-LF.htf
226 # xx and many more
227 # whither tmp? how change target dir? what happened to cmtex.htf? etc.
228
229 derived += $(tex4ht_fonts_mnsymbol_derived)
230 tex4ht_fonts_mnsymbol_derived = \
231 $(ht_fonts_devdir)/unicode/MnSymbol/MnSymbolA-Bold10.htf
232
233 # somehow have to push this to tlcontrib; since Minion is nonfree,
234 # can't put it into TL. For now, avoid compiling/installing it,
235 # since then it shows up with all the consistency checks.
236 #derived += $(tex4ht_fonts_minionpro_derived)
237 tex4ht_fonts_minionpro_derived = \
238 $(ht_fonts_devdir)/unicode/Minion_Pro/MinionPro-It-lf-l1-ot1.htf
239
240 derived += $(tex4ht_fonts_stix_derived)
241 tex4ht_fonts_stix_derived = \
242 $(ht_fonts_devdir)/unicode/STIX/stix-mathbb.htf
243
244 derived += $(tex4ht_fonts_stix2_derived)
245 tex4ht_fonts_stix2_derived = \
246 $(ht_fonts_devdir)/unicode/STIX_Two/stix2-mathbb.htf
247
248 derived += $(tex4ht_fonts_arphic_derived)
249 tex4ht_fonts_arphic_derived = \
250 $(ht_fonts_devdir)/unicode/arphic/bsmiu9d.htf
251
252 # htcmd not used
253 #derived += $(tex4ht_htcmd_derived)
254 #tex4ht_htcmd_derived = htcmd.c
255
256 derived += $(tex4ht_fonts_4hf)
257 tex4ht_fonts_4hf = \
258 $(ht_fonts_devdir)/mozilla/charset/unicode.4hf \
259 $(ht_fonts_devdir)/unicode/charset/unicode.4hf \
260
261 # xx and many more
262
263 derived += $(tex4ht_html_speech_derived)
264 tex4ht_html_speech_derived = html-speech.4ht html-speech-math.4ht emacspeak.4ht
265
266 derived += $(tex4ht_html_speech_xtpipes_derived)
267 tex4ht_html_speech_xtpipes_derived = htspk.4xt HtSpk.java
268 derived_all_java += HtSpk.java
269
270 derived += $(tex4ht_html0_derived)
271 tex4ht_html0_derived = html0.4ht
272
273 derived += $(tex4ht_html32_derived)
274 tex4ht_html32_derived = html32.4ht html32-math.4ht
275
276 derived += $(tex4ht_html4_derived)
277 tex4ht_html4_derived = \
278 html4.4ht html4-math.4ht \
279 html4-l2-url.4ht html4-russian-accents.4ht \
280 onmouseover.4ht exerqz.4ht
281
282 #xx big changes for unknown reasons
283 derived += $(tex4ht_info_derived)
284 tex4ht_info_derived = info4ht.4ht
285
286 derived += $(tex4ht_info_html4_derived)
287 tex4ht_info_html4_derived = infoht4.4ht
288
289 derived += $(tex4ht_info_javahelp_derived)
290 tex4ht_info_javahelp_derived = infojh.4ht
291
292 derived += $(tex4ht_info_mml_derived)
293 tex4ht_info_mml_derived = infomml.4ht
294
295 derived += $(tex4ht_info_ooffice_derived)
296 tex4ht_info_ooffice_derived = infoof.4ht
297
298 derived += $(tex4ht_info_svg_derived)
299 tex4ht_info_svg_derived = infosvg.4ht
300
301 derived += $(tex4ht_javahelp_derived)
302 tex4ht_javahelp_derived = javahelp.4ht javahelp-a.4ht
303
304 derived += $(tex4ht_javahelp_xtpipes_derived)
305 tex4ht_javahelp_xtpipes_derived = javahelp.4xt
306
307 derived += $(tex4ht_jsmath_derived)
308 tex4ht_jsmath_derived = jsmath.4ht html-jsmath.4ht
309
310 derived += $(tex4ht_jsml_xtpipes_derived)
311 tex4ht_jsml_xtpipes_derived = jsml.4xt $(tex4ht_jsml_xtpipes_derived_java)
312 tex4ht_jsml_xtpipes_derived_java = \
313 HtJsml.java GroupMn.java JsmlFilter.java JsmlMathBreak.java
314 derived_all_java += $(tex4ht_jsml_xtpipes_derived_java)
315
316 derived += $(tex4ht_jsml_derived)
317 tex4ht_jsml_derived = jsml.4ht jsml-math.4ht
318
319 derived += $(tex4ht_mathltx_derived)
320 tex4ht_mathltx_derived = mathltx.4ht html-mltx.4ht
321
322 derived += $(tex4ht_mathml_derived)
323 tex4ht_mathml_derived = mathml.4ht html-mml.4ht
324
325 derived += $(tex4ht_mathplayer_derived)
326 tex4ht_mathplayer_derived = mathplayer.4ht
327
328 derived += $(tex4ht_mkht_derived)
329 tex4ht_mkht_derived = mkht.4ht mk4ht.perl mkht-scripts.4ht ht.unix ht.bat
330
331 derived += $(tex4ht_moz_derived)
332 tex4ht_moz_derived = mozilla.4ht
333
334 derived += $(tex4ht_html5_derived)
335 tex4ht_html5_derived = html5.4ht
336
337 derived += $(tex4ht_oo_xtpipes_derived)
338 tex4ht_oo_xtpipes_derived = \
339 oo-math.4xt oo-text.4xt $(tex4ht_oo_xtpipes_derived_java)
340 tex4ht_oo_xtpipes_derived_java = \
341 OoUtilities.java OomFilter.java OoFilter.java
342 derived_all_java += $(tex4ht_oo_xtpipes_derived_java)
343
344 derived += $(tex4ht_ooffice_derived)
345 tex4ht_ooffice_derived = ooffice.4ht ooffice-mml.4ht
346
347 derived += $(tex4ht_ooimpress_derived)
348 tex4ht_ooimpress_derived = ooimpress.4ht
349
350 derived += $(tex4ht_options_derived)
351 tex4ht_options_derived = tex4ht.4ht
352
353 derived += $(tex4ht_sty_derived)
354 tex4ht_sty_derived = tex4ht.sty
355
356 derived += $(tex4ht_svg_derived)
357 tex4ht_svg_derived = svg-option.4ht html4-svg.4ht
358
359 derived += $(tex4ht_t4ht_derived)
360 tex4ht_t4ht_derived = t4ht.c
361
362 derived += $(tex4ht_tei_derived)
363 tex4ht_tei_derived = tei.4ht tei-mml.4ht tei-math.4ht tei-mmltei.4ht
364
365 derived += $(tex4ht_jats_derived)
366 tex4ht_jats_derived = jats.4ht
367
368 derived += $(tex4ht_unicode_derived)
369 tex4ht_unicode_derived = unicode.4ht
370
371 derived += $(tex4ht_word_derived)
372 tex4ht_word_derived = htmlw.4ht
373
374 derived += $(tex4ht_xhtml_xtpipes_derived)
375 tex4ht_xhtml_xtpipes_derived = xhtml.4xt XhtmlEmails.java
376 derived_all_java += XhtmlEmails.java
377
378 derived += $(tex4ht_xhtmml_xtpipes_derived)
379 tex4ht_xhtmml_xtpipes_derived = xhtmml.4xt XhtmmlUtilities.java
380 derived_all_java += XhtmmlUtilities.java
381
382 derived += $(tex4ht_mathjax_derived)
383 tex4ht_mathjax_derived = mathjax-latex-4ht.4ht
384
385 # xtpipes.tex writes into a variety of subdirectories with
386 # the \AddFile command defined there.
387 derived += $(xtpipes_derived)
388 derived_all_java += $(xtpipes_derived_java)
389 xtpipes_derived_java = \
390 $(addprefix $(wd)/src/, \
391 xtpipes.java \
392 xtpipes/FileInfo.java \
393 xtpipes/InputObject.java \
394 xtpipes/Xtpipes.java \
395 xtpipes/XtpipesPrintWriter.java \
396 xtpipes/XtpipesUni.java \
397 xtpipes/util/ScriptsManager.java \
398 xtpipes/util/ScriptsManagerLH.java \
399 )
400 #
401 derived_all_java += $(xtpipes_derived_lib)
402 xtpipes_derived_lib = \
403 $(addprefix $(xtpipesdir)/, \
404 xtpipes/lib/xtpipes-default.4xt \
405 xtpipes/lib/xtpipes-map.dtd \
406 xtpipes/lib/xtpipes.dtd \
407 )
408 #
409 xtpipes_derived = $(xtpipes_derived_java) $(xtpipes_derived_lib) $(xtpipes_jar)
410
411 #
412 all: $(derived)
413 rm -f texput.log; texlua checklog.lua *.log
414
415 $(tex4ht_4ht_derived): tex4ht-4ht.tex cond4ht.4ht $(common)
416 etex $(tex_opts) $<
417
418 $(tex4ht_bibtex2_derived): tex4ht-bibtex2.tex $(common)
419 latex $(tex_opts) $<
420
421 $(tex4ht_c_derived): tex4ht-c.tex $(common)
422 etex $(tex_opts) $<
423
424 $(tex4ht_cond4ht_derived): tex4ht-cond4ht.tex mktex4ht-cnf.tex $(common)
425 etex $(tex_opts) $<
426 etex $(tex_opts) cond4ht.4ht
427
428 $(tex4ht_docbook_derived): tex4ht-docbook.tex $(common)
429 htlatex $< "html,3" "" "" $(tex_1opt)
430
431 $(tex4ht_docbook_xtpipes_derived): tex4ht-docbook-xtpipes.tex $(common)
432 htlatex $< "html,3" "" "" $(tex_1opt)
433
434 $(tex4ht_env_derived): tex4ht-env.tex $(common)
435 htlatex $< "xhtml,3" "" "" $(tex_1opt)
436
437 $(tex4ht_fonts_cjk_derived): tex4ht-fonts-cjk.tex
438 $(HTTEX) $< ""
439
440 $(tex4ht_fonts_cjk_utf8_derived): tex4ht-fonts-cjk-utf8.tex
441 $(HTTEX) $< ""
442
443 $(tex4ht_fonts_noncjk_derived) $(tex4ht_fonts_modern_derived): \
444 tex4ht-fonts-noncjk.tex tex4ht-fonts-modern.tex $(common)
445 $(HTTEX) $< ""
446
447 $(tex4ht_fonts_ebgaramond_derived): tex4ht-fonts-ebgaramond.tex
448 $(HTTEX) $< ""
449
450 $(tex4ht_fonts_libertine_derived): tex4ht-fonts-libertine.tex
451 $(HTTEX) $< ""
452
453 $(tex4ht_fonts_libertinus_derived): tex4ht-fonts-libertinus.tex
454 $(HTTEX) $< ""
455
456 $(tex4ht_fonts_newtx_derived): tex4ht-fonts-newtx.tex
457 $(HTTEX) $< ""
458
459 $(tex4ht_fonts_fourier_derived): tex4ht-fonts-fourier.tex
460 $(HTTEX) $< ""
461
462 $(tex4ht_fonts_spectral_derived): tex4ht-fonts-spectral.tex
463 $(HTTEX) $< ""
464
465 $(tex4ht_fonts_kpfonts_derived): tex4ht-fonts-kpfonts.tex
466 $(HTTEX) $< ""
467
468 $(tex4ht_fonts_opensans_derived): tex4ht-fonts-opensans.tex
469 $(HTTEX) $< ""
470
471 $(tex4ht_fonts_mnsymbol_derived): tex4ht-fonts-mnsymbol.tex
472 $(HTTEX) $< ""
473
474 $(tex4ht_fonts_minionpro_derived): tex4ht-fonts-minionpro.tex
475 $(HTTEX) $< ""
476
477 $(tex4ht_fonts_stix_derived): tex4ht-fonts-stix.tex
478 $(HTTEX) $< ""
479
480 $(tex4ht_fonts_stix2_derived): tex4ht-fonts-stix2.tex
481 $(HTTEX) $< ""
482
483 $(tex4ht_fonts_arphic_derived): tex4ht-fonts-arphic.tex
484 $(HTTEX) $< ""
485
486 # requires more memory than configured in other tex programs.
487 $(tex4ht_fonts_4hf): tex4ht-fonts-4hf.tex
488 dvilualatex $<
489 tex4ht `basename $< .tex`
490 t4ht `basename $< .tex`
491
492 $(tex4ht_htcmd_derived): tex4ht-htcmd.tex $(common)
493 $(HTTEX) $< ""
494
495 $(tex4ht_html_speech_derived): tex4ht-html-speech.tex $(common)
496 htlatex $< "html,3,sections+" "" "" $(tex_1opt)
497
498 $(tex4ht_html_speech_xtpipes_derived): tex4ht-html-speech-xtpipes.tex $(common)
499 htlatex $< "html,next,3" "" "" $(tex_1opt)
500
501 $(tex4ht_html0_derived): tex4ht-html0.tex $(common)
502 htlatex $< "html,3,sections+" "" "" $(tex_1opt)
503
504 $(tex4ht_html32_derived): tex4ht-html32.tex $(common)
505 htlatex $< "html,3,sections+" "" "" $(tex_1opt)
506
507 $(tex4ht_html4_derived): tex4ht-html4.tex $(common)
508 latex $(tex_opts) $<
509 latex $(tex_opts) $<
510
511 $(tex4ht_html5_derived): tex4ht-html5.tex $(common)
512 htlatex $< "xhtml,3,sections+" "" "" $(tex_1opt)
513
514 $(tex4ht_info_html4_derived): tex4ht-info-html4.tex $(common_info)
515 htlatex $< "html,3,sections+" "" "" $(tex_1opt)
516
517 $(tex4ht_jats_derived): tex4ht-jats.tex $(common)
518 htlatex $< "html,3,sections+" "" "" $(tex_1opt)
519
520 $(tex4ht_info_javahelp_derived): tex4ht-info-javahelp.tex $(common_info)
521 htlatex $< "html,sections+" "" "" $(tex_1opt)
522
523 $(tex4ht_info_mml_derived): tex4ht-info-mml.tex $(common_info)
524 latex $(tex_opts) $<
525
526 $(tex4ht_info_ooffice_derived): tex4ht-info-ooffice.tex $(common_info)
527 htlatex $< "html,sections+" "" "" $(tex_1opt)
528
529 $(tex4ht_info_svg_derived): tex4ht-info-svg.tex $(common_info)
530 latex $(tex_opts) $<
531
532 $(tex4ht_info_derived): tex4ht-info.tex $(common)
533 htlatex $< "html,3,sections+" "" "" $(tex_1opt)
534
535 $(tex4ht_javahelp_derived): tex4ht-javahelp.tex $(common)
536 htlatex $< "html,3,sections+" "" "" $(tex_1opt)
537
538 $(tex4ht_javahelp_xtpipes_derived): tex4ht-javahelp-xtpipes.tex $(common)
539 htlatex $< "xhtml,next,3" "" "" $(tex_1opt)
540
541 $(tex4ht_jsmath_derived): tex4ht-jsmath.tex $(common)
542 htlatex $< "html,3,sections+" "" "" $(tex_1opt)
543
544 $(tex4ht_jsml_xtpipes_derived): \
545 tex4ht-jsml-xtpipes.tex $(common) $(xtpipes_jar)
546 htlatex $< "xhtml,next,3" "" "" $(tex_1opt)
547
548 $(tex4ht_jsml_derived): tex4ht-jsml.tex $(common)
549 htlatex $< "html,3,sections+" "" "" $(tex_1opt)
550
551 $(tex4ht_mathjax_derived): tex4ht-mathjax.tex
552 htlatex $< "xhtml,3,next" "" "" $(tex_1opt)
553
554 $(tex4ht_mathltx_derived): tex4ht-mathltx.tex $(common)
555 htlatex $< "html,3,sections+" "" "" $(tex_1opt)
556
557 $(tex4ht_mathml_derived): tex4ht-mathml.tex $(common)
558 htlatex $< "html,3,sections+" "" "" $(tex_1opt)
559
560 $(tex4ht_mathplayer_derived): tex4ht-mathplayer.tex $(common)
561 htlatex $< "html,3,sections+" "" "" $(tex_1opt)
562
563 $(tex4ht_mkht_derived): tex4ht-mkht.tex $(common)
564 latex $(tex_opts) $<
565 perl -c mk4ht.perl # syntax check
566 latex $(tex_opts) mkht-scripts.4ht
567
568 $(tex4ht_moz_derived): tex4ht-moz.tex $(common)
569 htlatex $< "html,3,sections+" "" "" $(tex_1opt)
570
571 $(tex4ht_oo_xtpipes_derived): tex4ht-oo-xtpipes.tex $(common)
572 htlatex $< "xhtml,next,3" "" "" $(tex_1opt)
573
574 $(tex4ht_ooffice_derived): tex4ht-ooffice.tex $(common)
575 htlatex $< "xhtml,4,sections+" "" "" $(tex_1opt)
576
577 $(tex4ht_ooimpress_derived): tex4ht-ooimpress.tex $(common)
578 htlatex $< "xhtml,4,sections+" "" "" $(tex_1opt)
579
580 $(tex4ht_options_derived): tex4ht-options.tex $(common)
581 htlatex $< "html,3,sections+" "" "" $(tex_1opt)
582
583 $(tex4ht_sty_derived): tex4ht-sty.tex wripro.tex $(common_no_tex4ht_sty)
584 $(HTTEX) $< ""
585
586 $(tex4ht_svg_derived): tex4ht-svg.tex $(common)
587 htlatex $< "html,3,sections+" "" "" $(tex_1opt)
588
589 $(tex4ht_t4ht_derived): tex4ht-t4ht.tex $(common)
590 $(HTTEX) $< ""
591
592 $(tex4ht_tei_derived): tex4ht-tei.tex $(common)
593 htlatex $< "html,3,sections+" "" "" $(tex_1opt)
594
595 $(tex4ht_unicode_derived): tex4ht-unicode.tex $(common)
596 htlatex $< "html,3,sections+" "" "" $(tex_1opt)
597
598 $(tex4ht_word_derived): tex4ht-word.tex $(common)
599 htlatex $< "html,3,sections+" "" "" $(tex_1opt)
600
601 $(tex4ht_xhtml_xtpipes_derived): tex4ht-xhtml-xtpipes.tex $(common)
602 htlatex $< "xhtml,3,next" "" "" $(tex_1opt)
603
604 $(tex4ht_xhtmml_xtpipes_derived): tex4ht-xhtmml-xtpipes.tex $(common)
605 htlatex $< "xhtml,3,next" "" "" $(tex_1opt)
606
607 $(xtpipes_derived): xtpipes.tex $(common)
608 texfot htlatex $< "xhtml,3,next" "" "" $(tex_1opt)
609
610 #
611 # Remake all *-fonts-*.tex files, i.e., update all htf. Since we list
612 # few dependencies for these, have to have some other way. Assume GNU make.
613 # Takes ~20 min and generates ~50MB of output.
614 update-all-fonts:
615 date; for f in *-fonts-*.tex; do \
616 printf "\n\f making $$f"; \
617 $(MAKE) -W $$f || exit $?; done
618 @echo "update-all-fonts done."
619
620 # Simple make abbrev for convenience.
621 upmake upm:
622 svn update && make
623
624 #
625 # Test installation. Does not work.
626 destdir = update.dir
627 dest_texmf = $(destdir)/texmf/tex/generic/tex4ht
628 dest_4ht = $(destdir)/texmf/tex4ht
629 dest_base = $(dest_4ht)/base
630 dest_xtpipes = $(dest_4ht)/xtpipes
631 dest_src = $(destdir)/src
632 dest_java = $(dest_src)/java
633 #
634 update = cp -pr
635 mkdir = install -d
636 #
637 dev-update-env:
638 $(mkdir) $(dest_base)/unix $(dest_base)/win32
639 $(update) tex4ht.env-unix $(dest_base)/unix/tex4ht.env
640 $(update) tex4ht.env-win32 $(dest_base)/win32/tex4ht.env
641 $(update) tex4ht-env.tex $(inst_dir_source)/
642
643 dev-update: all
644 $(update) $(tex4ht_bibtex2_derived) $(dest_src)/
645 #
646 $(update) $(tex4ht_c_derived) $(dest_src)/
647 #
648 $(update) $(tex4ht_cond4ht_derived) $(dest_texmf)/
649 #
650 $(update) docbook.4xt $(dest_xtpipes)/
651 $(update) DbUtilities.java $(dest_java)/
652 #
653 $(update) $(tex4ht_docbook_derived) $(dest_texmf)/
654 #
655 $(MAKE) dev-update-env
656 #
657 $(update) $(tex4ht_html_speech_xtpipes_derived) $(dest_texmf)/
658 #
659 $(update) $(tex4ht_html_speech_derived) $(dest_texmf)/
660 #
661 $(update) $(tex4ht_html0_derived) $(dest_texmf)/
662 #
663 $(update) $(tex4ht_html32_derived) $(dest_texmf)/
664 #
665 $(update) $(tex4ht_html4_derived) $(dest_texmf)/
666 #
667 $(update) $(tex4ht_info_mml_derived) $(dest_texmf)/
668 #
669 $(update) $(tex4ht_info_ooffice_derived) $(dest_texmf)/
670 #
671 $(update) $(tex4ht_info_svg_derived) $(dest_texmf)/
672 #
673 $(update) $(tex4ht_info_derived) $(dest_texmf)/
674 #
675 $(update) $(tex4ht_javahelp_xtpipes_derived) $(dest_texmf)/
676 #
677 $(update) $(tex4ht_javahelp_derived) $(dest_texmf)/
678 #
679 $(update) $(tex4ht_jsmath_derived) $(dest_texmf)/
680 #
681 $(update) jsml.4xt $(dest_xtpipes)/
682 $(update) $(tex4ht_jsml_xtpipes_derived_java) $(dest_java)/
683 #
684 $(update) $(tex4ht_jsml_derived) $(dest_texmf)/
685 #
686 $(update) $(tex4ht_mathltx_derived) $(dest_texmf)/
687 #
688 $(update) $(tex4ht_mathplayer_derived) $(dest_texmf)/
689 #
690 $(update) $(tex4ht_moz_derived) $(dest_texmf)/
691 #
692 $(update) $(tex4ht_html5_derived) $(dest_texmf)/
693 #
694 $(update) oo-text.4xt oo-math.4xt $(dest_xtpipes)/
695 $(update) OoUtilities.java OomFilter.java $(dest_java)/
696 #
697 $(update) $(tex4ht_ooffice_derived) $(dest_texmf)/
698 #
699 $(update) $(tex4ht_ooimpress_derived) $(dest_texmf)/
700 #
701 $(update) $(tex4ht_options_derived) $(dest_texmf)/
702 #
703 $(update) $(tex4ht_sty_derived) $(dest_texmf)/
704 #
705 $(update) $(tex4ht_svg_derived) $(dest_texmf)/
706 #
707 $(update) $(tex4ht_t4ht_derived) $(dest_src)/
708 #
709 $(update) $(tex4ht_tei_derived) $(dest_texmf)/
710 #
711 $(update) $(tex4ht_jats_derived) $(dest_texmf)/
712 #
713 $(update) $(tex4ht_unicode_derived) $(dest_texmf)/
714 #
715 $(update) $(tex4ht_word_derived) $(dest_texmf)/
716 #
717 $(update) xhtml.4xt $(dest_xtpipes)/
718 $(update) XhtmlEmails.java $(dest_java)/
719 #
720 $(update) xhtmml.4xt $(dest_xtpipes)/
721 $(update) XhtmmlUtilities.java $(dest_java)/
722
723 # this has to be done last. Does anything else use $(wd)? We'll see.
724 rmdir $(wd)/bin
725 $(update) $(wd)/* $(dest_java)/
726 $(update) xtpipes.dtd xtpipes-map.dtd xtpipes-default.4xt \
727 $(dest_xtpipes)/
728
729 clean: mostlyclean
730 rm -rf $(wd)
731 rm -f *.4ct *.4tc *.aux *.css *.dvi *.idv *.lg *.log *.tmp *.trc *.xref
732 rm -f *.4es *.bat *.unix *.htf *.html *.png tmp
733 rm -f *.fls
734 rm -f tex4ht-dir.tex
735
736 mostlyclean:
737 rm -f $(derived)
738
739 clean1:
740 rm -f $(f).[0-s]* $(f).[u-z]* $(f).trc
741
742 #
743 # Java. We generate the .java (and related) files just like any other
744 # files; some of them (especially from xtpipes.tex) are output in
745 # different subdirectories than usual, as listed above.
746 #
747 # "Installation" is then a matter of copying them into the TL source
748 # directory (via the install-java: target below), just like installation
749 # of .4ht and other runtime files is done by copying them into TL (see
750 # the ./up4 script).
751
752 # Here is a target to make jar files, but until we need to actually
753 # change the code, let's not bother making it work again.
754 #
755 ifeq ($(java_in_make),true)
756 .PHONY: jar # doesn't currently work
757 jar: $(homedir)/$(texmf_t4ht_bin)/tex4ht.jar
758 $(homedir)/$(texmf_t4ht_bin)/tex4ht.jar: \
759 $(tex4ht_docbook_xtpipes_derived) \
760 $(tex4ht_fonts_noncjk_derived) \
761 $(tex4ht_html_speech_xtpipes_derived) \
762 $(tex4ht_jsml_xtpipes_derived) \
763 $(tex4ht_oo_xtpipes_derived) \
764 $(tex4ht_xhtml_xtpipes_derived) \
765 $(tex4ht_xhtmml_xtpipes_derived)
766 find $(wd)/src -iname '*.java' -print0 \
767 | xargs -0 javac -d $(xtpipesdir) -sourcepath $(wd)/src
768 mkdir -p $(dir $@)
769 cd $(xtpipesdir) && jar cf $(notdir $@) *
770 mv $(xtpipesdir)/$(notdir $@) $(dir $@)
771 endif # java_in_make=true
772
773 #
774 # The directories where tex4ht is installed in TeX Live,
775 # i.e., where we will copy and commit updates.
776
777 texlive = /home/texlive/karl
778 texmf = $(texlive)/Master/texmf-dist
779 inst_dir_4ht = $(texmf)/tex/generic/tex4ht
780 inst_dir_top = $(texmf)/tex4ht
781 inst_dir_scripts = $(texmf)/scripts/tex4ht
782 inst_dir_source = $(texmf)/source/generic/tex4ht
783 #
784 # The runtime directories:
785 inst_dir_all = $(inst_dir_4ht) $(inst_dir_top) $(inst_dir_scripts) \
786 $(inst_dir_source)
787
788 # Simple command to "install" the scripts and env files from dev to TL.
789 # Other methods are also used: see the ./up4 script for an overview,
790 # also ./up4b, also ./update-htfonts for handling the fonts,
791 # and the rest of the targets here.
792 install_data = cp -p
793
794 # svn status of installed tree.
795 svnstatus st:
796 svn status $(inst_dir_all) | sed s,$(texmf),, # reduce output
797 @echo $(inst_dir_all)
798
799 # Diff and install the *.unix and *.bat scripts.
800 # The suffix changes from .unix in development to .sh in TL,
801 # and many of the scripts are not installed at all;
802 # don't worry about that. We also won't worry about the
803 # Perl scripts (mk4ht) at present.
804 #
805 diff-scripts:
806 @echo; echo '>>> $@'
807 for f in *.unix; do \
808 inst_f=$(inst_dir_scripts)/`basename $$f .unix`.sh; \
809 test -r $$inst_f || continue; \
810 $(diff) $$inst_f $$f; done
811
812 # Diff from installed to dev, but install from dev to installed.
813 install-scripts:
814 @echo; echo '>>> $@'
815 for f in *.unix; do \
816 inst_f=$(inst_dir_scripts)/`basename $$f .unix`.sh; \
817 test -r $$inst_f || continue; \
818 echo $(install_data) $$inst_f $$f; \
819 $(install_data) $$f $$inst_f; done
820
821 #
822 # Checking and updating source files from development vs. TeX Live,
823 # from whence they get to CTAN.
824
825 srcfiles = $(shell svn status -v | awk '{print $$NF}' \
826 | egrep -v '^\.|^archive|extra-bin|vcss|xmllint|ProTex.sty$$')
827
828 # Diff source files from installed to dev.
829 diff-src:
830 @echo; echo '>>> $@'
831 for f in $(srcfiles); do $(diff) $(inst_dir_source)/$$f $$f; done
832 #
833 # Install from dev to installed.
834 update-src:
835 for f in $(srcfiles); do $(install_data) $$f $(inst_dir_source); done
836 svn status $(inst_dir_source)
837 #
838 # Just list all the source files.
839 list-src:
840 @echo $(srcfiles) | tr ' ' '\n'
841
842 #
843 # Checking and updating the (numerous and scattered) font support files.
844
845 # Where they are in the installed tree.
846 ht_fonts_instdir = $(inst_dir_top)/ht-fonts
847
848 # Compare only. Must run make all first. Requires bash as the make
849 # shell, sorry, didn't seem worth the trouble of mkfifo or file
850 # descriptors.
851 diff-htfonts:
852 @echo; echo '>>> $@'
853 set -o pipefail; \
854 ./update-htfonts diff $(ht_fonts_devdir) $(ht_fonts_instdir) \
855 | tee /tmp/htdif
856
857 # Compare and update. Must run make all first.
858 update-htfonts:
859 set -o pipefail; \
860 ./update-htfonts update $(ht_fonts_devdir) $(ht_fonts_instdir) \
861 | tee /tmp/htupd
862 .PHONY: update-htfonts
863
864 #
865 # Checking and updating tex4ht.env files.
866
867 # Where they are in the installed tree.
868 env_instdir = $(inst_dir_top)/base
869
870 # Compare only.
871 diff-env: $(tex4ht_env_derived)
872 -$(diff) $(env_instdir)/unix/tex4ht.env tex4ht.env-unix
873 -$(diff) $(env_instdir)/win32/tex4ht.env tex4ht.env-win32
874
875 # Compare and update.
876 update-env:
877 $(install_data) tex4ht.env-unix $(env_instdir)/unix/tex4ht.env
878 $(install_data) tex4ht.env-win32 $(env_instdir)/win32/tex4ht.env
879
880 #
881 # Updating .java source files.
882
883 # Where they are in the installed tree.
884 java_instdir = $(texlive)/Build/source/texk/tex4htk/java
885
886 # Compare only.
887 diff-java: $(derived_all_java)
888 >/tmp/htjavadiff; \
889 for j in $^; do \
890 # destj= cmd unfortunately must be kept in sync with below
891 destj=$(java_instdir)/`echo $$j | sed -e 's,\($(wd)/src\|$(xtpipesdir)\)/,,'`; \
892 echo $$j $$destj; \
893 diff $$j $$destj; done \
894 | tee /tmp/htjavadiff \
895 | egrep -v '^[<>] (%|/\*|\*/|\/\/|.*Copyright| *$$)' \
896 | egrep -v '^[<>] .*(\.java|xtpipes) \(20..-' \
897 | egrep -v '^[0-9,acd-]*$$'
898 # filtering diff lines contining only: % /* */ // Copyright
899 # or empty lines. (I.e., comments.)
900 # Second egrep filters identification lines like:
901 # JsmlMathBreak.java (2007-09-01-14:10)
902 # Third egrep filters the diff control lines like "2,20d1".
903 # Save original diff in tmp file.
904
905 # Compare and update. We could create a script similar to update-htfonts
906 # (but similar). But since Java updates are essentially nonexistent,
907 # let's just do it by hand. I.e., run "make diff-java" and make this
908 # list of changed files by inspection:
909 #
910 java_update_list =
911 #
912 #12may26 update:
913 #java_update_list = XhtmlEmails.java XhtmmlUtilities.java OoFilter.java \
914 # $(wd)/src/xtpipes/FileInfo.java $(wd)/src/xtpipes/Xtpipes.java \
915 # $(wd)/src/xtpipes/util/ScriptsManager.java \
916 # $(xtpipes_derived_lib)
917 #
918 update-java:
919 # destj= cmd unfortunately must be kept in sync with above
920 for j in $(java_update_list); do \
921 destj=$(java_instdir)/`echo $$j | sed -e 's,\($(wd)/src\|$(xtpipesdir)\)/,,'`; \
922 echo $$j $$destj; \
923 test -d "`dirname $$destj`" || mkdir -p "`dirname $$destj`"; \
924 $(install_data) -v "$$j" "$$destj"; done
925
926 #
927 # diff all files in the main TeX Live installation directory against
928 # cwd (development). the --ignore-matching-lines below only works when
929 # that's the only change in the hunk, so ignore them all explicitly.
930 # also ignore commented changes.
931 #
932 # htf files, scripts, etc. are in different places, so don't include them here,
933 #
934 # The diff-scripts output is usually empty, so we can run that;
935 # but diff-htfonts is too verbose to run every time.
936 diff-all: diff-src diff-scripts diff-htfonts diff-env
937 @echo; echo '>>> $@'
938 -for f in $(inst_dir_4ht)/*; do $(diff) $$f .; done \
939 | tee /tmp/u | egrep -v '^ *[-+]%|^@@ |^- *$$|-1.version' \
940 | egrep -v '^..ifx.infoIVht.UnDeF.*//$$' \
941 | egrep -v '^--- '
942
943 # For checking the derived files that are explicitly listed above
944 # against installed (in TL) files. This is a small subset of all the
945 # generated files.
946 diff_files = $(filter-out %.htf %.4hf tex4ht.env% %.c lm-htf.tex \
947 mk4ht.perl ht.unix ht.bat,\
948 $(derived))
949 diff-derived:
950 @echo; echo '>>> $@'
951 -for f in $(diff_files); do $(diff) $(inst_dir_4ht)/$$f .; done \
952 | tee /tmp/u | egrep -v '^ *[-+]%|^@@ |^- *$$|-1.version' \
953 | egrep -v '^..ifx.infoIVht.UnDeF.*//$$'
954
955 # Check that anything with a \version of this year
956 # also has a copyright of this year.
957 inst-check-copyright:
958 @echo; echo '>>> $@'
959 -cd $(inst_dir_4ht) && for f in *; do \
960 if grep "version.*`date +%Y`" $$f >/dev/null; then \
961 grep "Copyright.*`date +%Y`" $$f >/dev/null || echo $$f; fi; done
962
963 # Check that all *.4ht in dev are installed. Other file types are
964 # difficult, but all 4ht's should be present, except mktex4ht.4ht.
965 inst-check-files:
966 @echo; echo '>>> $@'
967 cd $(inst_dir_4ht) && ls -1 *.4ht >/tmp/instlist
968 ls -1 *.4ht | fgrep -v mktex4ht.4ht >/tmp/devlist
969 comm -3 /tmp/devlist /tmp/instlist
970
971 # Check for missing version identifications.
972 inst-check-version:
973 @echo; echo '>>> $@'
974 -cd $(inst_dir_4ht) && for f in *; do \
975 grep 'write-1.*version' $$f >/dev/null || echo $$f; done
976
977 #
978 # diff one specified runtime file, as in "make d1 d=filename.4ht".
979 diff1 d1:
980 $(diff) $(inst_dir_4ht)/$(d) .
981
982 # the diff command used pervasively.
983 diff = diff -u0 --ignore-all-space --ignore-blank-lines \
984 --ignore-matching-lines='write-1.version\|, generated from\|Copyright'
985
986 # run weekly by karl.
987 croncheck: upm diff-all \
988 inst-check-copyright inst-check-files inst-check-version \
989 diff-htfonts