.PHONY: all clean run image

all: extension_messagerie.pdf

%.pdf: %.tex
	pdflatex $<

extension_messagerie.pdf:use_case_messagerie.tex extension_messagerie.bbl extension_messagerie.tex 
	pdflatex extension_messagerie.tex

use_case_messagerie.tex: use_case_messagerie.uml
	plantuml -tlatex:nopreamble use_case_messagerie.uml

image: use_case_messagerie.uml interaction_diagram.uml class.uml 
	plantuml $^ 
	mmdc -i ERD.md -o ERD.png

extension_messagerie.bbl: extension_messagerie.bcf
	biber extension_messagerie

extension_messagerie.bcf:
	pdflatex extension_messagerie.tex

clean:
	latexmk -C
	rm -f use_case_messagerie.tex
	rm -f extension_messagerie.{bbl,run.xml}
	rm -f class.tex

run: extension_messagerie.pdf
	xdg-open $<