diff options
| author | Ian Jauslin <jauslin@ias.edu> | 2017-03-30 02:47:52 +0000 | 
|---|---|---|
| committer | Ian Jauslin <jauslin@ias.edu> | 2017-03-30 03:05:27 +0000 | 
| commit | c91fccd07c9ba1753d7006482512352423046c74 (patch) | |
| tree | 02927b499ba5217409644bd092f17887a74e5db9 /Makefile | |
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 48 | 
1 files changed, 48 insertions, 0 deletions
diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..ef40a6f --- /dev/null +++ b/Makefile @@ -0,0 +1,48 @@ +PROJECTNAME=$(basename $(wildcard *.tex)) +LIBS=$(notdir $(wildcard libs/*)) +FIGS=$(notdir $(wildcard figs/*.fig)) + +PDFS=$(addsuffix .pdf, $(PROJECTNAME)) +SYNCTEXS=$(addsuffix .synctex.gz, $(PROJECTNAME)) + +all: $(PDFS) + +$(PDFS): $(LIBS) $(FIGS) +	pdflatex -file-line-error $(patsubst %.pdf, %.tex, $@) +	pdflatex -synctex=1 $(patsubst %.pdf, %.tex, $@) + +$(SYNCTEXS): $(LIBS) $(FIGS) +	pdflatex -synctex=1 $(patsubst %.synctex.gz, %.tex, $@) + +install: $(PDFS) +	cp $^ $(INSTALLDIR)/ + +install-synctex: $(SYNCTEXS) +	cp $^ $(INSTALLDIR)/ + + +$(LIBS): +	ln -fs libs/$@ ./ + + +$(FIGS): +	make -C figs/$@ +	ln -fs figs/$@/*.pdf ./ + + +clean-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)) + +clean-tex: +	rm -f $(PDFS) $(SYNCTEXS) + +clean: clean-aux clean-tex clean-libs clean-figs  | 
