Ian Jauslin
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile37
1 files changed, 22 insertions, 15 deletions
diff --git a/Makefile b/Makefile
index eeb141d..6f5cc92 100644
--- a/Makefile
+++ b/Makefile
@@ -1,40 +1,47 @@
PROJECTNAME=Jauslin_Lebowitz_2017
+LIBS=$(notdir $(wildcard libs/*))
+FIGS=$(notdir $(wildcard figs/*.fig))
-LIBS=$(patsubst libs/%, %, $(wildcard libs/*))
-FIGS=$(patsubst figs/%, %, $(wildcard figs/*))
+PDFS=$(addsuffix .pdf, $(PROJECTNAME))
+SYNCTEXS=$(addsuffix .synctex.gz, $(PROJECTNAME))
all: $(PROJECTNAME)
$(PROJECTNAME): $(LIBS) $(FIGS)
- pdflatex -file-line-error $(PROJECTNAME).tex
- pdflatex $(PROJECTNAME).tex
- pdflatex -synctex=1 $(PROJECTNAME).tex
+ pdflatex -file-line-error $@.tex
+ pdflatex -file-line-error $@.tex
+ pdflatex -synctex=1 $@.tex
+
+
+libs: $(LIBS)
$(LIBS):
ln -fs libs/$@ ./
+figs: $(FIGS)
+
$(FIGS):
make -C figs/$@
ln -fs figs/$@/*.pdf ./
clean-aux:
- rm -f $(PROJECTNAME).aux
- rm -f $(PROJECTNAME).log
- rm -f $(PROJECTNAME).out
- rm -f $(PROJECTNAME).toc
+ rm -f $(addsuffix .aux, $(PROJECTNAME))
+ rm -f $(addsuffix .log, $(PROJECTNAME))
+ rm -f $(addsuffix .out, $(PROJECTNAME))
clean-libs:
rm -f $(LIBS)
-clean-tex:
- rm -f $(PROJECTNAME).pdf
- rm -f $(PROJECTNAME).synctex.gz
-
clean-figs:
- for fig in $(FIGS); do make -C figs/"$$fig" clean; done
+ $(foreach fig,$(addprefix figs/, $(FIGS)), make -C $(fig) clean; )
+ rm -f $(notdir $(wildcard figs/*.fig/*.pdf))
clean-figs-aux:
- for fig in $(FIGS); do make -C figs/"$$fig" clean-aux; done
+ $(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