-
Notifications
You must be signed in to change notification settings - Fork 6
/
Makefile
27 lines (19 loc) · 953 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
INITIAL_COMMIT = 6587a780
INITIAL_LINECOUNT = 6642
SRC_FOLDER = book
MAIN_FILE = RiichiBook1
LATEX_FILES = ${SRC_FOLDER}/*.tex
TARGET = ${SRC_FOLDER}/${MAIN_FILE}.pdf
DOCKER_IMAGE = loopfz/riichi-latex
all: book
book: ${TARGET}
${TARGET}: ${LATEX_FILES}
# Build twice to resolve chapter links
@docker run -it -v ${PWD}/${SRC_FOLDER}:/data --privileged ${DOCKER_IMAGE} lualatex --interaction=nonstopmode --halt-on-error ${MAIN_FILE}.tex
@docker run -it -v ${PWD}/${SRC_FOLDER}:/data --privileged ${DOCKER_IMAGE} lualatex --interaction=nonstopmode --halt-on-error ${MAIN_FILE}.tex
interactive:
@docker run -it -v ${PWD}/${SRC_FOLDER}:/data --privileged ${DOCKER_IMAGE} bash
progress:
@REMAIN=`{ for f in ${LATEX_FILES}; do git blame $$f; done } | grep ${INITIAL_COMMIT} | wc -l`; \
echo $$REMAIN lines from original document; \
echo Progress: `expr \( \( ${INITIAL_LINECOUNT} - $$REMAIN \) \* 100 \) / ${INITIAL_LINECOUNT}`\%