Last active
March 5, 2019 00:25
-
-
Save rxm/0e122b3718a6a486fd93f190a8e97465 to your computer and use it in GitHub Desktop.
Simple makefile for tex
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# name of report | |
FINAL = BigReport.pdf | |
.PHONY: all clean bib error report package | |
all: | |
@ echo Building | |
@ if [[ ! -d build ]]; then mkdir build; fi | |
TEXINPUTS=".:./aux:" \ | |
xelatex -interaction=batchmode -output-directory build main | |
@ /bin/mv build/main.pdf . | |
# create the bibliography | |
bib: | |
@ if [[ ! -d build ]]; then mkdir build; fi | |
TEXINPUTS=".:./aux:" \ | |
xelatex -interaction=batchmode -output-directory build main | |
biber build/main.bcf | |
@ /bin/mv build/main.pdf . | |
report: bib | |
TEXINPUTS=".:./aux:" \ | |
xelatex -interaction=batchmode -output-directory build main | |
TEXINPUTS=".:./aux:" \ | |
xelatex -interaction=batchmode -output-directory build main | |
/bin/mv build/main.pdf . | |
$(MAKE) clean | |
error: | |
TEXINPUTS=".:./aux:" \ | |
xelatex -output-directory build main | |
# run clean twice to make real clean | |
clean: | |
@ echo Cleaning | |
@ /bin/rm -f $(FINAL) | |
@ [ -f main.pdf ] && /bin/mv main.pdf $(FINAL); exit 0 | |
@ /bin/rm -f main.{aux,bcf,log,out,run.xml,bbl,blg} | |
@ /bin/rm -r -f build | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment