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