summaryrefslogtreecommitdiff
path: root/make_templates/t2t.mk
blob: 80cf65de43b925b19c093955c6f3834744254c68 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# -*- make -*-
# (C) 2013 by Eugeniy Mikhailov, <evgmik@gmail.com>

CLEAN_TARGETS      += clean_tex
REAL_CLEAN_TARGETS += real_clean_tex

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)
	txt2tags --css-sugar -t html -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_tex
	
real_clean_t2t: clean_t2t_tex
	rm -f $(pdf_from_t2t)
	rm -f $(html_from_t2t)

clean_t2t_tex:
	rm -f $(tex_from_t2t)

clean_t2t_aux: $(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