Skip to content

Instantly share code, notes, and snippets.

@kdungs
Created June 22, 2014 18:56
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kdungs/12c0198a5330cccbf61a to your computer and use it in GitHub Desktop.
Save kdungs/12c0198a5330cccbf61a to your computer and use it in GitHub Desktop.
A Makefile for LaTeX with intermediate running of biber.
PROJECT=main
build/${PROJECT}.pdf: build/${PROJECT}.bbl
lualatex --output-directory=build ${PROJECT}
build/${PROJECT}.bbl: build/${PROJECT}.bcf
biber build/${PROJECT}
build/${PROJECT}.bcf: ${PROJECT}.tex
lualatex --output-directory=build ${PROJECT}
clean:
rm -f build/*
@schneiderfelipe
Copy link

For me it gets biber execute everytime. Am I doing something wrong?

@rriemann
Copy link

rriemann commented Dec 8, 2016

Same for me. Have you found a solution?

@kose-y
Copy link

kose-y commented Sep 22, 2017

Looks like .bcf file is modified with every lualatex/pdflatex run. Then there is nothing much we can do about it with this structure of dependency.

@madmann91
Copy link

To solve that problem, try to back up the bcf file before running lualatex/pdflatex/xelatex:

build/${PROJECT}.pdf: ${PROJECT}.bbl
	mv build/${PROJECT}.bcf build/${PROJECT}.bcf.bak
	lualatex --output-directory=build ${PROJECT}
	mv build/${PROJECT}.bcf.bak build/${PROJECT}.bcf

@kdungs
Copy link
Author

kdungs commented Nov 9, 2020

Oh this is horribly outdated. In 2020, just use latexmk, please.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment