Debian Codegraph @

texk/web2c/uptexdir/am/uptex.am

raw
1 ## $Id: uptex.am 77096 2025-12-14 14:25:10Z takuji $
2 ## texk/web2c/uptexdir/am/uptex.am: Makefile fragment for upTeX.
3 ##
4 ## Copyright 2016-2025 Karl Berry <[email protected]>
5 ## Copyright 2011-2015 Peter Breitenlohner <[email protected]>
6 ## You may freely use, modify and/or distribute this file.
7
8 uptex_cppflags = $(PTEXENC_INCLUDES) $(AM_CPPFLAGS) $(ZLIB_INCLUDES)
9 uptex_ldadd = libukanji.a $(pproglib) $(PTEXENC_LIBS) $(LDADD) $(ZLIB_LIBS)
10 uptex_dependencies = libukanji.a $(pproglib) $(PTEXENC_DEPEND) $(ZLIB_DEPEND) $(default_dependencies)
11 up_tangle = $(tangle_silent)WEBINPUTS=.:$(srcdir)/uptexdir:$(srcdir) $(buildenv) $(TANGLE)
12
13 upweb_programs = upbibtex updvitype uppltotf uptftopl
14
15
16 ## pTeX library
17 ##
18 pproglib = lib/libp.a
19 # Rebuild $(pproglib)
20 $(pproglib): $(KPATHSEA_DEPEND) ${srcdir}/lib/*.c
21 cd lib && $(MAKE) $(AM_MAKEFLAGS) libp.a
22
23 ## libukanji.a for upTeX and e-upTeX
24 ##
25 EXTRA_LIBRARIES += libukanji.a
26 libukanji_a_SOURCES = uptexdir/kanji.c uptexdir/kanji.h uptexdir/kanji_dump.c
27 libukanji_a_CPPFLAGS = $(uptex_cppflags)
28
29 ## upTeX
30 ##
31 if UPTEX
32 bin_PROGRAMS += uptex
33 endif UPTEX
34 if UPWEB
35 bin_PROGRAMS += $(upweb_programs)
36 endif UPWEB
37 EXTRA_PROGRAMS += uptex $(upweb_programs)
38
39 uptex_CPPFLAGS = $(uptex_cppflags)
40
41 # With --enable-ipc, upTeX may need to link with -lsocket.
42 uptex_LDADD = $(uptex_ldadd) $(ipc_socketlibs)
43 uptex_DEPENDENCIES = $(uptex_dependencies)
44
45 # upTeX C sources
46 uptex_c_h = uptexini.c uptex0.c uptexcoerce.h uptexd.h
47 nodist_uptex_SOURCES = $(uptex_c_h) uptex-pool.c
48 dist_uptex_SOURCES = uptexdir/uptexextra.c uptexdir/uptexextra.h uptexdir/uptex_version.h
49
50 # We must create uptexd.h and uptexdir/uptex_version.h before building the uptex_OBJECTS.
51 uptex_prereq = uptexd.h uptexdir/ptex_version.h uptexdir/uptex_version.h
52 $(uptex_OBJECTS): $(uptex_prereq)
53
54 $(uptex_c_h): uptex-web2c
55 @$(web2c) uptex
56 uptex-web2c: uptex.p $(web2c_texmf) uptexdir/uptex.defines
57 @$(web2c) uptex
58
59 uptex-pool.c: uptex.pool uptexd.h $(makecpool_stamp)
60 $(makecpool) uptex >$@ || { rm -f $@; exit 1; }
61
62 # Tangling upTeX
63 uptex.p uptex.pool: uptex-tangle
64 $(texmf_tangle) uptex uptex
65 uptex-tangle: tangle$(EXEEXT) uptex.web uptex.ch tangle-sh
66 $(texmf_tangle) uptex uptex
67
68 # Extract uptex version
69 $(srcdir)/uptexdir/uptex_version.h: @MAINTAINER_MODE_TRUE@ uptexdir/uptex-m.ch
70 $(AM_V_GEN)grep '^@d upTeX_version_string==' $(srcdir)/uptexdir/uptex-m.ch \
71 | sed "s/^.*'-/#define UPTEX_VERSION \"/;s/'.*$$/\"/" >$@
72
73 # Generate uptex.web
74 uptex.web: tie$(EXEEXT) $(uptex_web_srcs)
75 $(tie_m) $(uptex_web_srcs)
76 uptex_web_srcs = \
77 tex.web \
78 tex.ch \
79 tracingstacklevels.ch \
80 partoken.ch \
81 locnull-optimize.ch \
82 zlib-fmt.ch
83
84 # Generate uptex.ch
85 uptex.ch: tie$(EXEEXT) uptex.web $(uptex_ch_srcs)
86 $(tie_c) uptex.web $(uptex_ch_srcs)
87 uptex_ch_srcs = \
88 uptexdir/ptex-base.ch \
89 uptexdir/uptex-m.ch \
90 $(uptex_ch_synctex) \
91 unbalanced-braces.ch \
92 tex-binpool.ch
93
94 EXTRA_DIST += $(uptex_web_srcs) $(uptex_ch_srcs) uptexdir/uptex.defines
95
96 DISTCLEANFILES += $(nodist_uptex_SOURCES) uptex.web uptex.ch uptex-web2c \
97 uptex.p uptex.pool uptex-tangle
98
99 ## upBibTeX
100 ##
101 nodist_upbibtex_SOURCES = upbibtex.c upbibtex.h
102 upbibtex_SOURCES = uptexdir/kanji.h
103 upbibtex_CPPFLAGS = $(uptex_cppflags)
104 upbibtex_LDADD = $(uptex_ldadd)
105 upbibtex_DEPENDENCIES = $(uptex_dependencies)
106 upbibtex.c upbibtex.h: upbibtex-web2c
107 @$(web2c) upbibtex
108 upbibtex-web2c: upbibtex.p $(web2c_depend) uptexdir/uptex.defines web2c/cvtbib.sed
109 @$(web2c) upbibtex
110 upbibtex.p: tangle$(EXEEXT) upbibtex.web uptexdir/upbibtex.ch
111 $(up_tangle) upbibtex upbibtex
112 upbibtex.web: tie$(EXEEXT) bibtex.web bibtex.ch
113 $(tie_m) bibtex.web bibtex.ch
114 EXTRA_DIST += uptexdir/upbibtex.ch
115 if UPWEB
116 bin_links += upbibtex$(EXEEXT):pbibtex
117 endif # UPWEB
118
119 ## upDVItype
120 ##
121 nodist_updvitype_SOURCES = updvitype.c updvitype.h
122 updvitype_SOURCES = uptexdir/kanji.h
123 updvitype_CPPFLAGS = $(uptex_cppflags) -DHEX_CHAR_CODE
124 updvitype_LDADD = $(uptex_ldadd)
125 updvitype_DEPENDENCIES = $(uptex_dependencies)
126 updvitype.c updvitype.h: updvitype-web2c
127 @$(web2c) updvitype
128 updvitype-web2c: updvitype.p $(web2c_depend) uptexdir/uptex.defines
129 @$(web2c) updvitype
130 updvitype.p: tangle$(EXEEXT) updvitype.web uptexdir/updvitype.ch
131 $(up_tangle) updvitype updvitype
132 updvitype.web: tie$(EXEEXT) dvitype.web dvitype.ch
133 $(tie_m) dvitype.web dvitype.ch
134 EXTRA_DIST += uptexdir/updvitype.ch
135 if UPWEB
136 bin_links += updvitype$(EXEEXT):pdvitype
137 endif # UPWEB
138
139 ## upPLtoTF
140 ##
141 nodist_uppltotf_SOURCES = uppltotf.c uppltotf.h
142 uppltotf_SOURCES = uptexdir/kanji.h
143 uppltotf_CPPFLAGS = $(uptex_cppflags) -DPRESERVE_PUTC
144 uppltotf_LDADD = $(uptex_ldadd)
145 uppltotf_DEPENDENCIES = $(uptex_dependencies)
146 uppltotf.c uppltotf.h: uppltotf-web2c
147 @$(web2c) uppltotf
148 uppltotf-web2c: uppltotf.p $(web2c_depend) uptexdir/uptex.defines
149 @$(web2c) uppltotf
150 uppltotf.p: tangle$(EXEEXT) uppltotf.web uptexdir/uppltotf.ch
151 $(up_tangle) uppltotf uppltotf
152 uppltotf.web: tie$(EXEEXT) pltotf.web pltotf.ch
153 $(tie_m) pltotf.web pltotf.ch
154 EXTRA_DIST += uptexdir/uppltotf.ch
155 if UPWEB
156 bin_links += uppltotf$(EXEEXT):ppltotf
157 endif # UPWEB
158
159 ## upTFtoPL
160 ##
161 nodist_uptftopl_SOURCES = uptftopl.c uptftopl.h
162 uptftopl_SOURCES = uptexdir/kanji.h
163 uptftopl_CPPFLAGS = $(uptex_cppflags)
164 uptftopl_LDADD = $(uptex_ldadd)
165 uptftopl_DEPENDENCIES = $(uptex_dependencies)
166 uptftopl.c uptftopl.h: uptftopl-web2c
167 @$(web2c) uptftopl
168 uptftopl-web2c: uptftopl.p $(web2c_depend) uptexdir/uptex.defines
169 @$(web2c) uptftopl
170 uptftopl.p: tangle$(EXEEXT) uptftopl.web uptexdir/uptftopl.ch
171 $(up_tangle) uptftopl uptftopl
172 uptftopl.web: tie$(EXEEXT) tftopl.web tftopl.ch
173 $(tie_m) tftopl.web tftopl.ch
174 EXTRA_DIST += uptexdir/uptftopl.ch
175 if UPWEB
176 bin_links += uptftopl$(EXEEXT):ptftopl
177 endif # UPWEB
178
179 ##
180 EXTRA_DIST += \
181 uptexdir/COPYRIGHT \
182 uptexdir/COPYRIGHT.ja \
183 uptexdir/ChangeLog
184
185 # emacs-page
186 # upTeX Tests
187 uptex_tests = \
188 uptexdir/uptriptest.test uptexdir/ptriptest.test \
189 uptexdir/upver.test \
190 uptexdir/upkcat.test \
191 uptexdir/wcfname.test uptexdir/wcfname0.test \
192 uptexdir/uptex-ctrlsym.test \
193 uptexdir/uptex-prntknj.test \
194 uptexdir/uptex-ofm.test uptexdir/uptex-prim.test \
195 uptexdir/uptex-lmr.test uptexdir/uptex-cat.test \
196 uptexdir/uptex-noto.test \
197 uptexdir/uptex-ucs.test uptexdir/uptex-widow.test
198 uptexdir/uptriptest.log uptexdir/ptriptest.log: \
199 uptex$(EXEEXT) dvitype$(EXEEXT) pltotf$(EXEEXT) tftopl$(EXEEXT)
200 uptexdir/upver.log uptexdir/upkcat.log \
201 uptexdir/wcfname.log uptexdir/wcfname0.log \
202 uptexdir/uptex-ctrlsym.log uptexdir/uptex-prntknj.log \
203 uptexdir/uptex-ofm.log uptexdir/uptex-prim.log \
204 uptexdir/uptex-lmr.log uptexdir/uptex-cat.log \
205 uptexdir/uptex-noto.log \
206 uptexdir/uptex-ucs.log uptexdir/uptex-widow.log: uptex$(EXEEXT)
207 upweb_tests = \
208 uptexdir/upbibtex.test \
209 uptexdir/updvitype.test \
210 uptexdir/uppltotf.test \
211 uptexdir/uptftopl.test
212 ## upBibTeX
213 upweb_tests += \
214 uptexdir/upbibtex-openout-test.pl uptexdir/upbibtex-longline-test.pl \
215 uptexdir/upbibtex-mem.test uptexdir/nissya.test \
216 uptexdir/unibib.test
217 ## upDviType
218 upweb_tests += \
219 uptexdir/sample.test
220 # uppPLtoTF/upTFtoPL
221 upweb_tests += \
222 uptexdir/yokotate.test uptexdir/skipjfmp.test \
223 uptexdir/newjfm.test uptexdir/uparse.test \
224 uptexdir/gkhuge.test uptexdir/gk256.test
225 uptexdir/upbibtex.log: upbibtex$(EXEEXT)
226 uptexdir/updvitype.log: updvitype$(EXEEXT)
227 uptexdir/uppltotf.log: uppltotf$(EXEEXT)
228 uptexdir/uptftopl.log: uptftopl$(EXEEXT)
229 uptexdir/upbibtex-openout-test.log uptexdir/upbibtex-longline-test.log \
230 uptexdir/upbibtex-mem.log uptexdir/nissya.log \
231 uptexdir/unibib.log: upbibtex$(EXEEXT)
232 uptexdir/sample.log: updvitype$(EXEEXT)
233 uptexdir/yokotate.log uptexdir/skipjfmp.log \
234 uptexdir/newjfm.log uptexdir/uparse.log \
235 uptexdir/gkhuge.log uptexdir/gk256.log: uppltotf$(EXEEXT) uptftopl$(EXEEXT)
236
237 # See comments in euptex.am, except we have to build multiple test fmts here.
238 $(uptex_tests): up-basic.fmt up-basic-euc.fmt up-basic-sjis.fmt
239 #
240 # Must find some files in $(srcdir) to build the test fmts.
241 uptex_ini = TEXMFCNF=$(srcdir)/../kpathsea TEXINPUTS=$(srcdir)/tests: ./uptex -ini
242 #
243 up-basic.fmt: up-basic.tex
244 $(uptex_ini) -kanji-internal=uptex -jobname=up-basic up-basic
245 test -s up-basic.fmt
246 up-basic-euc.fmt: up-basic.tex
247 $(uptex_ini) -kanji-internal=euc -jobname=up-basic-euc up-basic
248 test -s up-basic-euc.fmt
249 up-basic-sjis.fmt: up-basic.tex
250 $(uptex_ini) -kanji-internal=sjis -jobname=up-basic-sjis up-basic
251 test -s up-basic-sjis.fmt
252 #
253 up-basic.tex: $(srcdir)/tests/dump-basic.tex
254 cp $(srcdir)/tests/dump-basic.tex ./up-basic.tex
255
256 EXTRA_DIST += $(uptex_tests) $(upweb_tests)
257 DISTCLEANFILES += $(upweb_programs:=.c) $(upweb_programs:=.h) \
258 $(upweb_programs:=.p) $(upweb_programs:=-web2c) $(upweb_programs:=.web)
259
260 if UPTEX
261 TESTS += $(uptex_tests)
262 TRIPTRAP += uptrip.diffs
263 TRIPTRAP_CLEAN += uptrip-clean
264 endif UPTEX
265 if UPWEB
266 TESTS += $(upweb_tests)
267 endif UPWEB
268
269 ## Test data and results
270 ##
271 ## uptexdir/nissya.test
272 EXTRA_DIST += uptexdir/tests/nissya.bst uptexdir/tests/sample.bib \
273 uptexdir/tests/nissya_bib.aux uptexdir/tests/nissya_bib.bbl
274 DISTCLEANFILES += uptests/nissya_bib.*
275 ## uptexdir/upbibtex.test
276 EXTRA_DIST += tests/enc-u.bbl tests/enc-eu.bbl tests/enc-su.bbl tests/enc-uu.bbl
277 DISTCLEANFILES += uptests/xexampl.aux uptests/xexampl.bbl uptests/xexampl.blg \
278 uptests/xenc*.* uptests/fn*.*
279 ## uptexdir/upbibtex-mem.test
280 DISTCLEANFILES += uptests/memtest.bib uptests/memtest?.*
281 ## uptexdir/updvitype.test
282 EXTRA_DIST += uptexdir/tests/ptex3.tex uptexdir/tests/ptex3.dvi \
283 uptexdir/tests/ptex4.tex uptexdir/tests/ptex4.dvi \
284 uptexdir/tests/ptex3a-jis.typ uptexdir/tests/ptex3a-utf8.typ \
285 uptexdir/tests/ptex4a-jis.typ uptexdir/tests/ptex4a-utf8.typ
286 EXTRA_DIST += uptexdir/tests/uptex3.tex uptexdir/tests/uptex3.dvi \
287 uptexdir/tests/uptex4.tex uptexdir/tests/uptex4.dvi \
288 uptexdir/tests/uptex5.tex uptexdir/tests/uptex5.dvi \
289 uptexdir/tests/uptex3a.typ uptexdir/tests/uptex4a.typ \
290 uptexdir/tests/uptex5a.typ
291 DISTCLEANFILES += uptests/xstory.dvityp uptests/xpagenum.typ uptests/x*ptex[345]*.typ
292 ## uptexdir/uppltotf.test
293 DISTCLEANFILES += uptests/xcmr10.tfm
294 ## uptexdir/uptftopl.test
295 DISTCLEANFILES += uptests/xcmr10.pl
296 ## uptexdir/sample.test
297 EXTRA_DIST += uptexdir/tests/goth10.tfm uptexdir/tests/sample.dvi uptexdir/tests/samplea.typ
298 DISTCLEANFILES += uptests/xsample*.typ
299 ## uptexdir/yokotate.test
300 EXTRA_DIST += uptexdir/tests/min10.pl uptexdir/tests/min10.tfm
301 EXTRA_DIST += uptexdir/tests/tmin10.pl uptexdir/tests/tmin10.tfm
302 EXTRA_DIST += uptexdir/tests/chcode.pl uptexdir/tests/chcode-jis.pl uptexdir/tests/chcode.tfm \
303 ptexdir/tests/chcode-utf8.pl uptexdir/tests/chcode-euc.pl uptexdir/tests/chcode-sjis.pl
304 EXTRA_DIST += uptexdir/tests/umin10.pl uptexdir/tests/umin10.tfm
305 EXTRA_DIST += uptexdir/tests/utmin10.pl uptexdir/tests/utmin10.tfm
306 DISTCLEANFILES += uptests/x*min10.* uptests/xchcode*.*
307 ## uptexdir/newjfm.test
308 EXTRA_DIST += uptexdir/tests/testnewu.pl uptexdir/tests/testnewu.tfm \
309 uptexdir/tests/testnewu8.pl uptexdir/tests/testnewu8.tfm
310 DISTCLEANFILES += uptests/xtestnewu*.*
311 ## uptexdir/uparse.test
312 EXTRA_DIST += uptexdir/tests/uparse.pl uptexdir/tests/uparse.tfm
313 DISTCLEANFILES += uptests/xuparse.* uptests/yuparse.*
314 ## uptexdir/gkhuge.test
315 EXTRA_DIST += uptexdir/tests/gkhugeok.tfm uptexdir/tests/gkhugeng.tfm uptexdir/tests/gkhugeng.err
316 DISTCLEANFILES += uptests/ygkhuge*.*
317 ## uptexdir/gk256.test
318 EXTRA_DIST += uptexdir/tests/gk256g.tfm uptexdir/tests/gk256k.tfm
319 DISTCLEANFILES += uptests/ygk256*.*
320 ## uptexdir/skipjfmp.test
321 EXTRA_DIST += uptexdir/tests/skipjfmp.pl uptexdir/tests/skipjfmp.tfm uptexdir/tests/skipjfmp.tex
322 DISTCLEANFILES += uptests/xskipjfmp.*
323 ## uptexdir/uptriptest
324 EXTRA_DIST += uptexdir/uptrip/uptrip.diffs uptexdir/uptrip/texmf.cnf
325 DISTCLEANFILES += uptrip.diffs
326 ## uptexdir/upver.test
327 EXTRA_DIST += uptexdir/tests/pver1.tex uptexdir/tests/pver2.tex
328
329 ## uptexdir/uptex-ctrlsym.test
330 EXTRA_DIST += uptexdir/tests/ctrlsym.tex uptexdir/tests/ctrlsym-e.log \
331 uptexdir/tests/ctrlsym-u.log \
332 uptexdir/tests/endlinechar.tex uptexdir/tests/endline.log \
333 uptexdir/tests/control-symbol.tex uptexdir/tests/jctrlsym-e.log \
334 uptexdir/tests/jctrlsym-u.log \
335 uptexdir/tests/up-endlinea.typ uptexdir/tests/up-jctrlsyma-e.typ \
336 uptexdir/tests/up-jctrlsyma-u.typ \
337 uptexdir/tests/let_char_token.tex uptexdir/tests/chartoken.log \
338 uptexdir/tests/ptexlineendmode.tex uptexdir/tests/up-lineenda.typ
339 DISTCLEANFILES += up-ctrlsym.log up-ctrlsym.out up-ctrlsym.tex \
340 up-endline*.* up-jctrlsym*.* up-chartoken.* up-lineend.*
341 ## uptexdir/uptex-prntknj.test
342 EXTRA_DIST += uptexdir/tests/printkanji.tex uptexdir/tests/pknj-s.log \
343 uptexdir/tests/pknj-e.log uptexdir/tests/pknj-u.log \
344 uptexdir/tests/up-pknj-sa.typ uptexdir/tests/up-pknj-ea.typ \
345 uptexdir/tests/up-pknj-ua.typ
346 DISTCLEANFILES += up-pknj-*.*
347 ## uptexdir/uptex-ofm.test
348 EXTRA_DIST += uptexdir/tests/up-ofm.tex uptexdir/tests/up-ofm.log \
349 uptexdir/tests/up-ofma.typ
350 DISTCLEANFILES += up-ofm.*
351 ## uptexdir/uptex-prim.test
352 EXTRA_DIST += uptexdir/tests/up-prim.tex uptexdir/tests/up-prim.log
353 DISTCLEANFILES += up-prim.*
354 ## uptexdir/uptex-lmr.test
355 EXTRA_DIST += uptexdir/tests/lmr1.tex uptexdir/tests/up-lmr1.log \
356 uptexdir/tests/lmr2.tex uptexdir/tests/up-lmr2.log
357 DISTCLEANFILES += up-lmr*.*
358 ## uptexdir/uptex-cat.test
359 EXTRA_DIST += uptexdir/tests/catcd.tex uptexdir/tests/up-cat.log
360 DISTCLEANFILES += up-cat.*
361 ## uptexdir/uptex-noto.test
362 EXTRA_DIST += uptexdir/tests/noto1.tex uptexdir/tests/up-noto1.log
363 DISTCLEANFILES += up-noto*.*
364 ## uptexdir/uptex-ucs.test
365 EXTRA_DIST += uptexdir/tests/ucs.tex uptexdir/tests/ucs-s.log \
366 uptexdir/tests/ucs-e.log uptexdir/tests/ucs-u.log
367 DISTCLEANFILES += up-ucs*.*
368 ## uptexdir/uptex-widow.test
369 EXTRA_DIST += uptexdir/tests/jchwidow.tex uptexdir/tests/up-jchwidow-s.log \
370 uptexdir/tests/up-jchwidow-e.log uptexdir/tests/up-jchwidow.log
371 DISTCLEANFILES += up-jchwidow*.*
372
373 uptrip.diffs: uptex$(EXEEXT) dvitype$(EXEEXT) pltotf$(EXEEXT) tftopl$(EXEEXT)
374 $(triptrap_diffs) $@
375 .PHONY: uptrip-clean
376 uptrip-clean:
377 rm -rf uptripdir
378
379 # (end of uptex.am)