From 52a5942994007acc29107f036c9b8f386b19399f Mon Sep 17 00:00:00 2001 From: Ian Jauslin Date: Wed, 13 Sep 2017 23:29:54 +0000 Subject: Initial commit --- Makefile | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 Makefile (limited to 'Makefile') diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..665719a --- /dev/null +++ b/Makefile @@ -0,0 +1,69 @@ +PROJECTNAME=$(basename $(wildcard *.tex)) +LIBS=$(notdir $(wildcard libs/*)) +FIGS=$(notdir $(wildcard figs/*.fig)) +DIMER_LIBS=dimer.600pk dimer.tfm dimer.sty + +PDFS=$(addsuffix .pdf, $(PROJECTNAME)) +SYNCTEXS=$(addsuffix .synctex.gz, $(PROJECTNAME)) + +all: $(PROJECTNAME) + +$(PROJECTNAME): $(LIBS) $(FIGS) $(DIMER_LIBS) + pdflatex -file-line-error $@.tex + pdflatex -file-line-error $@.tex + pdflatex -synctex=1 $@.tex + +$(PROJECTNAME).aux: $(LIBS) $(FIGS) $(DIMER_LIBS) + pdflatex -file-line-error -draftmode $(PROJECTNAME).tex + + +$(SYNCTEXS): $(LIBS) $(FIGS) $(DIMER_LIBS) + pdflatex -synctex=1 $(patsubst %.synctex.gz, %.tex, $@) + + +libs: $(LIBS) + +$(LIBS): + ln -fs libs/$@ ./ + +dimer_font: $(DIMER_LIBS) + +$(DIMER_LIBS): + $(MAKE) -C dimer_font + ln -fs dimer_font/$@ ./ + +figs: $(FIGS) + +$(FIGS): + make -C figs/$@ + ln -fs figs/$@/*.pdf ./ + + +clean-aux: clean-figs-aux clean-dimer-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-dimer: + $(MAKE) -C dimer_font clean + rm -f $(DIMER_LIBS) + +clean-dimer-aux: + $(MAKE) -C dimer_font clean-aux + + +clean-tex: + rm -f $(PDFS) $(SYNCTEXS) + +clean: clean-aux clean-tex clean-libs clean-figs clean-dimer -- cgit v1.2.3-70-g09d2