# Makefile --- GNU Makefile for building the thesis

# Copyright (C) 2020 Amin Bandali <bandali@uwaterloo.ca>

# This file is part of Amin Bandali's MMath thesis.

# This thesis is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.

# This thesis is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this thesis.  If not, see <https://www.gnu.org/licenses/>.


all: bandali-mmath-thesis.pdf

bsymb.sty:
	wget -N https://p.bndl.org/bsymb-1.9.zip
	unzip -n bsymb-1.9.zip
	cp -p bsymb-1.9/bsymb.sty .

bandali-mmath-thesis.pdf: bandali-mmath-thesis.tex bsymb.sty
bandali-mmath-thesis.pdf: sahel.pdf thesis-dedication-fa.pdf
bandali-mmath-thesis.pdf:
	latexmk -lualatex bandali-mmath-thesis

thesis-dedication-fa.pdf: thesis-dedication-fa.tex
	latexmk -xelatex thesis-dedication-fa

sahel.pdf: sahel.tex
	latexmk -xelatex sahel

watch: sahel.pdf thesis-dedication-fa.pdf
	latexmk -lualatex -pvc -view=none bandali-mmath-thesis

uwspace: bandali-mmath-thesis.pdf
	cp -p bandali-mmath-thesis.pdf Bandali_Amin.pdf

clean:
	latexmk -C
