diff options
author | Ian Jauslin <jauslin@ias.edu> | 2018-05-18 22:53:34 +0000 |
---|---|---|
committer | Ian Jauslin <jauslin@ias.edu> | 2018-05-18 22:53:34 +0000 |
commit | 06e19c0db24d4c527f82ed934ecb56228ea0aee8 (patch) | |
tree | ff988087ebcbe1815c1fc2b7cb7faf026c770baa /Makefile |
Initial commitv0.0
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..9d77353 --- /dev/null +++ b/Makefile @@ -0,0 +1,55 @@ +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 -file-line-error $@.tex + pdflatex -synctex=1 $@.tex + +$(PROJECTNAME).aux: $(LIBS) $(FIGS) + pdflatex -file-line-error -draftmode $(PROJECTNAME).tex + + +$(SYNCTEXS): $(LIBS) $(FIGS) + pdflatex -synctex=1 $(patsubst %.synctex.gz, %.tex, $@) + + +libs: $(LIBS) + +$(LIBS): + ln -fs libs/$@ ./ + +figs: $(FIGS) + +$(FIGS): + make -C figs/$@ + ln -fs figs/$@/*.pdf ./ + + +clean-aux: clean-figs-aux + rm -f $(addsuffix .aux, $(PROJECTNAME)) + rm -f $(addsuffix .log, $(PROJECTNAME)) + rm -f $(addsuffix .out, $(PROJECTNAME)) + rm -f $(addsuffix .toc, $(PROJECTNAME)) + +clean-libs: + rm -f $(LIBS) + +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 $(PDFS) $(SYNCTEXS) + +clean: clean-aux clean-tex clean-libs clean-figs |