summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/source/platex/jsclasses/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Master/texmf-dist/source/platex/jsclasses/Makefile')
-rw-r--r--Master/texmf-dist/source/platex/jsclasses/Makefile44
1 files changed, 36 insertions, 8 deletions
diff --git a/Master/texmf-dist/source/platex/jsclasses/Makefile b/Master/texmf-dist/source/platex/jsclasses/Makefile
index ba42ad672cb..123eb2153fe 100644
--- a/Master/texmf-dist/source/platex/jsclasses/Makefile
+++ b/Master/texmf-dist/source/platex/jsclasses/Makefile
@@ -1,7 +1,7 @@
STRIPTARGET = jsarticle.cls jslogo.sty okumacro.sty jsverb.sty okuverb.sty morisawa.sty
PDFTARGET = jsclasses.pdf jslogo.pdf okumacro.pdf jsverb.pdf okuverb.pdf morisawa.pdf
DVITARGET = jsclasses.dvi jslogo.dvi okumacro.dvi jsverb.dvi okuverb.dvi morisawa.dvi
-KANJI = -kanji=jis
+KANJI = -kanji=utf8
FONTMAP = -f ipaex.map -f ptex-ipaex.map
TEXMF = $(shell kpsewhich -var-value=TEXMFHOME)
@@ -9,23 +9,27 @@ default: $(STRIPTARGET) $(DVITARGET)
strip: $(STRIPTARGET)
all: $(STRIPTARGET) $(PDFTARGET)
+JSCLASSES = jsarticle.cls jsbook.cls jsreport.cls jspf.cls kiyou.cls
+
+# for generating files, we use pdflatex incidentally.
+# otherwise, ptexenc might convert U+2212 -> U+FF0D in okumacro.sty
jsarticle.cls: jsclasses.dtx
- platex $(KANJI) jsclasses.ins
+ pdflatex jsclasses.ins
jslogo.sty: jslogo.dtx
- platex $(KANJI) jslogo.ins
+ pdflatex jslogo.ins
okumacro.sty: okumacro.dtx
- platex $(KANJI) okumacro.ins
+ pdflatex okumacro.ins
jsverb.sty: jsverb.dtx
- platex $(KANJI) jsverb.ins
+ pdflatex jsverb.ins
okuverb.sty: okuverb.dtx
- platex $(KANJI) okuverb.ins
+ pdflatex okuverb.ins
morisawa.sty: morisawa.dtx
- platex $(KANJI) morisawa.ins
+ pdflatex morisawa.ins
.SUFFIXES: .dtx .dvi .pdf
.dtx.dvi:
@@ -34,7 +38,7 @@ morisawa.sty: morisawa.dtx
.dvi.pdf:
dvipdfmx $(FONTMAP) $<
-.PHONY: install clean cleanstrip cleanall cleandoc
+.PHONY: install clean cleanstrip cleanall cleandoc jisfile
install:
mkdir -p ${TEXMF}/doc/platex/jsclasses
cp ./LICENSE ${TEXMF}/doc/platex/jsclasses/
@@ -60,3 +64,27 @@ cleanall:
$(DVITARGET) $(PDFTARGET)
cleandoc:
rm -f $(DVITARGET) $(PDFTARGET)
+jisfile:
+ mkdir -p jis0
+ cp *.{dtx,ins,cls,sty} jis0/
+ # GNU iconv can be used to convert UTF-8 -> ISO-2022-JP
+ for x in jis0/*; do \
+ if [ -f "$$x" ]; then \
+ iconv -f UTF-8 -t ISO-2022-JP "$$x" >"$$x.conv"; \
+ mv "$$x.conv" "$$x"; \
+ fi \
+ done
+ # jsclasses and okumacro contain non-ASCII chars also in stripped files
+ for x in $(addprefix jis0/,$(JSCLASSES) jsclasses.dtx okumacro.dtx okumacro.sty); do \
+ perl -pi.bak -0777 -e 's/(%\n)?\\ifx\\epTeXinputencoding\\undefined.*?\n\\fi\n(%\n)?//s' $$x; \
+ rm -f $$x.bak; \
+ done
+ # others have no non-ASCII chars in stripped files
+ for x in $(addprefix jis0/,$(wildcard *.dtx)); do \
+ perl -pi.bak -0777 -e 's/(%\n)?% \\ifx\\epTeXinputencoding\\undefined.*?\n% \\fi\n(%\n)?//s' $$x; \
+ perl -pi.bak -0777 -e 's/(%\n)?%<\*driver>\n\\ifx\\epTeXinputencoding\\undefined.*?\n\\fi\n%<\/driver>\n//s' $$x; \
+ rm -f $$x.bak; \
+ done
+ rm -f jis/*.{dtx,ins,cls,sty}
+ mv jis0/* jis/
+ rmdir jis0