-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
57 lines (51 loc) · 1.38 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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#Author: Polonio Davide <poloniodavide@gmail.com>
#License: GPLv3
OUTPUT_NAME= Thesis
LIST_NAME= listOfSections.tex
PATH_OF_CONTENTS= res/sections
MAIN_FILE= main
export PRINT= n
LANG= en
SHELL := /bin/bash #Need bash not shell
all: compile
compile: clean
@set -e; \
function glossary () { \
makeindex -s $(MAIN_FILE).ist -t $(MAIN_FILE).glg -o $(MAIN_FILE).gls \
$(MAIN_FILE).glo; \
makeindex -s $(MAIN_FILE).ist -t $(MAIN_FILE).alg -o $(MAIN_FILE).acr \
$(MAIN_FILE).acn; \
}; \
function generatePdf () { \
pdflatex -interaction=nonstopmode $(MAIN_FILE); \
biber $(MAIN_FILE); \
glossary; \
}; \
if [[ -a "res/$(LIST_NAME)" ]]; then \
echo "Removing res/$(LIST_NAME)"; \
rm res/$(LIST_NAME); \
fi; \
if [[ -z "$(FILE_LIST)" ]]; then \
for i in $(sort $(wildcard $(PATH_OF_CONTENTS)/*.tex)); do \
echo "Adding $$i into $(LIST_NAME)"; \
echo "\input{$$i}" >> res/$(LIST_NAME); \
done; \
else \
for i in $(FILE_LIST); do \
echo "Adding $$i into $(LIST_NAME)"; \
echo "\input{$$i}" >> res/$(LIST_NAME); \
done; \
fi; \
for j in {1..2}; do \
generatePdf; \
done; \
for k in {1..2}; do \
pdflatex -interaction=nonstopmode $(MAIN_FILE); \
done; \
mv $(MAIN_FILE).pdf $(OUTPUT_NAME).pdf;
clean:
git clean -Xfd
if [[ -a "$(OUTPUT_NAME)" ]]; then rm -rv $(OUTPUT_NAME)/; fi;
spellcheck:
./tools/spellchecker/spellcheck.sh $(LANG)
ci: spellcheck compile