-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathMakefile
More file actions
86 lines (64 loc) · 2.04 KB
/
Copy pathMakefile
File metadata and controls
86 lines (64 loc) · 2.04 KB
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
# -*- coding: utf-8; -*-
# サンプルファイル等をコンパイルして PDF を生成します
.PHONY: all clean dist-clean sample debug figure platex uplatex figure-clean
# 使用するコマンド類の定義
LLMK = llmk
LILYPOND = lilypond # 図を生成したいときのみ使用
RM = rm -f
SED = sed
# サンプルに生成する PDF
SAMPLEPDFS = sample.pdf sample2.pdf
# デバッグ用に生成する PDF
DEBUGPDFS = debug.pdf
# 図用に生成する PDF
FIGUREPDFS = invention1.pdf
# 図は `make all` では生成せず、配布ファイル中にある PDF をそのまま使う
# 図をソースファイルから生成したければ事前に `make figure` する
all: sample debug
# LuaLaTeX で生成する PDF
LUALATEXPDFS = $(SAMPLEPDFS) $(DEBUGPDFS)
# pLaTeX で生成する PDF
PLATEXPDFS = $(LUALATEXPDFS:.pdf=.platex.pdf)
# upLaTeX で生成する PDF
UPLATEXPDFS = $(LUALATEXPDFS:.pdf=.uplatex.pdf)
# 生成した TeX ソースから生成する PDF
GENPDFS = $(PLATEXPDFS) $(UPLATEXPDFS)
clean:
$(RM) *~
$(LLMK) --clean $(LUALATEXPDFS:.pdf=.tex)
for filename in $(GENPDFS:.pdf=.tex);\
do \
if [ -e "$$filename" ]; then \
$(LLMK) --clean "$$filename"; \
fi; \
done
dist-clean: clean
$(LLMK) --clobber $(LUALATEXPDFS:.pdf=.tex)
for filename in $(GENPDFS:.pdf=.tex);\
do \
if [ -e "$$filename" ]; then \
$(LLMK) --clobber "$$filename"; \
fi; \
done
$(RM) $(GENPDFS:.pdf=.tex)
figure-clean:
$(RM) $(FIGUREPDFS)
sample: $(SAMPLEPDFS)
debug: $(DEBUGPDFS)
figure: $(FIGUREPDFS)
platex: $(PLATEXPDFS) $(PLATEXPDFS:.pdf=.tex)
uplatex: $(UPLATEXPDFS) $(UPLATEXPDFS:.pdf=.tex)
# TeX ソースから PDF へコンパイル
%.pdf: %.tex
$(LLMK) $<
# LuaLaTeX ソースから pLaTeX ソースを生成
%.platex.tex: %.tex
$(SED) -f platex.sed $< > $@
# LuaLaTeX ソースから upLaTeX ソースを生成
%.uplatex.tex: %.tex
$(SED) -f uplatex.sed $< > $@
# LilyPond で図 PDF を生成する
%.pdf: %.ly
$(LILYPOND) $<
$(RM) $*-1.eps $*-1.pdf \
$*-systems.count $*-systems.tex $*-systems.texi