-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
38 lines (26 loc) · 758 Bytes
/
Makefile
File metadata and controls
38 lines (26 loc) · 758 Bytes
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
PWD = $(shell pwd)
TEX_DIR = tex
TEX_FILES = $(shell ls -d tex/*)
SOURCE_CODE_FILES = $(shell ls -d source_code/*)
TEX_FILE_ENTRY = codebook.tex
TARGET_DIR = $(PWD)/dist
TARGET_NAME = codebook.pdf
TARGET = $(TARGET_DIR)/$(TARGET_NAME)
##################################################
FLAGS = \
-interaction=nonstopmode \
-shell-escape \
-output-directory=$(TARGET_DIR) \
-jobname=$(TARGET_NAME) \
TIMES = 2
SHELL = bash
##################################################
.PHONY: all clean
all: $(TARGET_DIR)/$(TARGET_NAME)
clean:
rm -rf $(TARGET_DIR)/*
$(TARGET_DIR)/$(TARGET_NAME): $(TEX_FILES) $(SOURCE_CODE_FILES)
cd $(TEX_DIR); \
for ((i=0; i<$(TIMES); ++i)); do \
xelatex $(FLAGS) $(TEX_FILE_ENTRY) || break; \
done