summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/luatexdir/am/luatex.am
blob: d26b6975a10d8d9a4d094cdd3a0511c7536206dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
## texk/web2c/luatexdir/am/luatex.am: Makefile fragment for luaTeX.
##
## Copyright (C) 2009 Peter Breitenlohner <tex-live@tug.org>
## You may freely use, modify and/or distribute this file.

## luaTeX
##
if LUATEX
bin_PROGRAMS += luatex
endif LUATEX
EXTRA_PROGRAMS += luatex

# Force Automake to use CXXLD for linking
nodist_EXTRA_luatex_SOURCES = dummy.cxx

luatex_tangle = WEBINPUTS=$(srcdir)/luatexdir $(SHELL) ./tangle-sh $@ '$(LUATANGLE) --underlines'

luatex_CPPFLAGS = $(ZLIB_INCLUDES) $(LIBPNG_INCLUDES) $(XPDF_INCLUDES)
luatex_CPPFLAGS += $(OBSDCOMPAT_INCLUDES) -I$(srcdir)/libmd5
luatex_CPPFLAGS += -Iluatexdir -I$(srcdir)/luatexdir -I$(srcdir)/luatexdir/lua51 -I$(srcdir)/mplibdir
luatex_CPPFLAGS += -Dextra_version_info=`date +-%Y%m%d%H`
luatex_CFLAGS = # $(WARNING_CFLAGS)
luatex_CXXFLAGS = # $(WARNING_CXXFLAGS)

luatex_ldadd = libluatex.a libff.a libluamisc.a libzzip.a libluasocket.a liblua51.a
luatex_ldadd += $(LIBPNG_LIBS) $(ZLIB_LIBS) $(XPDF_LIBS)
luatex_ldadd += $(OBSDCOMPAT_LIBS) libmd5.a libmplib.a

luatex_LDADD = $(luatex_ldadd) $(LDADD) $(lua_socketlibs)

luatex_DEPENDENCIES = $(proglib) $(KPATHSEA_DEPEND) libluatex.a
luatex_DEPENDENCIES += $(LIBPNG_DEPEND) $(ZLIB_DEPEND) $(XPDF_DEPEND)
luatex_DEPENDENCIES += $(OBSDCOMPAT_DEPEND) libmd5.a libmplib.a

# We must create libluatex.a and libmplib.a before building the etex_OBJECTS.
$(luatex_OBJECTS): libluatex.a libmplib.a

luatex_c_h = luatexini.c luatex0.c luatexcoerce.h luatexd.h
nodist_luatex_SOURCES = $(luatex_c_h) luatex-pool.c luatexextra.c luatexdir/luatexextra.h
$(luatex_c_h): luatex-web2c
	@$(web2c) luatex
luatex-web2c: luatex.p $(web2c_texmf) luatexdir/luatex.defines
	@$(web2c) luatex
luatexextra.c: luatexd.h luatexdir/luatexextra.h lib/texmfmp.c
	sed s/TEX-OR-MF-OR-MP/luatex/ $(srcdir)/lib/texmfmp.c >$@
luatex_sources = luatexdir/luatex.web luatexdir/luatex.ch
luatex.p luatex.pool: luatex-tangle
	@$(luatex_tangle) luatex luatex
luatex-tangle: luatangle$(EXEEXT) $(luatex_sources) tangle-sh
	@$(luatex_tangle) luatex luatex
luatex-pool.c: luatex.pool luatexd.h $(makecpool_stamp)
	$(makecpool) luatex >$@ || rm -f $@
# Extract luatex version
luatexdir/luatex.version: luatexdir/luatex.web
	$(MKDIR_P) luatexdir
	grep '^@d luatex_version_string==' $(srcdir)/luatexdir/luatex.web \
	  | sed "s/^.*=='//;s/'.*$$//" >luatexdir/luatex.version
luatexdir/luatexextra.h: luatexdir/luatexextra.in luatexdir/luatex.version
	sed -e s/LUATEX-VERSION/`cat luatexdir/luatex.version`/ \
	  $(srcdir)/luatexdir/luatexextra.in >$@

# Double-colon rules since we do something similar in mplibdir (maybe others).
if LUATEX
install-exec-hook::
	cd $(DESTDIR)$(bindir) && rm -f texlua$(EXEEXT) \
	  && $(LN_S) luatex$(EXEEXT) texlua$(EXEEXT)
	cd $(DESTDIR)$(bindir) && rm -f texluac$(EXEEXT) \
	  && $(LN_S) luatex$(EXEEXT) texluac$(EXEEXT)
uninstall-hook::
	rm -f $(DESTDIR)$(bindir)/texlua$(EXEEXT)
	rm -f $(DESTDIR)$(bindir)/texluac$(EXEEXT)
endif LUATEX

EXTRA_DIST += $(luatex_sources) \
	luatexdir/luatex.defines \
	luatexdir/luatexextra.in \
	luatexdir/ptexlib.h

DISTCLEANFILES += $(nodist_luatex_SOURCES) luatex-web2c \
	luatex.p luatex.pool luatex-tangle luatexdir/luatex.version

## Eventually delete these files
##
EXTRA_DIST += luatexdir/luatex.mk