Skip to content

Instantly share code, notes, and snippets.

@keuv-grvl
Created February 19, 2019 14:42
Show Gist options
  • Save keuv-grvl/a82e212cd2fcd8cb5dc5320e87777f5e to your computer and use it in GitHub Desktop.
Save keuv-grvl/a82e212cd2fcd8cb5dc5320e87777f5e to your computer and use it in GitHub Desktop.
Simple Makefile for LaTeX project
.PHONY: pdf display clean nuke
PDFREADER :=evince
OUTPUT :=document.pdf
BUILD :=build
SRC :=$(shell find src -name '*.tex' -o -name '*.png')
LMKFLAGS = -pdf -outdir=$(BUILD)
pdf: $(OUTPUT)
$(OUTPUT): $(BUILD)/main.pdf
cp -f $^ $<
$(BUILD)/main.pdf: main.tex $(SRC)
mkdir -p $(BUILD)/src/
latexmk $(LMKFLAGS) $<
display: $(OUTPUT)
$(PDFREADER) $^ &
clean:
rm -rf $(BUILD)
nuke: clean
rm -rf $(OUTPUT)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment