.PHONY: clean bib

all: clean bib compile

bib:
	@files=$$(ls -1 bibliography/*.bib | sed 's/\.bib//' | paste -sd, -); \
	echo "\\bibliography{$$files}" > ./bibliography/all.tex;
clean:
	rm -rf ./out ./bibliography/all.tex
compile: bib
	latexmk -lualatex -output-directory=out main.tex
