PICTURES = \
	common/logo-penguins.pdf \
	common/logo-square.pdf \
	common/bootlin-logo.pdf \
	ecc-write-path.pdf \
	ecc-read-path.pdf \
	rawnand-wrong.pdf \
	rawnand-true.pdf \
	spi-on-die.pdf \
	spi-all-possible-engines.pdf


INKSCAPE_IS_NEW = $(shell inkscape --version | grep -q "^Inkscape 1.0" && echo YES)

ifeq ($(INKSCAPE_IS_NEW),YES)
INKSCAPE_PDF_OPT = -o
else
INKSCAPE_PDF_OPT = -A
endif

all: $(PICTURES)
	$(PDFLATEX_ENV) pdflatex -shell-escape raynal-ecc-engines.tex

%.pdf: %.svg
	inkscape -D $(INKSCAPE_PDF_OPT) $@ $<

%.pdf: %.eps
	epstopdf --outfile=$@ $^

%.eps: %.dia
	dia -e $@ -t eps $^

clean:
	$(RM) -r common/*.pdf *.pdf *.pyg *.snm *.toc *.vrb *.aux *.nav *.out *.dia~ *.log _minted*
