summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/uptexdir/am/uptex.am
blob: 2d6d0f5bc3995abd60713161edc0ec119d45d3ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
## $Id$
## texk/web2c/uptexdir/am/uptex.am: Makefile fragment for upTeX.
##
## Copyright 2016-2022 Karl Berry <tex-live@tug.org>
## Copyright 2011-2015 Peter Breitenlohner <tex-live@tug.org>
## You may freely use, modify and/or distribute this file.

uptex_cppflags = $(PTEXENC_INCLUDES) $(AM_CPPFLAGS) $(ZLIB_INCLUDES)
uptex_ldadd = libukanji.a $(pproglib) $(PTEXENC_LIBS) $(LDADD) $(ZLIB_LIBS)
uptex_dependencies = libukanji.a $(pproglib) $(PTEXENC_DEPEND) $(ZLIB_DEPEND) $(default_dependencies)
up_tangle = $(tangle_silent)WEBINPUTS=.:$(srcdir)/uptexdir:$(srcdir) $(buildenv) $(TANGLE)

upweb_programs = upbibtex updvitype uppltotf uptftopl

## libukanji.a for upTeX and e-upTeX
##
EXTRA_LIBRARIES += libukanji.a
libukanji_a_SOURCES = uptexdir/kanji.c uptexdir/kanji.h uptexdir/kanji_dump.c
libukanji_a_CPPFLAGS = $(uptex_cppflags)

## upTeX
##
if UPTEX
bin_PROGRAMS += uptex
endif UPTEX
if UPWEB
bin_PROGRAMS += $(upweb_programs)
endif UPWEB
EXTRA_PROGRAMS += uptex $(upweb_programs)

uptex_CPPFLAGS = $(uptex_cppflags)

# With --enable-ipc, upTeX may need to link with -lsocket.
uptex_LDADD = $(uptex_ldadd) $(ipc_socketlibs)
uptex_DEPENDENCIES = $(uptex_dependencies)

# upTeX C sources
uptex_c_h = uptexini.c uptex0.c uptexcoerce.h uptexd.h
nodist_uptex_SOURCES = $(uptex_c_h) uptex-pool.c
dist_uptex_SOURCES = uptexdir/uptexextra.c uptexdir/uptexextra.h uptexdir/uptex_version.h

# We must create uptexd.h and uptexdir/uptex_version.h before building the uptex_OBJECTS.
uptex_prereq = uptexd.h ptexdir/ptex_version.h uptexdir/uptex_version.h
$(uptex_OBJECTS): $(uptex_prereq)

$(uptex_c_h): uptex-web2c
	@$(web2c) uptex
uptex-web2c: uptex.p $(web2c_texmf) uptexdir/uptex.defines
	@$(web2c) uptex

uptex-pool.c: uptex.pool uptexd.h $(makecpool_stamp)
	$(makecpool) uptex >$@ || rm -f $@

# Tangling upTeX
uptex.p uptex.pool: uptex-tangle
	$(texmf_tangle) uptex uptex
uptex-tangle: tangle$(EXEEXT) uptex.web uptex.ch tangle-sh
	$(texmf_tangle) uptex uptex

# Extract uptex version
$(srcdir)/uptexdir/uptex_version.h: @MAINTAINER_MODE_TRUE@ uptexdir/uptex-m.ch
	$(AM_V_GEN)grep '^@d upTeX_version_string==' $(srcdir)/uptexdir/uptex-m.ch \
	  | sed "s/^.*'-/#define UPTEX_VERSION \"/;s/'.*$$/\"/" >$@

# Generate uptex.web
uptex.web: tie$(EXEEXT) $(uptex_web_srcs)
	$(tie_m) $(uptex_web_srcs)
uptex_web_srcs = \
	tex.web \
	tex.ch \
	tracingstacklevels.ch \
	partoken.ch \
	zlib-fmt.ch

# Generate uptex.ch
uptex.ch: tie$(EXEEXT) uptex.web $(uptex_ch_srcs)
	$(tie_c) uptex.web $(uptex_ch_srcs)
uptex_ch_srcs = \
	ptexdir/ptex-base.ch \
	uptexdir/uptex-m.ch \
	$(uptex_ch_synctex) \
	tex-binpool.ch

EXTRA_DIST += $(uptex_web_srcs) $(uptex_ch_srcs) uptexdir/uptex.defines

DISTCLEANFILES += $(nodist_uptex_SOURCES) uptex.web uptex.ch uptex-web2c \
	uptex.p uptex.pool uptex-tangle

## upBibTeX
##
nodist_upbibtex_SOURCES = upbibtex.c upbibtex.h
upbibtex_SOURCES = uptexdir/kanji.h
upbibtex_CPPFLAGS = $(uptex_cppflags)
upbibtex_LDADD = $(uptex_ldadd)
upbibtex_DEPENDENCIES = $(uptex_dependencies)
upbibtex.c upbibtex.h: upbibtex-web2c
	@$(web2c) upbibtex
upbibtex-web2c: upbibtex.p $(web2c_depend) uptexdir/uptex.defines web2c/cvtbib.sed
	@$(web2c) upbibtex
upbibtex.p: tangle$(EXEEXT) upbibtex.web uptexdir/upbibtex.ch
	$(up_tangle) upbibtex upbibtex
upbibtex.web: tie$(EXEEXT) bibtex.web bibtex.ch ptexdir/pbibtex.ch
	$(tie_m) bibtex.web bibtex.ch ptexdir/pbibtex.ch
EXTRA_DIST += ptexdir/pbibtex.ch uptexdir/upbibtex.ch

## upDVItype
##
nodist_updvitype_SOURCES = updvitype.c updvitype.h
updvitype_SOURCES = uptexdir/kanji.h
updvitype_CPPFLAGS = $(uptex_cppflags) -DHEX_CHAR_CODE
updvitype_LDADD = $(uptex_ldadd)
updvitype_DEPENDENCIES = $(uptex_dependencies)
updvitype.c updvitype.h: updvitype-web2c
	@$(web2c) updvitype
updvitype-web2c: updvitype.p $(web2c_depend) uptexdir/uptex.defines
	@$(web2c) updvitype
updvitype.p: tangle$(EXEEXT) updvitype.web uptexdir/updvitype.ch
	$(up_tangle) updvitype updvitype
updvitype.web: tie$(EXEEXT) dvitype.web dvitype.ch ptexdir/pdvitype.ch
	$(tie_m) dvitype.web dvitype.ch ptexdir/pdvitype.ch
EXTRA_DIST += ptexdir/pdvitype.ch uptexdir/updvitype.ch

## upPLtoTF
##
nodist_uppltotf_SOURCES = uppltotf.c uppltotf.h
uppltotf_SOURCES = uptexdir/kanji.h
uppltotf_CPPFLAGS = $(uptex_cppflags) -DPRESERVE_PUTC
uppltotf_LDADD = $(uptex_ldadd)
uppltotf_DEPENDENCIES = $(uptex_dependencies)
uppltotf.c uppltotf.h: uppltotf-web2c
	@$(web2c) uppltotf
uppltotf-web2c: uppltotf.p $(web2c_depend) uptexdir/uptex.defines
	@$(web2c) uppltotf
uppltotf.p: tangle$(EXEEXT) uppltotf.web uptexdir/uppltotf.ch
	$(up_tangle) uppltotf uppltotf
uppltotf.web: tie$(EXEEXT) pltotf.web pltotf.ch ptexdir/ppltotf.ch
	$(tie_m) pltotf.web pltotf.ch ptexdir/ppltotf.ch
EXTRA_DIST += ptexdir/ppltotf.ch uptexdir/uppltotf.ch

## upTFtoPL
##
nodist_uptftopl_SOURCES = uptftopl.c uptftopl.h
uptftopl_SOURCES = uptexdir/kanji.h
uptftopl_CPPFLAGS = $(uptex_cppflags)
uptftopl_LDADD = $(uptex_ldadd)
uptftopl_DEPENDENCIES = $(uptex_dependencies)
uptftopl.c uptftopl.h: uptftopl-web2c
	@$(web2c) uptftopl
uptftopl-web2c: uptftopl.p $(web2c_depend) uptexdir/uptex.defines
	@$(web2c) uptftopl
uptftopl.p: tangle$(EXEEXT) uptftopl.web uptexdir/uptftopl.ch
	$(up_tangle) uptftopl uptftopl
uptftopl.web: tie$(EXEEXT) tftopl.web tftopl.ch ptexdir/ptftopl.ch
	$(tie_m) tftopl.web tftopl.ch ptexdir/ptftopl.ch
EXTRA_DIST += ptexdir/ptftopl.ch uptexdir/uptftopl.ch

##
EXTRA_DIST += \
	uptexdir/COPYRIGHT \
	uptexdir/COPYRIGHT.jis \
	uptexdir/ChangeLog

# upTeX Tests
uptex_tests = uptexdir/uptriptest.test uptexdir/upver.test uptexdir/upkcat.test
uptexdir/uptriptest.log: uptex$(EXEEXT) dvitype$(EXEEXT) pltotf$(EXEEXT) tftopl$(EXEEXT)
uptexdir/upver.log uptexdir/upkcat.log: uptex$(EXEEXT)
upweb_tests = \
	uptexdir/upbibtex.test \
	uptexdir/updvitype.test \
	uptexdir/uppltotf.test \
	uptexdir/uptftopl.test
## upBibTeX
upweb_tests += \
	uptexdir/upbibtex-openout-test.pl uptexdir/upbibtex-longline-test.pl \
	uptexdir/upbibtex-mem.test uptexdir/nissya.test
## upDviType
upweb_tests += \
	uptexdir/sample.test
# uppPLtoTF/upTFtoPL
upweb_tests += \
	uptexdir/yokotate.test uptexdir/skipjfmp.test \
	uptexdir/newjfm.test uptexdir/uparse.test uptexdir/gkhuge.test
uptexdir/upbibtex.log: upbibtex$(EXEEXT)
uptexdir/updvitype.log: updvitype$(EXEEXT)
uptexdir/uppltotf.log: uppltotf$(EXEEXT)
uptexdir/uptftopl.log: uptftopl$(EXEEXT)
uptexdir/upbibtex-openout-test.log uptexdir/upbibtex-longline-test.log \
	uptexdir/upbibtex-mem.log uptexdir/nissya.log: upbibtex$(EXEEXT)
uptexdir/sample.log: pdvitype$(EXEEXT)
uptexdir/yokotate.log uptexdir/skipjfmp.log \
	uptexdir/newjfm.log uptexdir/uparse.log uptexdir/gkhuge.log: uppltotf$(EXEEXT) uptftopl$(EXEEXT)

EXTRA_DIST += $(uptex_tests) $(upweb_tests)
DISTCLEANFILES += $(upweb_programs:=.c) $(upweb_programs:=.h) \
	$(upweb_programs:=.p) $(upweb_programs:=-web2c) $(upweb_programs:=.web)

if UPTEX
TESTS += $(uptex_tests)
TRIPTRAP += uptrip.diffs
TRIPTRAP_CLEAN += uptrip-clean
endif UPTEX
if UPWEB
TESTS += $(upweb_tests)
endif UPWEB

## Test data and results
##
## uptexdir/nissya.test
DISTCLEANFILES += uptests/nissya_bib.*
## uptexdir/upbibtex.test
EXTRA_DIST += tests/enc-u.bbl tests/enc-eu.bbl tests/enc-su.bbl tests/enc-uu.bbl
DISTCLEANFILES += uptests/xexampl.aux uptests/xexampl.bbl uptests/xexampl.blg \
	uptests/xenc*.*
## uptexdir/upbibtex-mem.test
DISTCLEANFILES += uptests/memtest.bib uptests/memtest?.*
## uptexdir/updvitype.test
EXTRA_DIST += uptexdir/tests/uptex3.tex uptexdir/tests/uptex3.dvi \
	uptexdir/tests/uptex4.tex uptexdir/tests/uptex4.dvi \
	uptexdir/tests/uptex3a.typ uptexdir/tests/uptex4a.typ
DISTCLEANFILES += uptests/xstory.dvityp uptests/xpagenum.typ uptests/x*ptex[34]*.typ
## uptexdir/uppltotf.test
DISTCLEANFILES += uptests/xcmr10.tfm
## uptexdir/uptftopl.test
DISTCLEANFILES += uptests/xcmr10.pl
## ptexdir/sample.test
DISTCLEANFILES += uptests/xsample*.typ
## uptexdir/yokotate.test
EXTRA_DIST += uptexdir/tests/umin10.pl uptexdir/tests/umin10.tfm
EXTRA_DIST += uptexdir/tests/utmin10.pl uptexdir/tests/utmin10.tfm
DISTCLEANFILES += uptests/x*min10.* uptests/xchcode*.*
## uptexdir/newjfm.test
EXTRA_DIST += uptexdir/tests/testnewu.pl uptexdir/tests/testnewu.tfm
DISTCLEANFILES += uptests/xtestnewu.*
## uptexdir/uparse.test
EXTRA_DIST += uptexdir/tests/uparse.pl uptexdir/tests/uparse.tfm
DISTCLEANFILES += uptests/xuparse.* uptests/yuparse.*
## uptexdir/gkhuge.test
EXTRA_DIST += uptexdir/tests/gkhugeok.tfm uptexdir/tests/gkhugeng.tfm uptexdir/tests/gkhugeng.err
DISTCLEANFILES += uptests/ygkhuge*.*
## uptexdir/skipjfmp.test
DISTCLEANFILES += uptests/xskipjfmp.*
## uptexdir/uptriptest
EXTRA_DIST += uptexdir/uptrip/uptrip.diffs uptexdir/uptrip/texmf.cnf
uptrip.diffs: uptex$(EXEEXT) dvitype$(EXEEXT) pltotf$(EXEEXT) tftopl$(EXEEXT)
	$(triptrap_diffs) $@
.PHONY: uptrip-clean
uptrip-clean:
	rm -rf uptripdir

DISTCLEANFILES += uptrip.diffs

# (end of uptex.am)