PDF_APP = zathura 
OUTPUT_DIR = output
svgfiles = $(wildcard images/svg/*.svg)
figures = $(subst svg/,generated/,$(subst .svg,.pdf,$(svgfiles)))

default: build

images: $(figures)

clean:
	rm -rf images/generated/*
	rm -rf output/*

build:
	lualatex --output-directory $(OUTPUT_DIR) rapport.tex

buildall: images build

images/generated/%.pdf: images/svg/%.svg
	@echo build $@
	inkscape --export-type=pdf -o $@ $<

echo:
	@echo "svg files: $(svgfiles)"
	@echo "generated figures: $(figures)"

view:
	$(PDF_APP) $(OUTPUT_DIR)/rapport.pdf
