forked from liuxinyu95/AlgoXY
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
33 lines (21 loc) · 778 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
all: cn en
BOOK-CN := $(wildcard *-zh-cn.tex)
BOOK-EN := $(wildcard *-en.tex)
cn: $(BOOK-CN:.tex=.pdf)
en: $(BOOK-EN:.tex=.pdf)
TEX_FLAGS =
%.pdf: %.tex; latexmk -cd -lualatex $(TEX_FLAGS) $<
CHAPTERS-CN := $(shell egrep -l documentclass $$(find . -name '*-zh-cn.tex' -a \! -name 'algoxy-*.tex'))
CHAPTERS-EN := $(shell egrep -l documentclass $$(find . -name '*-en.tex' -a \! -name 'algoxy-*.tex'))
chapters: chapters-cn chapters-en
chapters-cn: $(CHAPTERS-CN:.tex=.pdf)
chapters-en: $(CHAPTERS-EN:.tex=.pdf)
FORCE-FLAGS = -g -use-make $(TEX_FLAGS)
force: force-cn force-en
force-cn:
latexmk -cd -lualatex $(FORCE-FLAGS) $(BOOK-CN)
force-en:
latexmk -cd -lualatex $(FORCE-FLAGS) $(BOOK-EN)
clean:
git clean -fdx
.PHONY: all cn en chapters chapters-cn chapters-en