summaryrefslogtreecommitdiff
path: root/t2t.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 /t2t.mk
downloadmakefile_templates-e4a96cee395549dccb18f81b03724fe2d517c88f.tar.gz
makefile_templates-e4a96cee395549dccb18f81b03724fe2d517c88f.zip
init
Diffstat (limited to 't2t.mk')
-rw-r--r--t2t.mk87
1 files changed, 87 insertions, 0 deletions
diff --git a/t2t.mk b/t2t.mk
new file mode 100644
index 0000000..e1c3bc8
--- /dev/null
+++ b/t2t.mk
@@ -0,0 +1,87 @@
+# -*- make -*-
+# (C) 2013 by Eugeniy Mikhailov, <evgmik@gmail.com>
+
+CLEAN_TARGETS += clean_t2t
+REAL_CLEAN_TARGETS += real_clean_t2t
+
+t2t_files = $(wildcard *.t2t)
+tex_from_t2t = $(t2t_files:%.t2t=%.tex)
+pdf_from_t2t = $(tex_from_t2t:%.tex=%.pdf)
+html_from_t2t = $(t2t_files:%.t2t=%.html)
+
+html_t2t: $(html_from_t2t)
+
+pdf_tex: $(pdf_from_independent_tex)
+
+pdf_t2t: $(pdf_from_t2t)
+
+tex_t2t: $(tex_from_t2t)
+
+
+
+$(html_from_t2t): %.html : %.t2t $(t2t_fig_files) $(t2t_configs)
+ txt2tags --css-sugar -t html -o $@ $<
+
+$(tex_from_t2t): %.tex : %.t2t $(t2t_fig_files) $(t2t_configs)
+ txt2tags -t tex -o $@ $<
+
+$(pdf_from_t2t): %.pdf : %.tex $(t2t_fig_files)
+ rubber -d $<
+
+
+dest_dir_t2t:
+ $(INSTALL) -d -m 0755 $(dest_dir)
+
+install_t2t_src: dest_dir_t2t install_t2t_fig_files
+ifneq ($(strip $(t2t_files)),)
+ $(INSTALL) -m 0644 $(html_from_t2t) $(dest_dir)/
+endif
+
+install_t2t_fig_files:
+ifneq ($(strip $(t2t_fig_files)),)
+ $(INSTALL) -m 0644 $(t2t_fig_files) $(dest_dir)/
+endif
+
+install_html_t2t: dest_dir_t2t $(html_from_t2t) install_t2t_fig_files
+ifneq ($(strip $(html_from_t2t)),)
+ $(INSTALL) -m 0644 $(html_from_t2t) $(dest_dir)/
+endif
+
+install_pdf_t2t: dest_dir_t2t $(pdf_from_t2t)
+ifneq ($(strip $(pdf_from_t2t)),)
+ $(INSTALL) -m 0644 $(pdf_from_t2t) $(dest_dir)/
+endif
+
+clean_t2t: clean_t2t_aux
+
+real_clean_t2t: clean_t2t_tex clean_t2t_aux
+ifneq ($(strip $(pdf_from_t2t)),)
+ rm -f $(pdf_from_t2t)
+endif
+ifneq ($(strip $(html_from_t2t)),)
+ rm -f $(html_from_t2t)
+endif
+
+clean_t2t_tex:
+ifneq ($(strip $(tex_from_t2t)),)
+ rm -f $(tex_from_t2t)
+endif
+
+clean_t2t_aux:
+ifneq ($(strip $(tex_from_t2t)),)
+ rm -f $(tex_from_t2t:%.tex=%.dvi)
+ rm -f $(tex_from_t2t:%.tex=%.log)
+ rm -f $(tex_from_t2t:%.tex=%.aux)
+ rm -f $(tex_from_t2t:%.tex=%.nav)
+ rm -f $(tex_from_t2t:%.tex=%.out)
+ rm -f $(tex_from_t2t:%.tex=%.snm)
+ rm -f $(tex_from_t2t:%.tex=%.toc)
+ rm -f $(tex_from_t2t:%.tex=%.vrb)
+ rm -f $(tex_from_t2t:%.tex=%.blg)
+ rm -f $(tex_from_t2t:%.tex=%.bbl)
+ rm -f missfont.log
+ rm -f *Notes.bib
+endif
+
+
+