##
## This is part of CLFSja package.
##
BOOKdir = @abs_bookdir@/stylesheets/lfs-xsl/docbook-xsl-snapshot/common
CHANGE_FILES_XSL = \
	common.ch     \
	gentext.ch    \
	insertfile.ch \
	labels.ch     \
	olink.ch      \
	pi.ch         \
	refentry.ch   \
	stripns.ch    \
	subtitles.ch  \
	table.ch      \
	targets.ch    \
	titles.ch     \
	utility.ch

CHANGE_FILES_OTHER = \
	l10n_xsl.ch \
	l10n_xml.ch

COPY_FILES = \
	de.xml    \
	en.xml    \
	es.xml    \
	fr.xml    \
	it.xml    \
	zh_cn.xml \
	zh_tw.xml \
	l10n.dtd  \
	entities.ent \
	targetdatabase.dtd

EXTRA_DIST = $(CHANGE_FILES_XSL) $(CHANGE_FILES_OTHER) ja.xml
srcdir = @srcdir@
srcs = $(CHANGE_FILES_XSL:.ch=.xsl) l10n.xsl l10n.xml $(COPY_FILES) ja.xml

SUFFIXES = .ch .xsl
.ch.xsl:
	$(top_builddir)/$(CTIE) -m $@ $(BOOKdir)/$@ $(srcdir)/$*.ch >/dev/null

all: ctie $(srcs)

ctie:
	@$(MAKE) -C $(top_builddir)/$@ $@ >/dev/null

#l10n.xsl:   $(BOOKdir)/$@ $(srcdir)/l10n_xsl.ch
#	$(top_builddir)/$(CTIE) -m $@ $^
l10n.xsl:   $(BOOKdir)/$@
	cp -p $(BOOKdir)/$@ $@
l10n.xml:   $(BOOKdir)/l10n.xml $(srcdir)/l10n_xml.ch
	$(top_builddir)/$(CTIE) -m $@ $^ >/dev/null

de.xml:    $(BOOKdir)/$@
	cp -p $(BOOKdir)/$@ $@
en.xml:    $(BOOKdir)/$@
	cp -p $(BOOKdir)/$@ $@
es.xml:    $(BOOKdir)/$@
	cp -p $(BOOKdir)/$@ $@
fr.xml:    $(BOOKdir)/$@
	cp -p $(BOOKdir)/$@ $@
it.xml:    $(BOOKdir)/$@
	cp -p $(BOOKdir)/$@ $@
zh_cn.xml: $(BOOKdir)/$@
	cp -p $(BOOKdir)/$@ $@
zh_tw.xml: $(BOOKdir)/$@
	cp -p $(BOOKdir)/$@ $@
l10n.dtd:  $(BOOKdir)/$@
	cp -p $(BOOKdir)/$@ $@
entities.ent: $(BOOKdir)/$@
	cp -p $(BOOKdir)/$@ $@
targetdatabase.dtd: $(BOOKdir)/$@
	cp -p $(BOOKdir)/$@ $@

ja.xml: $(srcdir)/$@
	cp -p $(srcdir)/$@ $@
