beta-0.89.2
[luatex.git] / source / texk / web2c / uptexdir / am / uptex.am
blob40babfa59cc4868ac10b3ca558de70c2e16f30d8
1 ## texk/web2c/uptexdir/am/uptex.am: Makefile fragment for upTeX.
2 ##
3 ## Copyright (C) 2011-2015 Peter Breitenlohner <tex-live@tug.org>
4 ## You may freely use, modify and/or distribute this file.
6 uptex_cppflags = $(PTEXENC_INCLUDES) $(AM_CPPFLAGS)
7 uptex_ldadd = libukanji.a $(pproglib) $(PTEXENC_LIBS) $(LDADD)
8 uptex_dependencies = libukanji.a $(pproglib) $(PTEXENC_DEPEND) $(default_dependencies)
9 up_tangle = $(tangle_silent)WEBINPUTS=.:$(srcdir)/uptexdir:$(srcdir) $(buildenv) $(TANGLE)
11 upweb_programs = upbibtex updvitype uppltotf uptftopl
13 ## libukanji.a for upTeX and e-upTeX
15 EXTRA_LIBRARIES += libukanji.a
16 libukanji_a_SOURCES = uptexdir/kanji.c uptexdir/kanji.h uptexdir/kanji_dump.c
17 libukanji_a_CPPFLAGS = $(uptex_cppflags)
19 ## upTeX
21 if UPTEX
22 bin_PROGRAMS += uptex
23 endif UPTEX
24 if UPWEB
25 bin_PROGRAMS += $(upweb_programs)
26 endif UPWEB
27 EXTRA_PROGRAMS += uptex $(upweb_programs)
29 uptex_CPPFLAGS = $(uptex_cppflags)
31 # With --enable-ipc, upTeX may need to link with -lsocket.
32 uptex_LDADD = $(uptex_ldadd) $(ipc_socketlibs)
33 uptex_DEPENDENCIES = $(uptex_dependencies)
35 # upTeX C sources
36 uptex_c_h = uptexini.c uptex0.c uptexcoerce.h uptexd.h
37 nodist_uptex_SOURCES = $(uptex_c_h) uptex-pool.c
38 dist_uptex_SOURCES = uptexdir/uptexextra.c uptexdir/uptexextra.h uptexdir/uptex_version.h
40 # We must create uptexd.h and uptexdir/uptex_version.h before building the uptex_OBJECTS.
41 uptex_prereq = uptexd.h ptexdir/ptex_version.h uptexdir/uptex_version.h
42 $(uptex_OBJECTS): $(uptex_prereq)
44 $(uptex_c_h): uptex-web2c
45         @$(web2c) uptex
46 uptex-web2c: uptex.p $(web2c_texmf) uptexdir/uptex.defines
47         @$(web2c) uptex
49 uptex-pool.c: uptex.pool uptexd.h $(makecpool_stamp)
50         $(makecpool) uptex >$@ || rm -f $@
52 # Tangling upTeX
53 uptex.p uptex.pool: uptex-tangle
54         @$(texmf_tangle) uptex uptex
55 uptex-tangle: tangle$(EXEEXT) uptex.web uptex.ch tangle-sh
56         @$(texmf_tangle) uptex uptex
58 # Extract uptex version
59 $(srcdir)/uptexdir/uptex_version.h: @MAINTAINER_MODE_TRUE@ uptexdir/uptex-m.ch
60         $(AM_V_GEN)grep '^@d upTeX_version_string==' $(srcdir)/uptexdir/uptex-m.ch \
61           | sed "s/^.*'-/#define UPTEX_VERSION \"/;s/'.*$$/\"/" >$@
63 # Generate uptex.web
64 uptex.web: tie$(EXEEXT) $(uptex_web_srcs)
65         $(tie_m) $(uptex_web_srcs)
66 uptex_web_srcs = \
67         tex.web \
68         tex.ch
70 # Generate uptex.ch
71 uptex.ch: tie$(EXEEXT) uptex.web $(uptex_ch_srcs)
72         $(tie_c) uptex.web $(uptex_ch_srcs)
73 uptex_ch_srcs = \
74         ptexdir/ptex-base.ch \
75         uptexdir/uptex-m.ch \
76         $(uptex_ch_synctex) \
77         tex-binpool.ch
79 EXTRA_DIST += $(uptex_web_srcs) $(uptex_ch_srcs) uptexdir/uptex.defines
81 DISTCLEANFILES += $(nodist_uptex_SOURCES) uptex.web uptex.ch uptex-web2c \
82         uptex.p uptex.pool uptex-tangle
84 ## upBibTeX
86 nodist_upbibtex_SOURCES = upbibtex.c upbibtex.h
87 upbibtex_SOURCES = uptexdir/kanji.h
88 upbibtex_CPPFLAGS = $(uptex_cppflags)
89 upbibtex_LDADD = $(uptex_ldadd)
90 upbibtex_DEPENDENCIES = $(uptex_dependencies)
91 upbibtex.c upbibtex.h: upbibtex-web2c
92         @$(web2c) upbibtex
93 upbibtex-web2c: upbibtex.p $(web2c_depend) uptexdir/uptex.defines web2c/cvtbib.sed
94         @$(web2c) upbibtex
95 upbibtex.p: tangle$(EXEEXT) upbibtex.web uptexdir/upbibtex.ch
96         $(up_tangle) upbibtex upbibtex
97 upbibtex.web: tie$(EXEEXT) bibtex.web bibtex.ch ptexdir/pbibtex.ch
98         $(tie_m) bibtex.web bibtex.ch ptexdir/pbibtex.ch
99 EXTRA_DIST += ptexdir/pbibtex.ch uptexdir/upbibtex.ch
101 ## upDVItype
103 nodist_updvitype_SOURCES = updvitype.c updvitype.h
104 updvitype_SOURCES = uptexdir/kanji.h
105 updvitype_CPPFLAGS = $(uptex_cppflags) -DHEX_CHAR_CODE
106 updvitype_LDADD = $(uptex_ldadd)
107 updvitype_DEPENDENCIES = $(uptex_dependencies)
108 updvitype.c updvitype.h: updvitype-web2c
109         @$(web2c) updvitype
110 updvitype-web2c: updvitype.p $(web2c_depend) uptexdir/uptex.defines
111         @$(web2c) updvitype
112 updvitype.p: tangle$(EXEEXT) updvitype.web uptexdir/updvitype.ch
113         $(up_tangle) updvitype updvitype
114 updvitype.web: tie$(EXEEXT) dvitype.web dvitype.ch ptexdir/pdvitype.ch
115         $(tie_m) dvitype.web dvitype.ch ptexdir/pdvitype.ch
116 EXTRA_DIST += ptexdir/pdvitype.ch uptexdir/updvitype.ch
118 ## upPLtoTF
120 nodist_uppltotf_SOURCES = uppltotf.c uppltotf.h
121 uppltotf_SOURCES = uptexdir/kanji.h
122 uppltotf_CPPFLAGS = $(uptex_cppflags) -DPRESERVE_PUTC
123 uppltotf_LDADD = $(uptex_ldadd)
124 uppltotf_DEPENDENCIES = $(uptex_dependencies)
125 uppltotf.c uppltotf.h: uppltotf-web2c
126         @$(web2c) uppltotf
127 uppltotf-web2c: uppltotf.p $(web2c_depend) uptexdir/uptex.defines
128         @$(web2c) uppltotf
129 uppltotf.p: tangle$(EXEEXT) uppltotf.web uptexdir/uppltotf.ch
130         $(up_tangle) uppltotf uppltotf
131 uppltotf.web: tie$(EXEEXT) pltotf.web pltotf.ch ptexdir/ppltotf.ch
132         $(tie_m) pltotf.web pltotf.ch ptexdir/ppltotf.ch
133 EXTRA_DIST += ptexdir/ppltotf.ch uptexdir/uppltotf.ch
135 ## upTFtoPL
137 nodist_uptftopl_SOURCES = uptftopl.c uptftopl.h
138 uptftopl_SOURCES = uptexdir/kanji.h
139 uptftopl_CPPFLAGS = $(uptex_cppflags)
140 uptftopl_LDADD = $(uptex_ldadd)
141 uptftopl_DEPENDENCIES = $(uptex_dependencies)
142 uptftopl.c uptftopl.h: uptftopl-web2c
143         @$(web2c) uptftopl
144 uptftopl-web2c: uptftopl.p $(web2c_depend) uptexdir/uptex.defines
145         @$(web2c) uptftopl
146 uptftopl.p: tangle$(EXEEXT) uptftopl.web uptexdir/uptftopl.ch
147         $(up_tangle) uptftopl uptftopl
148 uptftopl.web: tie$(EXEEXT) tftopl.web tftopl.ch ptexdir/ptftopl.ch
149         $(tie_m) tftopl.web tftopl.ch ptexdir/ptftopl.ch
150 EXTRA_DIST += ptexdir/ptftopl.ch uptexdir/uptftopl.ch
153 EXTRA_DIST += \
154         uptexdir/COPYRIGHT \
155         uptexdir/COPYRIGHT.jis \
156         uptexdir/ChangeLog
158 # upTeX Tests
159 uptex_tests = uptexdir/uptriptest.test
160 uptexdir/uptriptest.log: uptex$(EXEEXT) dvitype$(EXEEXT) pltotf$(EXEEXT) tftopl$(EXEEXT)
161 upweb_tests = \
162         uptexdir/upbibtex.test \
163         uptexdir/updvitype.test \
164         uptexdir/uppltotf.test \
165         uptexdir/uptftopl.test \
166         uptexdir/yokotate.test
167 uptexdir/upbibtex.log: upbibtex$(EXEEXT)
168 uptexdir/updvitype.log: updvitype$(EXEEXT)
169 uptexdir/uppltotf.log: uppltotf$(EXEEXT)
170 uptexdir/uptftopl.log: uptftopl$(EXEEXT)
171 uptexdir/yokotate.log: uppltotf$(EXEEXT) uptftopl$(EXEEXT)
173 EXTRA_DIST += $(uptex_tests) $(upweb_tests)
174 DISTCLEANFILES += $(upweb_programs:=.c) $(upweb_programs:=.h) \
175         $(upweb_programs:=.p) $(upweb_programs:=-web2c) $(upweb_programs:=.web)
177 if UPTEX
178 TESTS += $(uptex_tests)
179 TRIPTRAP += uptrip.diffs
180 TRIPTRAP_CLEAN += uptrip-clean
181 endif UPTEX
182 if UPWEB
183 TESTS += $(upweb_tests)
184 endif UPWEB
186 ## Test data and results
188 ## uptexdir/upbibtex.test
189 DISTCLEANFILES += uptests/xexampl.aux uptests/xexampl.bbl uptests/xexampl.blg
190 ## uptexdir/updvitype.test
191 DISTCLEANFILES += uptests/xstory.dvityp uptests/xpagenum.typ
192 ## uptexdir/uppltotf.test
193 DISTCLEANFILES += uptests/xcmr10.tfm
194 ## uptexdir/uptftopl.test
195 DISTCLEANFILES += uptests/xcmr10.pl
196 ## uptexdir/yokotate.test
197 EXTRA_DIST += uptexdir/tests/min10.pl uptexdir/tests/min10.tfm
198 EXTRA_DIST += uptexdir/tests/tmin10.pl uptexdir/tests/tmin10.tfm
199 DISTCLEANFILES += uptests/x*min10.*
200 ## uptexdir/uptriptest
201 EXTRA_DIST += uptexdir/uptrip/uptrip.diffs uptexdir/uptrip/texmf.cnf
202 uptrip.diffs: uptex$(EXEEXT) dvitype$(EXEEXT) pltotf$(EXEEXT) tftopl$(EXEEXT)
203         $(triptrap_diffs) $@
204 .PHONY: uptrip-clean
205 uptrip-clean:
206         rm -rf uptripdir
208 DISTCLEANFILES += uptrip.diffs