beta-0.89.2
[luatex.git] / source / texk / web2c / am / texmf.am
blob2ec67cbd27aa4e58f7845716f622217bc8fe387a
1 ## texk/web2c/am/texmf.am: Makefile fragment for TeX and MF.
2 ##
3 ## Copyright (C) 2009-2015 Peter Breitenlohner <tex-live@tug.org>
4 ## You may freely use, modify and/or distribute this file.
6 ## Common for MF and TeX
7 EXTRA_DIST += \
8         lib/mfmpi386.asm \
9         lib/mfmpw32.c \
10         lib/texmfmp.c \
11         texmfmem.h \
12         texmfmp-help.h \
13         texmfmp.h
15 ## TeX
17 if TEX
18 bin_PROGRAMS += tex
19 if WIN32
20 bin_PROGRAMS += initex
21 else !WIN32
22 bin_links += tex$(EXEEXT):initex
23 endif !WIN32
24 endif TEX
25 EXTRA_PROGRAMS += tex
27 initex_CPPFLAGS = -DEXEPROG=\"tex.exe\"
28 nodist_initex_SOURCES = callexe.c
29 initex_LDADD =
31 tex_CPPFLAGS = $(AM_CPPFLAGS)
33 # With --enable-ipc, TeX may need to link with -lsocket.
34 tex_LDADD = $(LDADD) $(ipc_socketlibs)
36 # TeX C sources
37 tex_c_h = texini.c tex0.c texcoerce.h texd.h
38 nodist_tex_SOURCES = $(tex_c_h) tex-pool.c
39 dist_tex_SOURCES = texextra.c
41 # We must create texd.h before building the tex_OBJECTS.
42 tex_prereq = texd.h
43 $(tex_OBJECTS): $(tex_prereq)
45 $(tex_c_h): tex-web2c
46         @$(web2c) tex
47 tex-web2c: tex.p $(web2c_texmf)
48         @$(web2c) tex
50 tex-pool.c: tex.pool texd.h $(makecpool_stamp)
51         $(makecpool) tex >$@ || rm -f $@
53 # Tangling TeX
54 tex.p tex.pool: tex-tangle
55         @$(texmf_tangle) tex tex-final
56 tex-tangle: tangle$(EXEEXT) tex.web tex-final.ch tangle-sh
57         @$(texmf_tangle) tex tex-final
59 # Generate tex-final.ch
60 tex-final.ch: tie$(EXEEXT) $(tex_ch_srcs)
61         $(tie_c) $(tex_ch_srcs)
62 tex_ch_srcs = \
63         tex.web \
64         tex.ch \
65         enctex.ch \
66         $(tex_ch_synctex) \
67         tex-binpool.ch
69 EXTRA_DIST += $(tex_ch_srcs)
71 DISTCLEANFILES += $(nodist_tex_SOURCES) tex-final.ch tex-web2c \
72         tex.p tex.pool tex-tangle
74 # TeX tests
76 tex_tests = triptest.test tests/write18-quote-test.pl
77 triptest.log: tex$(EXEEXT) dvitype$(EXEEXT) pltotf$(EXEEXT) tftopl$(EXEEXT)
78 tests/write18-quote-test.log: tex$(EXEEXT)
79 EXTRA_DIST += $(tex_tests)
80 EXTRA_DIST += tests/write18-quote.tex
81 if TEX
82 TESTS += $(tex_tests)
83 TRIPTRAP += trip.diffs
84 TRIPTRAP_CLEAN += trip-clean
85 endif TEX
86 DISTCLEANFILES += trip.diffs
88 ## tests/write18-quote-test.pl
89 DISTCLEANFILES += write18-quote.log
91 ## triptest
92 trip.diffs: tex$(EXEEXT) dvitype$(EXEEXT) pltotf$(EXEEXT) tftopl$(EXEEXT)
93         $(triptrap_diffs) $@
94 .PHONY: trip-clean
95 trip-clean:
96         rm -rf tripdir
98 ## Metafont
100 if MF
101 bin_PROGRAMS += mf
102 if MFN
103 bin_PROGRAMS += mf-nowin
104 endif MFN
105 if WIN32
106 noinst_PROGRAMS += call_mf
107 install_exe_links += install-mf-links
108 uninstall_exe_links += uninstall-mf-links
109 else !WIN32
110 if !MFN
111 bin_links += mf$(EXEEXT):mf-nowin
112 endif !MFN
113 bin_links += mf$(EXEEXT):inimf
114 endif !WIN32
115 endif MF
116 EXTRA_PROGRAMS += mf mf-nowin
117 DISTCLEANFILES += mftrap.diffs
119 call_mf_CPPFLAGS = -DEXEPROG=\"mf.exe\"
120 nodist_call_mf_SOURCES = callexe.c
121 call_mf_LDADD =
123 .PHONY: install-mf-links uninstall-mf-links
124 if WIN32
125 install-mf-links: call_mf$(EXEEXT)
126 if !MFN
127         $(INSTALL_PROGRAM) call_mf$(EXEEXT) $(DESTDIR)$(bindir)/mf-nowin$(EXEEXT)
128 endif !MFN
129         $(INSTALL_PROGRAM) call_mf$(EXEEXT) $(DESTDIR)$(bindir)/inimf$(EXEEXT)
130 uninstall-mf-links:
131 if !MFN
132         rm -f $(DESTDIR)$(bindir)/mf-nowin$(EXEEXT)
133 endif !MFN
134         rm -f $(DESTDIR)$(bindir)/inimf$(EXEEXT)
135 endif WIN32
137 dist_mf_SOURCES = mfextra.c
138 mf_CPPFLAGS = $(AM_CPPFLAGS) $(X_CFLAGS)
139 mf_LDADD = libmf.a $(LDADD) $(windowlib) $(mf_x_libs)
140 dist_mf_nowin_SOURCES = mfextra.c
141 mf_nowin_CPPFLAGS = $(mf_CPPFLAGS) -DMFNOWIN
142 mf_nowin_LDADD = libmf.a $(LDADD) $(windowlib)
144 # We must create mfd.h before compiling mfextra.c.
145 $(mf_OBJECTS) $(mf_nowin_OBJECTS): mfd.h
147 windowlib = window/libwindow.a
148 $(windowlib): mfd.h $(srcdir)/window/*.c
149         cd window && $(MAKE) $(AM_MAKEFLAGS) libwindow.a
150 if WIN32
151 mf_x_libs = -lgdi32
152 else !WIN32
153 # Make `#include <X11/...>' and `-lX...' work.
154 # This matches xdvik.
155 # wlibs is substituted by web2c's configure, LIBS by general configure
156 # routines, and the others by AC_PATH_XTRA.
157 # All the x_... and X_... variables will be empty if we aren't supporting X.
158 # Follow the library order used in X11R6 itself:
159 #   -lXaw -lXmu -lXt -lSM -lICE -lXext -lX11 (some may not be present).
160 mf_x_libs = $(X_LIBS) $(x_tool_libs) $(X_PRE_LIBS) $(x_ext_lib) $(wlibs) $(X_EXTRA_LIBS)
161 endif !WIN32
163 ## mf and mf-nowin compile mfextra.c with different CPPFLAGS.
164 ## Automake, however, does not support CPPFLAGS for individual source files.
165 ## To avoid compiling everything twice, the common objects are in a library.
166 EXTRA_LIBRARIES += libmf.a
168 # Metafont C sources
169 mf_c_h = mfini.c mf0.c mfcoerce.h mfd.h
170 nodist_libmf_a_SOURCES = $(mf_c_h) mf-pool.c
172 # We must create mfd.h before building the libmf_a_OBJECTS.
173 $(libmf_a_OBJECTS): mfd.h
175 $(mf_c_h): mf-web2c
176         @$(web2c) mf
177 mf-web2c: mf.p $(web2c_texmf) web2c/cvtmf1.sed web2c/cvtmf2.sed
178         @$(web2c) mf
180 mf-pool.c: mf.pool mfd.h $(makecpool_stamp)
181         $(makecpool) mf >$@ || rm -f $@
183 # Tangling Metafont
184 mf.p mf.pool: mf-tangle
185         @$(texmf_tangle) mf mf-final
186 mf-tangle: tangle$(EXEEXT) mf.web mf-final.ch tangle-sh
187         @$(texmf_tangle) mf mf-final
189 # Generate mf-final.ch
190 mf-final.ch: tie$(EXEEXT) $(mf_ch_src)
191         $(tie_c) $(mf_ch_src)
192 mf_ch_src = \
193         mf.web \
194         mf.ch \
195         mf-binpool.ch
197 EXTRA_DIST += $(mf_ch_src)
199 DISTCLEANFILES += $(nodist_libmf_a_SOURCES) mf-final.ch mf-web2c \
200         mf.p mf.pool mf-tangle
202 # Metafont tests
204 mf_tests = mftraptest.test
205 mftraptest.log: mf$(EXEEXT) gftype$(EXEEXT) tftopl$(EXEEXT)
206 EXTRA_DIST += $(mf_tests)
207 if MF
208 TESTS += $(mf_tests)
209 TRIPTRAP += mftrap.diffs
210 TRIPTRAP_CLEAN += trap-clean
211 endif MF
213 ## mftraptest
214 mftrap.diffs: mf$(EXEEXT) gftype$(EXEEXT) tftopl$(EXEEXT)
215         $(triptrap_diffs) $@
216 .PHONY: trap-clean
217 trap-clean:
218         rm -rf trapdir
220 ## Test data
222 EXTRA_DIST += \
223         triptrap/README \
224         triptrap/mftrap.diffs \
225         triptrap/mftrap.fot \
226         triptrap/mftrap.log \
227         triptrap/mftrap.pl \
228         triptrap/mftrap1.in \
229         triptrap/mftrap2.in \
230         triptrap/mftrapin.log \
231         triptrap/mptrap.diffs \
232         triptrap/mptrap.fot \
233         triptrap/mptrap.log \
234         triptrap/mptrap.pl \
235         triptrap/mptrap.readme \
236         triptrap/mptrap1.in \
237         triptrap/mptrap2.in \
238         triptrap/mptrapin.log \
239         triptrap/mtrap.0 \
240         triptrap/mtrap.1 \
241         triptrap/mtrap.log \
242         triptrap/mtrap.mp \
243         triptrap/texmf.cnf \
244         triptrap/trap.148 \
245         triptrap/trap.149 \
246         triptrap/trap.150 \
247         triptrap/trap.151 \
248         triptrap/trap.197 \
249         triptrap/trap.200 \
250         triptrap/trap.5 \
251         triptrap/trap.6 \
252         triptrap/trap.mf \
253         triptrap/trap.mp \
254         triptrap/trap.mpx \
255         triptrap/trap.typ \
256         triptrap/trapf.pl \
257         triptrap/trapman.tex \
258         triptrap/trip.diffs \
259         triptrap/trip.fot \
260         triptrap/trip.log \
261         triptrap/trip.pl \
262         triptrap/trip.tex \
263         triptrap/trip.typ \
264         triptrap/trip1.in \
265         triptrap/trip2.in \
266         triptrap/tripin.log \
267         triptrap/tripman.tex \
268         triptrap/tripos.tex \
269         triptrap/writeo \
270         triptrap/writeo.2