1 ## texk/web2c/mfluadir/am/mflua.am: Makefile fragment for MFLua.
3 ## Copyright (C) 2015 Peter Breitenlohner <tex-live@tug.org>
4 ## You may freely use, modify and/or distribute this file.
11 bin_PROGRAMS += mflua-nowin
14 noinst_PROGRAMS += call_mflua
15 install_exe_links += install-mflua-links
16 uninstall_exe_links += uninstall-mflua-links
19 bin_links += mflua$(EXEEXT):mflua-nowin
21 bin_links += mflua$(EXEEXT):inimflua
24 EXTRA_PROGRAMS += mflua mflua-nowin
25 DISTCLEANFILES += mfluatrap.diffs
27 call_mflua_CPPFLAGS = -DEXEPROG=\"mflua.exe\"
28 nodist_call_mflua_SOURCES = callexe.c
31 .PHONY: install-mflua-links uninstall-mflua-links
33 install-mflua-links: call_mflua$(EXEEXT)
35 $(INSTALL_PROGRAM) call_mflua$(EXEEXT) $(DESTDIR)$(bindir)/mflua-nowin$(EXEEXT)
37 $(INSTALL_PROGRAM) call_mflua$(EXEEXT) $(DESTDIR)$(bindir)/inimflua$(EXEEXT)
38 uninstall-mflua-links:
40 rm -f $(DESTDIR)$(bindir)/mflua-nowin$(EXEEXT)
42 rm -f $(DESTDIR)$(bindir)/inimflua$(EXEEXT)
45 dist_mflua_SOURCES = mfluadir/mfluaextra.c mfluadir/mfluaextra.h mfluadir/mflua_version.h
46 mflua_CPPFLAGS = $(AM_CPPFLAGS) $(X_CFLAGS) $(LUA_INCLUDES)
47 mflua_LDADD = libmflua.a $(LDADD) $(windowlib) $(mf_x_libs) $(LUA_LIBS)
48 mflua_LDFLAGS = -export-dynamic
49 nodist_mflua_nowin_SOURCES = $(dist_mflua_SOURCES)
50 mflua_nowin_CPPFLAGS = $(mflua_CPPFLAGS) -DMFNOWIN $(LUA_INCLUDES)
51 mflua_nowin_LDADD = libmflua.a $(LDADD) $(windowlib) $(LUA_LIBS)
52 mflua_nowin_LDFLAGS = -export-dynamic
54 # We must create mfluad.h and mfluadir/mflua_version.h before compiling mfluaextra.c.
55 $(mflua_OBJECTS) $(mflua_nowin_OBJECTS): mfluad.h mfluadir/mflua_version.h
57 ## mflua and mflua-nowin compile mfluaextra.c with different CPPFLAGS.
58 ## Automake, however, does not support CPPFLAGS for individual source files.
59 ## To avoid compiling everything twice, the common objects are in a library.
60 EXTRA_LIBRARIES += libmflua.a
63 mflua_c_h = mfluaini.c mflua0.c mfluacoerce.h mfluad.h
64 dist_libmflua_a_SOURCES = luatexdir/lua/lkpselib.c mfluadir/mfluac.c mfluadir/mfluac.h
65 nodist_libmflua_a_SOURCES = $(mflua_c_h) mflua-pool.c
66 libmflua_a_CPPFLAGS = $(AM_CPPFLAGS) $(LUA_INCLUDES) -DMF_LUA
68 # We must create mfluad.h before building the libmflua_a_OBJECTS.
69 $(libmflua_a_OBJECTS): mfluad.h
71 $(mflua_c_h): mflua-web2c
73 mflua-web2c: mflua.p $(web2c_texmf) web2c/cvtmf1.sed web2c/cvtmf2.sed mfluadir/mflua.defines $(LUA_DEPEND)
76 mflua-pool.c: mflua.pool mfluad.h $(makecpool_stamp)
77 $(makecpool) mflua >$@ || rm -f $@
80 mflua.p mflua.pool: mflua-tangle
81 @$(texmf_tangle) mflua mflua
82 mflua-tangle: tangle$(EXEEXT) mflua.web mflua.ch tangle-sh
83 @$(texmf_tangle) mflua mflua
85 # Extract mflua version
86 $(srcdir)/mfluadir/mflua_version.h: @MAINTAINER_MODE_TRUE@ mfluadir/mf-lua.ch
87 $(AM_V_GEN)grep '^@d MFLua_version_string==' $(srcdir)/mfluadir/mf-lua.ch \
88 | sed "s/^.*'-/#define MFLUA_VERSION \"/;s/'.*$$/\"/" >$@
91 mflua.web: tie$(EXEEXT) $(mflua_web_srcs)
92 $(tie_m) $(mflua_web_srcs)
98 mflua.ch: tie$(EXEEXT) mflua.web $(mflua_ch_src)
99 $(tie_c) mflua.web $(mflua_ch_src)
102 mfluadir/mflua-m.ch \
105 EXTRA_DIST += $(mflua_web_srcs) $(mflua_ch_src) mfluadir/mflua.defines
107 DISTCLEANFILES += $(nodist_libmflua_a_SOURCES) mflua.web mflua.ch mflua-web2c \
108 mflua.p mflua.pool mflua-tangle
115 mflua_tests = mfluadir/mfluatraptest.test
116 mfluadir/mfluatraptest.log: mflua$(EXEEXT) gftype$(EXEEXT) tftopl$(EXEEXT)
117 EXTRA_DIST += $(mflua_tests)
120 TESTS += $(mflua_tests)
121 TRIPTRAP += mfluatrap.diffs
122 TRIPTRAP_CLEAN += mfluatrap-clean
124 DISTCLEANFILES += mfluatrap.diffs
126 ## mfluadir/mfluatraptest
127 mfluatrap.diffs: mflua$(EXEEXT) gftype$(EXEEXT) tftopl$(EXEEXT)
129 .PHONY: mfluatrap-clean
136 mfluadir/mfluatrap/begin_program.lua \
137 mfluadir/mfluatrap/do_add_to.lua \
138 mfluadir/mfluatrap/end_program.lua \
139 mfluadir/mfluatrap/fill_envelope.lua \
140 mfluadir/mfluatrap/fill_spec.lua \
141 mfluadir/mfluatrap/final_cleanup.lua \
142 mfluadir/mfluatrap/main_control.lua \
143 mfluadir/mfluatrap/make_ellipse.lua \
144 mfluadir/mfluatrap/mfluaini.lua \
145 mfluadir/mfluatrap/offset_prep.lua \
146 mfluadir/mfluatrap/print_edges.lua \
147 mfluadir/mfluatrap/print_path.lua \
148 mfluadir/mfluatrap/scan_direction.lua \
149 mfluadir/mfluatrap/skew_line_edges.lua \
150 mfluadir/mfluatrap/start_of_MF.lua \
151 mfluadir/mfluatrap/texmf.cnf \
152 mfluadir/mfluatrap/mfluatrap.diffs