summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile41
1 files changed, 12 insertions, 29 deletions
diff --git a/Makefile b/Makefile
index 48593ca..5ad3eba 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-# LaTeX basic Makefile
+# LaTeX Makefile
#
# WTFPL, 2016 - 2018 Agathe Porte (MicroJoe) <microjoe@microjoe.org>
#
@@ -8,47 +8,30 @@
# Very important variables to set up
PDF=main.pdf
-PRINC=src/main.tex
+PRINC=main.tex
+AUXDIR=build
+LATEXMK=source ~/.bashrc && latexmk \
+ -auxdir=$(AUXDIR) \
+ -outdir=$(AUXDIR) \
+ -pdf -pdflatex="pdflatex -interaction=nonstopmode" -use-make
# You want latexmk to *always* run, because make does not have all the info.
# Also, include non-file targets in .PHONY so they are run regardless of any
# file of the given name existing.
-.PHONY: $(PDF) all clean
+.PHONY: $(PDF) all clean live
# Main rule: Construct the PDF
all: $(PDF)
-#
+
# Live: automatic watch and build of the PDF file
live: $(PRINC) $(SOURCES)
- source ~/.bashrc && latexmk -pvc -pdf -pdflatex="pdflatex -interaction=nonstopmode" -use-make $(PRINC)
+ $(LATEXMK) -pvc $(PRINC)
# Construct the PDF file from sources
$(PDF): $(PRINC) $(SOURCES)
- source ~/.bashrc && latexmk -pdf -pdflatex="pdflatex -interaction=nonstopmode" -use-make $(PRINC)
+ $(LATEXMK) $(PRINC)
# Remove all the intermediate files
clean:
@echo Cleaning temporary LaTeX files...
- @rm -f \
- *.aux \
- *.fdb_latexmk \
- *.fls \
- *.glg \
- *.glo \
- *.gls \
- *.glsdefs \
- *.ist \
- *.lof \
- *.log \
- *.lot \
- *.out \
- *.toc \
- *.xdy
- @echo Done
-
-mrproper: clean
- @echo Removing all PDF files...
- @rm -f *.pdf
- @echo Removing all DVI files...
- @rm -f *.dvi
- @echo Done
+ @rm -rf build