Ian Jauslin
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Jauslin <jauslin@ias.edu>2018-02-23 11:21:38 +0000
committerIan Jauslin <jauslin@ias.edu>2018-02-23 11:21:38 +0000
commitcaa6b27599fba3b518a5c5847a4a72a5bdf9065b (patch)
treef95aa70a50dfd4ba2bfe1bc13ed60c645c2946ed /Makefile
As presentedat MCQM2018, on 2018-02-23HEADv1.0master
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile50
1 files changed, 50 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..3446836
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,50 @@
+PROJECTNAME=$(basename $(wildcard *.tex))
+LIBS=$(notdir $(wildcard libs/*))
+FIGS=$(notdir $(wildcard figs/*.fig))
+
+PDFS=$(addsuffix .pdf, $(PROJECTNAME))
+SYNCTEXS=$(addsuffix .synctex.gz, $(PROJECTNAME))
+
+all: $(PROJECTNAME)
+
+$(PROJECTNAME): $(LIBS) $(FIGS)
+ pdflatex -file-line-error $@.tex
+ pdflatex -synctex=1 $@.tex
+
+$(SYNCTEXS): $(LIBS) $(FIGS)
+ pdflatex -synctex=1 $(patsubst %.synctex.gz, %.tex, $@)
+
+
+$(LIBS):
+ ln -fs libs/$@ ./
+
+
+figs: $(FIGS)
+
+$(FIGS):
+ make -C figs/$@
+ for pdf in $$(find figs/$@/ -name '*.pdf'); do ln -fs "$$pdf" ./ ; done
+ for png in $$(find figs/$@/ -name '*.png'); do ln -fs "$$png" ./ ; done
+
+
+clean-aux: clean-figs-aux
+ rm -f $(addsuffix .aux, $(PROJECTNAME))
+ rm -f $(addsuffix .log, $(PROJECTNAME))
+ rm -f $(addsuffix .out, $(PROJECTNAME))
+
+clean-libs:
+ rm -f $(LIBS)
+
+clean-figs:
+ $(foreach fig,$(addprefix figs/, $(FIGS)), make -C $(fig) clean; )
+ rm -f $(notdir $(wildcard figs/*.fig/*.pdf))
+ rm -f $(notdir $(wildcard figs/*.fig/*.png))
+
+clean-figs-aux:
+ $(foreach fig,$(addprefix figs/, $(FIGS)), make -C $(fig) clean-aux; )
+
+
+clean-tex:
+ rm -f $(PDFS) $(SYNCTEXS)
+
+clean: clean-aux clean-tex clean-libs clean-figs