DOC = maincent-building-embedded-debian-ubuntu-systems-elbe.tex

PICTURES = \
	common/logo-penguins.pdf \
	common/logo-square.pdf \
	common/bootlin-logo.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) xelatex -shell-escape $(DOC)

%.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* $(PICTURES)
