summaryrefslogtreecommitdiff
path: root/Build/source/texk/cjkutils/Makefile.am
blob: bde0452caa0ffeec677d66095b072f48e8087d94 (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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
## $Id$
## Makefile.am for the TeX Live subdirectory texk/cjkutils/
##
## Copyright 2017 Karl Berry <tex-live@tug.org>
## Copyright 2009-2015 Peter Breitenlohner <tex-live@tug.org>
## You may freely use, modify and/or distribute this file.
##
## We want to re-distribute the whole original cjk/utils source tree.
EXTRA_DIST = $(CJKUTILS_TREE)

## Patches applied to the original source tree
EXTRA_DIST += TLpatches

# Files not to be distributed
include $(srcdir)/../../am/dist_hook.am
NEVER_NAMES += $(NEVER_NAMES_SUB)

if do_cweb
all-local: config.force hbf2gf.dvi
else !do_cweb
all-local: config.force
endif !do_cweb

config.force: $(KPATHSEA_DEPEND)
	echo timestamp >config.force
	$(SHELL) ./config.status --recheck

DISTCLEANFILES = config.force

AM_CPPFLAGS = $(KPATHSEA_INCLUDES) $(XX_CPPFLAGS)
AM_CFLAGS = $(XX_CFLAGS)

bin_PROGRAMS = \
	bg5conv \
	cefconv \
	cef5conv \
	cefsconv \
	extconv \
	sjisconv \
	hbf2gf

hbf2gf_SOURCES = \
	@CJKUTILS_TREE@/hbf2gf/hbf.c \
	@CJKUTILS_TREE@/hbf2gf/hbf.h \
	hbf2gf.c
hbf2gf_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/$(CJKUTILS_TREE)/hbf2gf -Dunix -DHAVE_LIBKPATHSEA
hbf2gf_DEPENDENCIES = $(KPATHSEA_DEPEND)
hbf2gf_LDADD = $(KPATHSEA_LIBS)

if WIN32
bin_PROGRAMS += \
	gbklatex \
	gbkpdflatex
endif WIN32

## For WIN32 we compile gbk{,pdf}latex.exe from Fabrice's cjklatex.c
## and copy them to{bg5,cef5,cef,cefs,sjis}{,pdf}latex.exe.
##
## For Unix systems we install the {bg5,cef5,cef,cefs,gbk,sjis}{,pdf}latex
## shell scripts and create symlinks bg5+{,pdf}latex -> gbk{,pdf}latex.
##
if WIN32
HOOK_DST = bg5 cef5 cef cefs sjis
else !WIN32
bin_links = gbklatex:bg5+latex gbkpdflatex:bg5+pdflatex
endif !WIN32

include $(srcdir)/../../am/bin_links.am

gbklatex_SOURCES = \
	@CJKUTILS_TREE@/cjklatex/cjklatex.c
gbklatex_DEPENDENCIES = $(KPATHSEA_DEPEND)
gbklatex_LDADD = $(KPATHSEA_LIBS)

gbkpdflatex_SOURCES = $(gbklatex_SOURCES)
gbkpdflatex_CPPFLAGS = $(AM_CPPFLAGS) -DLATEX=\"pdflatex\"
gbkpdflatex_DEPENDENCIES = $(gbklatex_DEPENDENCIES)
gbkpdflatex_LDADD = $(gbklatex_LDADD)

## Rebuild libkpathsea
@KPATHSEA_RULE@

if WIN32
bin_SCRIPTS =
install-exec-hook:
	@cd $(DESTDIR)$(bindir) && \
	  for p in latex pdflatex; do \
	    for c in $(HOOK_DST); do \
	      echo "cp gbk$$p$(EXEEXT) $$c$$p$(EXEEXT)"; \
	      rm -f $$c$$p$(EXEEXT); cp gbk$$p$(EXEEXT) $$c$$p$(EXEEXT); \
	    done; \
	  done
uninstall-hook:
	@for p in latex pdflatex; do \
	  for c in $(HOOK_DST); do \
	    echo "rm -f $(DESTDIR)$(bindir)/$$c$$p$(EXEEXT)"; \
	    rm -f $(DESTDIR)$(bindir)/$$c$$p$(EXEEXT); \
	  done; \
	done
else !WIN32
bin_SCRIPTS = \
	$(CJKUTILS_TREE)/Bg5conv/bg5latex \
	$(CJKUTILS_TREE)/Bg5conv/bg5pdflatex \
	$(CJKUTILS_TREE)/CEFconv/cef5latex \
	$(CJKUTILS_TREE)/CEFconv/cef5pdflatex \
	$(CJKUTILS_TREE)/CEFconv/ceflatex \
	$(CJKUTILS_TREE)/CEFconv/cefpdflatex \
	$(CJKUTILS_TREE)/CEFconv/cefslatex \
	$(CJKUTILS_TREE)/CEFconv/cefspdflatex \
	$(CJKUTILS_TREE)/SJISconv/sjislatex \
	$(CJKUTILS_TREE)/SJISconv/sjispdflatex \
	$(CJKUTILS_TREE)/extconv/gbklatex \
	$(CJKUTILS_TREE)/extconv/gbkpdflatex
install-exec-hook: install-bin-links
uninstall-hook: uninstall-bin-links
endif !WIN32

man1_MANS = \
	$(CJKUTILS_TREE)/Bg5conv/bg5conv.1 \
	$(CJKUTILS_TREE)/CEFconv/cef5conv.1 \
	$(CJKUTILS_TREE)/CEFconv/cefconv.1 \
	$(CJKUTILS_TREE)/CEFconv/cefsconv.1 \
	$(CJKUTILS_TREE)/SJISconv/sjisconv.1 \
	$(CJKUTILS_TREE)/extconv/extconv.1 \
	$(CJKUTILS_TREE)/hbf2gf/hbf2gf.1

hbf2gf_cfgdir = $(datarootdir)/texmf-dist/hbf2gf
CFG = $(CJKUTILS_TREE)/hbf2gf/cfg
hbf2gf_cfg_DATA = \
	$(CFG)/b5ka12.cfg \
	$(CFG)/b5kr12.cfg \
	$(CFG)/b5so12.cfg \
	$(CFG)/c1so12.cfg \
	$(CFG)/c2so12.cfg \
	$(CFG)/c3so12.cfg \
	$(CFG)/c4so12.cfg \
	$(CFG)/c5so12.cfg \
	$(CFG)/c6so12.cfg \
	$(CFG)/c7so12.cfg \
	$(CFG)/csso12.cfg \
	$(CFG)/gsfs14.cfg \
	$(CFG)/j2so12.cfg \
	$(CFG)/jsso12.cfg \
	$(CFG)/ksso17.cfg

CWEB_SRC = $(CJKUTILS_TREE)/hbf2gf/hbf2gf.w
CWEB_TEX = hbf2gf.tex hbf2gf.idx hbf2gf.scn
CWEB_DVI = hbf2gf.dvi

EXTRA_DIST += $(CWEB_TEX) $(CWEB_DVI)

CLEANFILES = hbf2gf.log hbf2gf.toc

hbf2gf.dvi: $(CWEB_TEX)
	TEXINPUTS=.:$(srcdir):$$TEXINPUTS $(TEX) hbf2gf.tex

# Running cweave in order to create hbf2gf.tex generates in addition
# hbf2gf.idx and hbf2gf.scn; we must rerun cweave when they are not
# up to date (even if hbf2gf.tex is up to date). Thus the sub-make.
#
hbf2gf.tex hbf2gf.idx hbf2gf.scn: $(CWEB_SRC)
	$(MAKE) $(AM_MAKEFLAGS) do-cweave
do-cweave: $(CWEB_SRC) .FORCE
	$(CWEAVE) +ai $<
.PHONY: do-cweave .FORCE

if do_cweb
bg5conv.c: $(CJKUTILS_TREE)/Bg5conv/bg5conv.w
	$(CTANGLE) $<
cef5conv.c: $(CJKUTILS_TREE)/CEFconv/cef5conv.w
	$(CTANGLE) $<
cefconv.c: $(CJKUTILS_TREE)/CEFconv/cefconv.w
	$(CTANGLE) $<
cefsconv.c: $(CJKUTILS_TREE)/CEFconv/cefsconv.w
	$(CTANGLE) $<
sjisconv.c: $(CJKUTILS_TREE)/SJISconv/sjisconv.w
	$(CTANGLE) $<
extconv.c: $(CJKUTILS_TREE)/extconv/extconv.w
	$(CTANGLE) $<
hbf2gf.c: $(CWEB_SRC)
	$(CTANGLE) $<
endif do_cweb

## Tests
##
TESTS = bg5conv.test cefconv.test cef5conv.test cefsconv.test extconv.test sjisconv.test
bg5conv.log: bg5conv$(EXEEXT)
cefconv.log: cefconv$(EXEEXT)
cef5conv.log: cef5conv$(EXEEXT) bg5conv$(EXEEXT) cefconv$(EXEEXT)
cefsconv.log: cefsconv$(EXEEXT) sjisconv$(EXEEXT) cefconv$(EXEEXT)
extconv.log: extconv$(EXEEXT)
sjisconv.log: sjisconv$(EXEEXT)
EXTRA_DIST += $(TESTS)

## bg5conv.test
EXTRA_DIST += tests/bg5conv.tex tests/bg5conv.cjk
DISTCLEANFILES += bg5conv.cjk
## cefconv.test
EXTRA_DIST += tests/cefconv.tex tests/cefconv.cjk
DISTCLEANFILES += cefconv.cjk
## cef5conv.test
EXTRA_DIST += tests/cef5conv.tex tests/cef5conv.cjk
DISTCLEANFILES += cef5conv.cjk
## cefsconv.test
EXTRA_DIST += tests/cefsconv.tex tests/cefsconv.cjk
DISTCLEANFILES += cefsconv.cjk
## extconv.test
EXTRA_DIST += tests/extconv.tex tests/extconv.cjk
DISTCLEANFILES += extconv.cjk
## sjisconv.test
EXTRA_DIST += tests/sjisconv.tex tests/sjisconv.cjk
DISTCLEANFILES += sjisconv.cjk