-
Notifications
You must be signed in to change notification settings - Fork 62
/
Makefile
41 lines (31 loc) · 1.16 KB
/
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
TITLE=A Friendly Introduction\\\\to Software Testing
AUTHOR=Bill Laboon
DEDICATION=for AKS and CKN
# If pandoc or xelatex are not in your PATH, specify their locations here:
PANDOC= pandoc
XELATEX= xelatex
MD_FILES= $(wildcard text/*.md)
pdf: main.tex tex_files
# Uses date of most recent commit in repo
$(PANDOC) main.tex -o software-testing-laboon-ebook.pdf \
--pdf-engine $(XELATEX) \
--top-level-division=chapter -N --toc --toc-depth=2 \
-M documentclass="book" \
-M classoption="twoside" \
-M classoption="letterpaper" \
-M geometry="margin=1.25in" \
-M title="\Huge{\textbf{${TITLE}}}" \
-M author="\LARGE{${AUTHOR}}" \
-M date="{\Large\textcopyright~\textbf{$(shell git log -1 --date=iso --format='%ai' | cut -c-10 )}}\\\\Compiled in PDF\LaTeX{}\endgraf\textit{${DEDICATION}}"
tex_files: compiled_tex/ $(patsubst text/%.md,compiled_tex/%.tex,$(MD_FILES))
compiled_tex/:
mkdir -p compiled_tex/
compiled_tex/%.tex: text/%.md
$(PANDOC) text/$*.md \
--listings --highlight-style kate \
-o compiled_tex/$*.tex
clean:
rm -rf compiled_tex/
# Remove temporary compilation directories, if they still exist
rm -rf tex2pdf*/
.PHONY: pdf tex_files clean