synch with TL 37803
[luatex.git] / source / texk / web2c / ptexdir / am / ptex.am
blobdd0610e3147be9393ea08b1a956097a535e3fff3
1 ## texk/web2c/ptexdir/am/ptex.am: Makefile fragment for pTeX.
2 ##
3 ## Copyright (C) 2010-2015 Peter Breitenlohner <tex-live@tug.org>
4 ## You may freely use, modify and/or distribute this file.
6 ptex_cppflags = $(PTEXENC_INCLUDES) $(AM_CPPFLAGS)
7 ptex_ldadd = libkanji.a $(pproglib) $(PTEXENC_LIBS) $(LDADD)
8 ptex_dependencies = libkanji.a $(pproglib) $(PTEXENC_DEPEND) $(default_dependencies)
9 p_tangle = $(tangle_silent)WEBINPUTS=.:$(srcdir)/ptexdir:$(srcdir) $(buildenv) $(TANGLE)
11 pweb_programs = pbibtex pdvitype ppltotf ptftopl
13 # pTeX Tests
15 ptex_tests = ptexdir/ptriptest
16 pweb_tests = \
17         ptexdir/pbibtex.test \
18         ptexdir/pdvitype.test \
19         ptexdir/ppltotf.test \
20         ptexdir/ptftopl.test
22 EXTRA_DIST += $(ptex_tests) $(pweb_tests)
23 DISTCLEANFILES += $(pweb_programs:=.c) $(pweb_programs:=.h) \
24         $(pweb_programs:=.p) $(pweb_programs:=-web2c) $(pweb_programs:=.web)
26 ## pTeX library
28 pproglib = lib/libp.a
29 # Rebuild $(pproglib)
30 $(pproglib): $(KPATHSEA_DEPEND) ${srcdir}/lib/*.c
31         cd lib && $(MAKE) $(AM_MAKEFLAGS) libp.a
33 ## libkanji.a for pTeX and e-pTeX
35 EXTRA_LIBRARIES += libkanji.a
36 libkanji_a_SOURCES = ptexdir/kanji.c ptexdir/kanji.h
37 libkanji_a_CPPFLAGS = $(ptex_cppflags)
39 ## pTeX
41 if PTEX
42 bin_PROGRAMS += ptex
43 endif PTEX
44 if PWEB
45 bin_PROGRAMS += $(pweb_programs)
46 endif PWEB
47 EXTRA_PROGRAMS += ptex $(pweb_programs)
49 ptex_CPPFLAGS = $(ptex_cppflags)
51 # With --enable-ipc, pTeX may need to link with -lsocket.
52 ptex_LDADD = $(ptex_ldadd) $(ipc_socketlibs)
53 ptex_DEPENDENCIES = $(ptex_dependencies)
55 # pTeX C sources
56 ptex_c_h = ptexini.c ptex0.c ptexcoerce.h ptexd.h
57 nodist_ptex_SOURCES = $(ptex_c_h) ptex-pool.c
58 dist_ptex_SOURCES = ptexdir/ptexextra.c ptexdir/ptexextra.h ptexdir/ptex_version.h
60 # We must create ptexd.h and ptexdir/ptex_version.h before building the ptex_OBJECTS.
61 ptex_prereq = ptexd.h ptexdir/ptex_version.h
62 $(ptex_OBJECTS): $(ptex_prereq)
64 $(ptex_c_h): ptex-web2c
65         @$(web2c) ptex
66 ptex-web2c: ptex.p $(web2c_texmf) ptexdir/ptex.defines
67         @$(web2c) ptex
69 ptex-pool.c: ptex.pool ptexd.h $(makecpool_stamp)
70         $(makecpool) ptex >$@ || rm -f $@
72 # Tangling pTeX
73 ptex.p ptex.pool: ptex-tangle
74         @$(texmf_tangle) ptex ptex
75 ptex-tangle: tangle$(EXEEXT) ptex.web ptex.ch tangle-sh
76         @$(texmf_tangle) ptex ptex
78 # Extract ptex version
79 $(srcdir)/ptexdir/ptex_version.h: @MAINTAINER_MODE_TRUE@ ptexdir/ptex-base.ch
80         $(AM_V_GEN)grep '^@d pTeX_version_string==' $(srcdir)/ptexdir/ptex-base.ch \
81           | sed "s/^.*'-/#define PTEX_VERSION \"/;s/'.*$$/\"/" >$@
83 # Generate ptex.web
84 ptex.web: tie$(EXEEXT) $(ptex_web_srcs)
85         $(tie_m) $(ptex_web_srcs)
86 ptex_web_srcs = \
87         tex.web \
88         tex.ch
90 # Generate ptex.ch
91 ptex.ch: tie$(EXEEXT) ptex.web $(ptex_ch_srcs)
92         $(tie_c) ptex.web $(ptex_ch_srcs)
93 ptex_ch_srcs = \
94         ptexdir/ptex-base.ch \
95         $(ptex_ch_synctex) \
96         tex-binpool.ch
98 EXTRA_DIST += $(ptex_web_srcs) $(ptex_ch_srcs) ptexdir/ptex.defines
100 DISTCLEANFILES += $(nodist_ptex_SOURCES) ptex.web ptex.ch ptex-web2c \
101         ptex.p ptex.pool ptex-tangle
103 ## pBibTeX
104 ## 
105 nodist_pbibtex_SOURCES = pbibtex.c pbibtex.h
106 pbibtex_SOURCES = ptexdir/kanji.h
107 pbibtex_CPPFLAGS = $(ptex_cppflags)
108 pbibtex_LDADD  = $(ptex_ldadd)
109 pbibtex_DEPENDENCIES = $(ptex_dependencies)
110 pbibtex.c pbibtex.h: pbibtex-web2c
111         @$(web2c) pbibtex
112 pbibtex-web2c: pbibtex.p $(web2c_depend) ptexdir/ptex.defines web2c/cvtbib.sed
113         @$(web2c) pbibtex
114 pbibtex.p: tangle$(EXEEXT) pbibtex.web ptexdir/pbibtex.ch
115         $(p_tangle) pbibtex pbibtex
116 pbibtex.web: tie$(EXEEXT) bibtex.web bibtex.ch
117         $(tie_m) bibtex.web bibtex.ch
118 EXTRA_DIST += ptexdir/pbibtex.ch web2c/cvtbib.sed
120 pweb_tests += ptexdir/pbibtex-openout-test.pl ptexdir/pbibtex-longline-test.pl
121 pweb_tests += ptexdir/pbibtex-mem.test ptexdir/nissya.test
123 ## pDVItype
124 ## 
125 nodist_pdvitype_SOURCES = pdvitype.c pdvitype.h
126 pdvitype_SOURCES = ptexdir/kanji.h
127 pdvitype_CPPFLAGS = $(ptex_cppflags) -DHEX_CHAR_CODE
128 pdvitype_LDADD = $(ptex_ldadd)
129 pdvitype_DEPENDENCIES = $(ptex_dependencies)
130 pdvitype.c pdvitype.h: pdvitype-web2c
131         @$(web2c) pdvitype
132 pdvitype-web2c: pdvitype.p $(web2c_depend) ptexdir/ptex.defines
133         @$(web2c) pdvitype
134 pdvitype.p: tangle$(EXEEXT) pdvitype.web ptexdir/pdvitype.ch
135         $(p_tangle) pdvitype pdvitype
136 pdvitype.web: tie$(EXEEXT) dvitype.web dvitype.ch
137         $(tie_m) dvitype.web dvitype.ch
138 EXTRA_DIST += ptexdir/pdvitype.ch
140 pweb_tests += ptexdir/sample.test
142 ## pPLtoTF
143 ## 
144 nodist_ppltotf_SOURCES = ppltotf.c ppltotf.h
145 ppltotf_SOURCES = ptexdir/kanji.h
146 ppltotf_CPPFLAGS = $(ptex_cppflags) -DPRESERVE_PUTC
147 ppltotf_LDADD  = $(ptex_ldadd)
148 ppltotf_DEPENDENCIES = $(ptex_dependencies)
149 ppltotf.c ppltotf.h: ppltotf-web2c
150         @$(web2c) ppltotf
151 ppltotf-web2c: ppltotf.p $(web2c_depend) ptexdir/ptex.defines
152         @$(web2c) ppltotf
153 ppltotf.p: tangle$(EXEEXT) ppltotf.web ptexdir/ppltotf.ch
154         $(p_tangle) ppltotf ppltotf
155 ppltotf.web: tie$(EXEEXT) pltotf.web pltotf.ch
156         $(tie_m) pltotf.web pltotf.ch
157 EXTRA_DIST += ptexdir/ppltotf.ch
159 ## pTFtoPL
160 ## 
161 nodist_ptftopl_SOURCES = ptftopl.c ptftopl.h
162 ptftopl_SOURCES = ptexdir/kanji.h
163 ptftopl_CPPFLAGS = $(ptex_cppflags)
164 ptftopl_LDADD  = $(ptex_ldadd)
165 ptftopl_DEPENDENCIES = $(ptex_dependencies)
166 ptftopl.c ptftopl.h: ptftopl-web2c
167         @$(web2c) ptftopl
168 ptftopl-web2c: ptftopl.p $(web2c_depend) ptexdir/ptex.defines
169         @$(web2c) ptftopl
170 ptftopl.p: tangle$(EXEEXT) ptftopl.web ptexdir/ptftopl.ch
171         $(p_tangle) ptftopl ptftopl
172 ptftopl.web: tie$(EXEEXT) tftopl.web tftopl.ch
173         $(tie_m) tftopl.web tftopl.ch
174 EXTRA_DIST += ptexdir/ptftopl.ch
176 pweb_tests += ptexdir/yokotate.test
178 ## 
179 EXTRA_DIST += \
180         ptexdir/COPYRIGHT \
181         ptexdir/COPYRIGHT.jis \
182         ptexdir/ChangeLog \
183         ptexdir/Changes.txt \
184         ptexdir/INSTALL.txt \
185         ptexdir/README.txt
187 if PTEX
188 TESTS += $(ptex_tests)
189 check_PROGRAMS += dvitype pltotf tftopl
190 TRIPTRAP += ptrip.diffs
191 TRIPTRAP_CLEAN += ptrip-clean
192 endif PTEX
193 if PWEB
194 TESTS += $(pweb_tests)
195 endif PWEB
197 ## Test data and results
199 ## ptexdir/nissya.test
200 EXTRA_DIST += ptexdir/tests/nissya_bib.aux ptexdir/tests/nissya.bst ptexdir/tests/sample.bib
201 DISTCLEANFILES += ptests/nissya_bib.*
202 ## ptexdir/pbibtex.test
203 DISTCLEANFILES += ptests/xexampl.aux ptests/xexampl.bbl ptests/xexampl.blg
204 ## ptexdir/pbibtex-mem.test
205 EXTRA_DIST += tests/memdata1.bst tests/memdata2.bst tests/memdata3.bst
206 DISTCLEANFILES += ptests/memtest.bib ptests/memtest?.*
207 ## ptexdir/pdvitype.test
208 DISTCLEANFILES += ptests/xstory.dvityp ptests/xpagenum.typ
209 ## ptexdir/ppltotf.test
210 DISTCLEANFILES += ptests/xcmr10.tfm
211 ## ptexdir/ptftopl.test
212 DISTCLEANFILES += ptests/xcmr10.pl
213 ## ptexdir/sample.test
214 EXTRA_DIST += ptexdir/tests/goth10.tfm ptexdir/tests/sample.dvi
215 DISTCLEANFILES += ptests/xsample.typ
216 ## ptexdir/yokotate.test
217 EXTRA_DIST += ptexdir/tests/min10.pl ptexdir/tests/min10.tfm
218 EXTRA_DIST += ptexdir/tests/tmin10.pl ptexdir/tests/tmin10.tfm
219 DISTCLEANFILES += ptests/x*min10.*
220 ## ptexdir/ptriptest
221 EXTRA_DIST += ptexdir/ptrip/ptrip.diffs ptexdir/ptrip/texmf.cnf
222 ptrip.diffs: ptex$(EXEEXT)
223         $(triptrap_diffs) $@
224 .PHONY: ptrip-clean
225 ptrip-clean:
226         rm -rf ptripdir
228 DISTCLEANFILES += ptrip.diffs