summaryrefslogtreecommitdiff
path: root/tex.mk
diff options
context:
space:
mode:
authorEugeniy Mikhailov <evgmik@gmail.com>2013-10-22 13:18:55 -0400
committerEugeniy Mikhailov <evgmik@gmail.com>2013-10-22 13:18:55 -0400
commite4a96cee395549dccb18f81b03724fe2d517c88f (patch)
treeab5d11e939f21c51683f00374bac6de61100a525 /tex.mk
downloadmakefile_templates-e4a96cee395549dccb18f81b03724fe2d517c88f.tar.gz
makefile_templates-e4a96cee395549dccb18f81b03724fe2d517c88f.zip
init
Diffstat (limited to 'tex.mk')
-rw-r--r--tex.mk60
1 files changed, 60 insertions, 0 deletions
diff --git a/tex.mk b/tex.mk
new file mode 100644
index 0000000..f130ee9
--- /dev/null
+++ b/tex.mk
@@ -0,0 +1,60 @@
+# -*- make -*-
+# (C) 2013 by Eugeniy Mikhailov, <evgmik@gmail.com>
+
+CLEAN_TARGETS += clean_tex
+REAL_CLEAN_TARGETS += real_clean_tex
+
+pdf_from_independent_tex= $(tex_independent:%.tex=%.pdf)
+tex_independent_bases= $(tex_independent:%.tex=%)
+
+tex_includes_bases = $(tex_includes:%.tex=%)
+
+pdf_tex: $(pdf_from_independent_tex)
+
+# rubber does not deal with nicely with subfiles
+# thus force switch below
+$(pdf_from_independent_tex): %.pdf : %.tex $(tex_fig_files) $(tex_includes)
+ rubber -f -d $<
+
+dest_dir_tex:
+ $(INSTALL) -d -m 0755 $(dest_dir)
+
+install_pdf_tex: dest_dir_tex $(pdf_from_independent_tex)
+ifneq ($(strip $(pdf_from_independent_tex)),)
+ $(INSTALL) -m 0644 $(pdf_from_independent_tex) $(dest_dir)/
+endif
+
+install_tex_src: dest_dir_tex
+ifneq ($(strip $(tex_independent)),)
+ $(INSTALL) -m 0644 $(tex_independent) $(dest_dir)/
+endif
+ifneq ($(strip $(tex_fig_files)),)
+ $(INSTALL) -m 0644 $(tex_fig_files) $(dest_dir)/
+endif
+
+clean_tex: clean_tex_aux
+
+clean_tex_aux:
+ifneq ($(strip $(tex_independent_bases)),)
+ rm -f $(tex_independent_bases:%=%.dvi)
+ rm -f $(tex_independent_bases:%=%.log)
+ rm -f $(tex_independent_bases:%=%.aux)
+ rm -f $(tex_independent_bases:%=%.nav)
+ rm -f $(tex_independent_bases:%=%.out)
+ rm -f $(tex_independent_bases:%=%.snm)
+ rm -f $(tex_independent_bases:%=%.toc)
+ rm -f $(tex_independent_bases:%=%.vrb)
+ rm -f $(tex_independent_bases:%=%.blg)
+ rm -f $(tex_independent_bases:%=%.bbl)
+ rm -f missfont.log
+ rm -f *Notes.bib
+endif
+ifneq ($(strip $(tex_includes_bases)),)
+ rm -f $(tex_includes_bases:%=%.aux)
+endif
+
+real_clean_tex: clean_tex_aux
+ifneq ($(strip $(pdf_from_independent_tex)),)
+ rm -f $(pdf_from_independent_tex)
+endif
+