Last active
March 30, 2016 10:36
-
-
Save aminophen/49a8ed558cda969f1e20 to your computer and use it in GitHub Desktop.
ptex-texmf の source/platex/base の Makefile のたたき台
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SRCDIR = source/platex/base | |
TEXDIR = tex/platex/base | |
DOCDIR = doc/platex/base | |
TARGET1 = platex.ltx jarticle.cls jarticle.sty nidanfloat.sty | |
TARGET2 = platex.pdf pldoc.pdf | |
all: $(addprefix $(TEXDIR)/,$(TARGET1)) \ | |
$(addprefix $(DOCDIR)/,$(TARGET2)) | |
PLFMT = platex.ltx plcore.ltx kinsoku.tex pldefs.ltx \ | |
jy1mc.fd jy1gt.fd jt1mc.fd jt1gt.fd plext.sty ptrace.sty | |
PLFMT_SRC = platex.dtx plvers.dtx plfonts.dtx plcore.dtx \ | |
kinsoku.dtx plext.dtx | |
PLCLS = jarticle.cls jreport.cls jbook.cls jsize10.clo \ | |
jsize11.clo jsize12.clo jbk10.clo jbk11.clo jbk12.clo \ | |
tarticle.cls treport.cls tbook.cls tsize10.clo \ | |
tsize11.clo tsize12.clo tbk10.clo tbk11.clo tbk12.clo | |
PLCLS_SRC = jclasses.dtx | |
PL209 = pl209.def oldpfont.sty jarticle.sty tarticle.sty \ | |
jbook.sty tbook.sty jreport.sty treport.sty | |
PL209_SRC = pl209.dtx | |
NIDAN = nidanfloat.sty | |
NIDAN_SRC = nidanfloat.dtx | |
INTRO_SRC = platex.dtx | |
DOC_SRC = platex.dtx plvers.dtx plfonts.dtx plcore.dtx plext.dtx \ | |
pl209.dtx kinsoku.dtx jclasses.dtx jltxdoc.dtx | |
$(TEXDIR)/platex.ltx: $(addprefix $(SRCDIR)/,$(PLFMT_SRC)) | |
cd $(SRCDIR); $(MAKE) platex.ltx | |
for x in $(PLFMT); do mv $(SRCDIR)/$$x $(TEXDIR); done | |
$(TEXDIR)/jarticle.cls: $(addprefix $(SRCDIR)/,$(PLCLS_SRC)) | |
cd $(SRCDIR); $(MAKE) jarticle.cls | |
for x in $(PLCLS); do mv $(SRCDIR)/$$x $(TEXDIR); done | |
$(TEXDIR)/jarticle.sty: $(addprefix $(SRCDIR)/,$(PL209_SRC)) | |
cd $(SRCDIR); $(MAKE) jarticle.sty | |
for x in $(PL209); do mv $(SRCDIR)/$$x $(TEXDIR); done | |
$(TEXDIR)/nidanfloat.sty: $(addprefix $(SRCDIR)/,$(NIDAN_SRC)) | |
cd $(SRCDIR); $(MAKE) nidanfloat.sty | |
for x in $(NIDAN); do mv $(SRCDIR)/$$x $(TEXDIR); done | |
$(DOCDIR)/platex.pdf: $(addprefix $(SRCDIR)/,$(INTRO_SRC)) | |
cd $(SRCDIR); $(MAKE) platex.pdf | |
mv $(SRCDIR)/platex.pdf $(DOCDIR) | |
$(DOCDIR)/pldoc.pdf: $(addprefix $(SRCDIR)/,$(DOC_SRC)) | |
cd $(SRCDIR); $(MAKE) pldoc.pdf | |
mv $(SRCDIR)/pldoc.pdf $(DOCDIR) | |
mv $(SRCDIR)/jltxdoc.cls $(TEXDIR) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
all: platex.ltx jarticle.cls jarticle.sty nidanfloat.sty \ | |
platex.pdf pldoc.pdf | |
.PHONY: $(TARGET1) $(TARGET2) | |
platex.ltx: | |
platex --kanji=jis plfmt.ins | |
rm plfmt.log | |
jarticle.cls: | |
platex --kanji=jis plcls.ins | |
rm plcls.log | |
jarticle.sty: | |
platex --kanji=jis pl209.ins | |
rm pl209.log | |
nidanfloat.sty: | |
platex --kanji=jis nidanfloat.ins | |
rm nidanfloat.log | |
platex.pdf: | |
platex --kanji=jis platex.dtx && \ | |
platex --kanji=jis platex.dtx && \ | |
dvipdfmx platex.dvi | |
rm platex.aux platex.log platex.dvi | |
pldoc.pdf: | |
for x in jltxdoc.cls pldoc.tex Xins.ins; do \ | |
if [ -e $$x ]; then rm $$x; fi \ | |
done | |
platex --kanji=jis pldocs.ins && \ | |
platex --kanji=jis Xins.ins && sh mkpldoc.sh && \ | |
dvipdfmx pldoc.dvi | |
rm *.aux *.log pldoc.toc pldoc.idx pldoc.ind pldoc.ilg | |
rm pldoc.glo pldoc.gls *.dvi | |
rm *.cfg pldoc.dic mkpldoc.sh dstcheck.pl |
source/platex/base がすべて UTF-8 with BOM なら,--kanji=jis をすべて --kanji=utf8 に
without BOM もですね。文字コード変換は
PLFMT = platex.ltx plcore.ltx kinsoku.tex pldefs.ltx \\
jy1mc.fd jy1gt.fd jt1mc.fd jt1gt.fd plext.sty ptrace.sty
platex.ltx: platex.dtx plvers.dtx plfonts.dtx plcore.dtx kinsoku.dtx plext.dtx
platex --kanji=jis plfmt.ins
for x in $(PLFMT); do iconv …(略)… ; done
のような感じで書くのでしょうか。
without BOM もですね。
ありがとうございます。たしかにその通りですね。しかし,流れでいくと ISO-2022-JP と UTF-8 with BOM の二択になると思っています。私自身は「全ファイル ISO-2022-JP」にまわっているので,その場合は文字コード変換自体が不要になります。
Makefile-20160127.0 に更新しました。「A」をトップ(README.md や LICENSE がある場所)に,「B」を source/platex/base に置いたうえで(両方とも Makefile にリネームする必要があります),トップで make します。成功すれば必要な全ファイルが生成して適切に配置され,一時ファイルはすべて削除されます。
ちなみに source/platex/base で make すると正常終了しますが,ソースファイルの変更を検知しなくなります(ターゲットの有無だけで判断)。また,一時ファイル削除は行われますが,ファイルの再配置は行いません。
追記:ptex-texmf リポジトリに f6ced1f としてコミット。さらに ce0d9ad で clean を追加。これに伴い,本 gist での更新は終了。
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
source/platex/base にこの Makefile (Makefile-20160123.1) を置いて,そのディレクトリ内で make します。source/platex/base を ISO-2022-JP にするか UTF-8 にするかで異なるかもしれません。
--kanji=jis
をすべて--kanji=utf8
に置き換えたほうが適切かもしれません。さらに,生成したファイルの文字コード変換も必要。一時ファイルの削除や TEXMF tree への適切な配置はまだ全然試していませんが,必要なファイルをすべて作ることはできています。ちなみに plcore.ins だけは活用されていません… あと,plpatch.ltx も現時点では機能がないので外してあります。