summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/uptexdir/am/uptex.am
blob: b231964f896acbe53b9c839825a4a9e292f9e414 (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
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