-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
42 lines (31 loc) · 952 Bytes
/
Makefile
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
all: pdf
kijis := $(wildcard kiji/*.md)
texs := $(addprefix out/,$(notdir $(kijis:.md=.tex)))
CP := cp -f
MKDIR := mkdir -p
RM := rm -fr
PWD := $(shell pwd)
BUILD_IMAGE_TAG := latest
PANDOC := pandoc -f markdown+east_asian_line_breaks -t latex -N --pdf-engine=lualatex --top-level-division=chapter --table-of-contents --toc-depth=3
RUN_AT := docker run --mount type=bind,source="$(PWD)",target=/workdir ghcr.io/kmc-jp/bushi-build-image:$(BUILD_IMAGE_TAG)
pdf: $(texs) out/bushi.tex out/luakmcbook.cls covers
cd out && latexmk -lualatex bushi.tex
out/%.tex: kiji/%.md
$(PANDOC) -o $@ $^
out/luakmcbook.cls: out/luakmcbook.dtx out/luakmcbook.ins
lualatex luakmcbook.ins
out/bushi.tex: bushi.tex
$(CP) $< $@
out/luakmcbook.dtx: luakmcbook.dtx
$(CP) $< $@
out/luakmcbook.ins: luakmcbook.ins
$(CP) $< $@
covers: $(wildcard cover/*)
$(MKDIR) out/cover
$(CP) $^ out/
docker:
$(RUN_AT) make
.PHONY: docker
clean:
$(RM) out/*
.PHONY: clean