Ian Jauslin
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Jauslin <ian@jauslin.org>2020-11-25 01:10:59 -0500
committerIan Jauslin <ian@jauslin.org>2020-11-25 01:10:59 -0500
commit19042107cb35092c674517c8bfe476f1a66c5874 (patch)
tree9e5ae8130aa873c3f77f9819e3605112255fb785 /Makefile
Initial commitv0.0
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..f526dcd
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,50 @@
+PROJECTNAME=$(basename $(wildcard *.tex))
+FIGS=$(notdir $(wildcard figs/*.fig))
+
+all: $(PROJECTNAME)
+
+$(PROJECTNAME): $(FIGS) $(PROJECTNAME).bbl
+ pdflatex -file-line-error $@.tex
+ pdflatex -file-line-error $@.tex
+ pdflatex -synctex=1 $@.tex
+
+$(PROJECTNAME).aux: $(FIGS)
+ pdflatex -file-line-error -draftmode $(PROJECTNAME).tex
+
+
+$(PROJECTNAME).synctex.gz: $(FIGS)
+ pdflatex -synctex=1 $(patsubst %.synctex.gz, %.tex, $@)
+
+$(PROJECTNAME).bbl: $(PROJECTNAME).aux
+ bibtex $(PROJECTNAME).aux
+
+
+figs: $(FIGS)
+
+$(FIGS):
+ make -C figs/$@
+ for pdf in $$(find figs/$@/ -name '*.pdf'); do ln -fs "$$pdf" ./ ; done
+
+
+clean-aux: clean-figs-aux
+ rm -f $(PROJECTNAME).aux
+ rm -f $(PROJECTNAME).log
+ rm -f $(PROJECTNAME).out
+ rm -f $(PROJECTNAME).toc
+ rm -f $(PROJECTNAME)Notes.bib
+
+clean-figs:
+ $(foreach fig,$(addprefix figs/, $(FIGS)), make -C $(fig) clean; )
+ rm -f $(notdir $(wildcard figs/*.fig/*.pdf))
+
+clean-figs-aux:
+ $(foreach fig,$(addprefix figs/, $(FIGS)), make -C $(fig) clean-aux; )
+
+
+clean-tex:
+ rm -f $(PROJECTNAME).pdf $(PROJECTNAME).synctex.gz
+
+clean-bibliography:
+ rm -f $(PROJECTNAME).bbl
+
+clean: clean-aux clean-tex clean-figs clean-bibliography