# Makefile --- GNU Makefile for building my LP 2021 Jami talk's slides

# Copyright (C) 2021 Amin Bandali <bandali@gnu.org>

# This presentation 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 presentation 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 presentation.  If not, see
# <https://www.gnu.org/licenses/>.


SVGS := $(wildcard g/*.svg)
SVGPDFS := $(patsubst g/%.svg,g/%.pdf, $(SVGS))

all: bandali-jami-libreplanet-2021.pdf

g/%.pdf: g/%.svg
	inkscape -C -z --file=$< --export-pdf=$@ --export-latex

bandali-jami-libreplanet-2021.pdf: bandali-jami-libreplanet-2021.tex $(SVGPDFS)
	latexmk -lualatex bandali-jami-libreplanet-2021

watch: bandali-jami-libreplanet-2021.pdf
	latexmk -lualatex -pvc -view=none bandali-jami-libreplanet-2021

clean:
	rm -rf g/*.pdf
	rm -rf g/*.pdf_tex
	latexmk -C
