summaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorAgathe Porte <microjoe@microjoe.org>2017-08-12 11:06:53 +0200
committerAgathe Porte <microjoe@microjoe.org>2017-08-12 11:06:53 +0200
commite6e4c137780a37470aa63e18c9045639b1593ad9 (patch)
treebd424a39e254523d27122edcfbf690738c428e68 /Makefile
downloadlatex-makefile-e6e4c137780a37470aa63e18c9045639b1593ad9.tar.gz
latex-makefile-e6e4c137780a37470aa63e18c9045639b1593ad9.zip
Initial commit
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile48
1 files changed, 48 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..24dfd2d
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,48 @@
+# LaTeX basic Makefile
+#
+# WTFPL, 2016 Agathe Porte (MicroJoe) <microjoe@microjoe.org>
+#
+# Inspirated from
+# http://tex.stackexchange.com/questions/40738/how-to-properly-make-a-latex-project
+# and my basic Makefile skills.
+
+# Very important variables to set up
+PDF=main.pdf
+PRINC=src/main.tex
+
+# 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
+
+# Main rule: Construct the PDF
+all: $(PDF)
+
+# Construct the PDF file from sources
+$(PDF): $(PRINC) $(SOURCES)
+ source ~/.bashrc && latexmk -pdf -pdflatex="pdflatex -interaction=nonstopmode" -use-make $(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 Done