summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCamil Staps2016-02-09 11:14:21 +0100
committerCamil Staps2016-02-09 11:14:21 +0100
commit8f0c6ca9285e1c25be154d6a4a6072a5ece2f084 (patch)
treef18f642db1f829c9b6de3db8a11252b7bd6cf0fa
parentweek 1 (diff)
makefile
-rw-r--r--Makefile19
1 files changed, 19 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..879e180
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,19 @@
+TARGET=$(subst .tex,.pdf,$(wildcard *.tex))
+
+all: $(TARGET)
+
+%.dep: %.tex
+ perl -lnwe 'print "$*.pdf: $$1" if /\\input{([\w-]+\.tex)}/' <$< >$@
+
+include $(TARGET:.pdf=.dep)
+
+%.pdf : %.tex
+ pdflatex $<
+ pdflatex $<
+
+clean:
+ latexmk -c
+ rm -f *.dep
+
+.PHONY: clean
+