summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/uptexdir/am/uptex.am
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/web2c/uptexdir/am/uptex.am')
-rw-r--r--Build/source/texk/web2c/uptexdir/am/uptex.am86
1 files changed, 86 insertions, 0 deletions
diff --git a/Build/source/texk/web2c/uptexdir/am/uptex.am b/Build/source/texk/web2c/uptexdir/am/uptex.am
new file mode 100644
index 00000000000..b231964f896
--- /dev/null
+++ b/Build/source/texk/web2c/uptexdir/am/uptex.am
@@ -0,0 +1,86 @@
+## texk/web2c/uptexdir/am/uptex.am: Makefile fragment for upTeX.
+##
+## Copyright (C) 2011 Peter Breitenlohner <tex-live@tug.org>
+## You may freely use, modify and/or distribute this file.
+
+uptex_cppflags = $(PTEXENC_INCLUDES) $(AM_CPPFLAGS)
+
+## libukanji.a for upTeX and e-upTeX
+##
+EXTRA_LIBRARIES += libukanji.a
+libukanji_a_SOURCES = uptexdir/kanji.c uptexdir/kanji.h
+libukanji_a_CPPFLAGS = $(uptex_cppflags)
+
+## upTeX
+##
+if UPTEX
+bin_PROGRAMS += uptex
+endif UPTEX
+EXTRA_PROGRAMS += uptex
+
+uptex_CPPFLAGS = $(uptex_cppflags)
+
+# With --enable-ipc, upTeX may need to link with -lsocket.
+uptex_LDADD = libukanji.a $(pproglib) $(PTEXENC_LIBS) $(LDADD) $(ipc_socketlibs)
+
+# upTeX C sources
+uptex_c_h = uptexini.c uptex0.c uptexcoerce.h uptexd.h
+nodist_uptex_SOURCES = $(uptex_c_h) uptex-pool.c uptexdir/ptex_version.h uptexdir/uptex_version.h
+dist_uptex_SOURCES = uptexdir/uptexextra.c uptexdir/uptexextra.h
+
+# We must create uptexd.h and uptexdir/*ptex_version.h before building the uptex_OBJECTS.
+uptex_prereq = uptexd.h uptexdir/ptex_version.h uptexdir/uptex_version.h
+$(uptex_OBJECTS): $(uptex_prereq)
+
+$(uptex_c_h): uptex-web2c
+ @$(web2c) uptex
+uptex-web2c: uptex.p $(web2c_texmf) uptexdir/uptex.defines
+ @$(web2c) uptex
+
+uptex-pool.c: uptex.pool uptexd.h $(makecpool_stamp)
+ $(makecpool) uptex >$@ || rm -f $@
+
+# Tangling upTeX
+uptex.p uptex.pool: uptex-tangle
+ @$(texmf_tangle) uptex uptex
+uptex-tangle: tangle$(EXEEXT) uptex.web uptex.ch tangle-sh
+ @$(texmf_tangle) uptex uptex
+
+# Extract ptex version
+uptexdir/ptex_version.h: ptexdir/ptex-base.ch
+ $(MKDIR_P) uptexdir
+ grep '^@d pTeX_version_string==' $(srcdir)/ptexdir/ptex-base.ch \
+ | sed "s/^.*'-/#define PTEX_VERSION \"/;s/'.*$$/\"/" >$@
+
+# Extract uptex version
+uptexdir/uptex_version.h: uptexdir/uptex-m.ch
+ $(MKDIR_P) uptexdir
+ grep '^@d upTeX_version_string==' $(srcdir)/uptexdir/uptex-m.ch \
+ | sed "s/^.*'-/#define UPTEX_VERSION \"/;s/'.*$$/\"/" >$@
+
+# Generate uptex.web
+uptex.web: tie$(EXEEXT) $(uptex_web_srcs)
+ $(tie) -m uptex.web $(uptex_web_srcs)
+uptex_web_srcs = \
+ tex.web \
+ tex.ch
+
+# Generate uptex.ch
+uptex.ch: tie$(EXEEXT) uptex.web $(uptex_ch_srcs)
+ $(tie) -c uptex.ch uptex.web $(uptex_ch_srcs)
+uptex_ch_srcs = \
+ ptexdir/ptex-base.ch \
+ uptexdir/uptex-m.ch \
+ $(uptex_ch_synctex) \
+ tex-binpool.ch
+
+EXTRA_DIST += $(uptex_web_srcs) $(uptex_ch_srcs) uptexdir/uptex.defines
+
+DISTCLEANFILES += $(nodist_uptex_SOURCES) uptex.web uptex.ch uptex-web2c \
+ uptex.p uptex.pool uptex-tangle
+
+## =============
+
+upTeX.w: uptex.p
+ $(tie) -m upTeX.w uptex.web uptex.ch
+