Contact Us!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
sagemathinc

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.

GitHub Repository: sagemathinc/cocalc-example-files
Path: blob/master/latex/multiple-files/makefile
Views: 1009
OUTDIR=build
MAIN=master.tex
MAINPDF=$(MAIN:.tex=.pdf)

default: $(MAINPDF)

distclean: clean
	-$(RM) *.pdf *.dvi *-blx.bib *.bbl *.run.xml *.synctex.gz *.log
	-$(RM) *.py.out *.py.err latex.py
	-$(RM) -R $(OUTDIR)
	-git clean -fx

clean:
	latexmk -C
	-$(RM) $(OUTDIR)/*.pdf $(OUTDIR)/*.synctex.gz
	-$(RM) *.pdf *.synctex.gz

%.pdf: %.tex
	latexmk -pdf -bibtex -synctex=1 -interaction=nonstopmode -outdir=$(OUTDIR) $<
	-cp -vlf $(OUTDIR)/$@ .
	-cp -vlf $(OUTDIR)/$(patsubst %.tex,%.synctex.gz,$<) .