Created
February 19, 2019 14:42
-
-
Save keuv-grvl/a82e212cd2fcd8cb5dc5320e87777f5e to your computer and use it in GitHub Desktop.
Simple Makefile for LaTeX project
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
.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