summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/ptexdir/am/ptex.am
blob: a56533a8042a89bf1eba82f6457cfae73afefa01 (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
## $Id$
## texk/web2c/ptexdir/am/ptex.am: Makefile fragment for pTeX.
##
## Copyright 2015-2022 Karl Berry <tex-live@tug.org>
## Copyright 2010-2015 Peter Breitenlohner <tex-live@tug.org>
## You may freely use, modify and/or distribute this file.

ptex_cppflags = $(PTEXENC_INCLUDES) $(AM_CPPFLAGS) $(ZLIB_INCLUDES)
ptex_ldadd = libkanji.a $(pproglib) $(PTEXENC_LIBS) $(LDADD) $(ZLIB_LIBS)
ptex_dependencies = libkanji.a $(pproglib) $(PTEXENC_DEPEND) $(ZLIB_DEPEND) $(default_dependencies)
p_tangle = $(tangle_silent)WEBINPUTS=.:$(srcdir)/ptexdir:$(srcdir) $(buildenv) $(TANGLE)

#pweb_programs = pbibtex pdvitype ppltotf ptftopl

## pTeX library
##
pproglib = lib/libp.a
# Rebuild $(pproglib)
$(pproglib): $(KPATHSEA_DEPEND) ${srcdir}/lib/*.c
	cd lib && $(MAKE) $(AM_MAKEFLAGS) libp.a

## libkanji.a for pTeX and e-pTeX
##
EXTRA_LIBRARIES += libkanji.a
libkanji_a_SOURCES = ptexdir/kanji.c ptexdir/kanji.h ptexdir/kanji_dump.c
libkanji_a_CPPFLAGS = $(ptex_cppflags)

## pTeX
##
if PTEX
bin_PROGRAMS += ptex
endif PTEX
#if PWEB
#bin_PROGRAMS += $(pweb_programs)
#endif PWEB
#EXTRA_PROGRAMS += ptex $(pweb_programs)

ptex_CPPFLAGS = $(ptex_cppflags)

# With --enable-ipc, pTeX may need to link with -lsocket.
ptex_LDADD = $(ptex_ldadd) $(ipc_socketlibs)
ptex_DEPENDENCIES = $(ptex_dependencies)

# pTeX C sources
ptex_c_h = ptexini.c ptex0.c ptexcoerce.h ptexd.h
nodist_ptex_SOURCES = $(ptex_c_h) ptex-pool.c
dist_ptex_SOURCES = ptexdir/ptexextra.c ptexdir/ptexextra.h ptexdir/ptex_version.h

# We must create ptexd.h and ptexdir/ptex_version.h before building the ptex_OBJECTS.
ptex_prereq = ptexd.h ptexdir/ptex_version.h
$(ptex_OBJECTS): $(ptex_prereq)

$(ptex_c_h): ptex-web2c
	@$(web2c) ptex
ptex-web2c: ptex.p $(web2c_texmf) ptexdir/ptex.defines
	@$(web2c) ptex

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

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

# Extract ptex version
$(srcdir)/ptexdir/ptex_version.h: @MAINTAINER_MODE_TRUE@ ptexdir/ptex-base.ch
	$(AM_V_GEN)grep '^@d pTeX_version_string==' $(srcdir)/ptexdir/ptex-base.ch \
	  | sed "s/^.*'-/#define PTEX_VERSION \"/;s/'.*$$/\"/" >$@

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

# Generate ptex.ch
ptex.ch: tie$(EXEEXT) ptex.web $(ptex_ch_srcs)
	$(tie_c) ptex.web $(ptex_ch_srcs)
ptex_ch_srcs = \
	ptexdir/ptex-base.ch \
	$(ptex_ch_synctex) \
	tex-binpool.ch

EXTRA_DIST += $(ptex_web_srcs) $(ptex_ch_srcs) ptexdir/ptex.defines

DISTCLEANFILES += $(nodist_ptex_SOURCES) ptex.web ptex.ch ptex-web2c \
	ptex.p ptex.pool ptex-tangle

## 
EXTRA_DIST += \
	ptexdir/COPYRIGHT \
	ptexdir/COPYRIGHT.jis \
	ptexdir/ChangeLog \
	ptexdir/Changes.txt \
	ptexdir/INSTALL.txt \
	ptexdir/README.txt

# pTeX Tests
#
ptex_tests = ptexdir/ptriptest.test ptexdir/pver.test ptexdir/wcfname.test
ptexdir/ptriptest.log: ptex$(EXEEXT) dvitype$(EXEEXT) pltotf$(EXEEXT) tftopl$(EXEEXT)
ptexdir/pver.log ptexdir/wcfname.log: ptex$(EXEEXT)
#pweb_tests = \
#	ptexdir/pbibtex.test \
#	ptexdir/pdvitype.test \
#	ptexdir/ppltotf.test \
#	ptexdir/ptftopl.test
## pBibTeX
#pweb_tests += \
#	ptexdir/pbibtex-openout-test.pl ptexdir/pbibtex-longline-test.pl \
#	ptexdir/pbibtex-mem.test ptexdir/nissya.test
## pDviType
#pweb_tests += \
#	ptexdir/sample.test
# ppPLtoTF/pTFtoPL
#pweb_tests += \
#	ptexdir/yokotate.test ptexdir/skipjfmp.test
ptexdir/pbibtex.log: pbibtex$(EXEEXT)
ptexdir/pdvitype.log: pdvitype$(EXEEXT)
ptexdir/ppltotf.log: ppltotf$(EXEEXT)
ptexdir/ptftopl.log: ptftopl$(EXEEXT)
ptexdir/pbibtex-openout-test.log ptexdir/pbibtex-longline-test.log \
	ptexdir/pbibtex-mem.log ptexdir/nissya.log: pbibtex$(EXEEXT)
ptexdir/sample.log: pdvitype$(EXEEXT)
ptexdir/yokotate.log ptexdir/skipjfmp.log: ppltotf$(EXEEXT) ptftopl$(EXEEXT)

EXTRA_DIST += $(ptex_tests) $(pweb_tests)
DISTCLEANFILES += $(pweb_programs:=.c) $(pweb_programs:=.h) \
	$(pweb_programs:=.p) $(pweb_programs:=-web2c) $(pweb_programs:=.web)

if PTEX
TESTS += $(ptex_tests)
TRIPTRAP += ptrip.diffs
TRIPTRAP_CLEAN += ptrip-clean
endif PTEX
if PWEB
TESTS += $(pweb_tests)
endif PWEB

## Test data and results
##
## ptexdir/nissya.test
EXTRA_DIST += ptexdir/tests/nissya_bib.aux ptexdir/tests/nissya.bst ptexdir/tests/sample.bib \
	ptexdir/tests/nissya_bib.bbl
DISTCLEANFILES += ptests/nissya_bib.*
## ptexdir/pbibtex.test
EXTRA_DIST += tests/testfield.bst tests/enc-asc.bib tests/enc-jis.bib tests/enc-sjis.bib \
	tests/enc-euc.bib tests/enc-utf8.bib tests/enc-utf8a.bib tests/enc-utf8b.bib \
	tests/enc-amb0.bib tests/enc-amb1.bib tests/enc-amb2.bib \
	tests/enc.aux tests/enc-e.aux tests/enc-s.aux tests/enc-u.aux \
	tests/enc-p.bbl tests/enc-ep.bbl tests/enc-sp.bbl tests/enc-up.bbl
DISTCLEANFILES += ptests/xexampl.aux ptests/xexampl.bbl ptests/xexampl.blg \
	ptests/xenc*.* ptests/fn*.*
## ptexdir/pbibtex-mem.test
EXTRA_DIST += tests/memdata1.bst tests/memdata2.bst tests/memdata3.bst
DISTCLEANFILES += ptests/memtest.bib ptests/memtest?.*
## ptexdir/pdvitype.test
EXTRA_DIST += ptexdir/tests/ptex3.tex ptexdir/tests/ptex3.dvi \
	ptexdir/tests/ptex4.tex ptexdir/tests/ptex4.dvi \
	ptexdir/tests/ptex3a-jis.typ ptexdir/tests/ptex3a-utf8.typ \
	ptexdir/tests/ptex4a-jis.typ ptexdir/tests/ptex4a-utf8.typ
DISTCLEANFILES += ptests/xstory.dvityp ptests/xpagenum.typ ptests/xptex[34]*.typ
## ptexdir/ppltotf.test
DISTCLEANFILES += ptests/xcmr10.tfm
## ptexdir/ptftopl.test
DISTCLEANFILES += ptests/xcmr10.pl
## ptexdir/sample.test
EXTRA_DIST += ptexdir/tests/goth10.tfm ptexdir/tests/sample.dvi ptexdir/tests/samplea.typ
DISTCLEANFILES += ptests/xsample*.typ
## ptexdir/yokotate.test
EXTRA_DIST += ptexdir/tests/min10.pl ptexdir/tests/min10.tfm
EXTRA_DIST += ptexdir/tests/tmin10.pl ptexdir/tests/tmin10.tfm
EXTRA_DIST += ptexdir/tests/chcode.pl ptexdir/tests/chcode-jis.pl ptexdir/tests/chcode.tfm \
	ptexdir/tests/chcode-utf8.pl ptexdir/tests/chcode-euc.pl ptexdir/tests/chcode-sjis.pl
DISTCLEANFILES += ptests/x*min10.* ptests/xchcode*.*
## ptexdir/skipjfmp.test
EXTRA_DIST += ptexdir/tests/skipjfmp.pl ptexdir/tests/skipjfmp.tfm
DISTCLEANFILES += ptests/xskipjfmp.*
## ptexdir/ptriptest
EXTRA_DIST += ptexdir/ptrip/ptrip.diffs ptexdir/ptrip/texmf.cnf
ptrip.diffs: ptex$(EXEEXT) dvitype$(EXEEXT) pltotf$(EXEEXT) tftopl$(EXEEXT)
	$(triptrap_diffs) $@
.PHONY: ptrip-clean
ptrip-clean:
	rm -rf ptripdir

DISTCLEANFILES += ptrip.diffs

# (end of ptex.am)