forked from gjkerns/IPSUR
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
101 lines (86 loc) · 3.08 KB
/
Makefile
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# IPSUR: Introduction to Probability and Statistics Using R
# Copyright (C) 2014 G. Jay Kerns
#
# This file is part of IPSUR.
#
# IPSUR is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# IPSUR is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with IPSUR. If not, see <http://www.gnu.org/licenses/>.
.PHONY: pkg
.PHONY: www
basedir = git
buildir = build
ipsurdir = IPSUR
figdir = fig
psdir = ps
pdfdir = pdf
htmldir = html
texdir = tex
orgfile = IPSUR
backdir = backup
Rdir = R
all:
-mkdir $(texdir)
-mkdir $(psdir)
emacs -Q -batch -eval "(progn (load \"~/$(basedir)/$(ipsurdir)/init-ipsur.el\") (R) (org-publish \"ipsurlatex\"))"
-cd $(texdir); latex $(orgfile).tex; bibtex $(orgfile); makeindex $(orgfile); latex $(orgfile).tex; latex $(orgfile).tex; dvips $(orgfile)
gs -dSAFER -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sPAPERSIZE=a4 -dPDFSETTINGS=/printer -dCompatibilityLevel=1.3 -dMaxSubsetPct=100 -dSubsetFonts=true -dEmbedAllFonts=true -sOutputFile=$(texdir)/$(orgfile).pdf $(texdir)/$(orgfile).ps
-rm -r ~/.org-timestamps
tex:
-mkdir $(texdir)
emacs -Q -batch -eval "(progn (load \"~/$(basedir)/$(ipsurdir)/init-ipsur.el\") (R) (org-publish \"ipsurlatex\"))"
-rm -r ~/.org-timestamps
pdf:
-rm $(pdfdir)
cp -R $(texdir) $(pdfdir)
-cd $(pdfdir); xelatex $(orgfile).tex; bibtex $(orgfile); makeindex $(orgfile); xelatex $(orgfile).tex; xelatex $(orgfile).tex
texpdf: tex pdf
figures:
-mkdir $(psdir)
emacs -Q --batch --eval "(progn (load \"~/$(basedir)/$(ipsurdir)/init-ipsur.el\") (R) (find-file \"~/$(basedir)/$(ipsurdir)/$(orgfile).org\") (org-babel-execute-buffer) (kill-buffer))"
pkg:
R CMD build pkg
check:
R CMD check *.tar.gz
Rtangle:
-mkdir $(Rdir)
emacs -Q --batch --eval "(progn (load \"~/$(basedir)/$(ipsurdir)/init-ipsur.el\") (R) (find-file \"~/$(basedir)/$(ipsurdir)/$(orgfile).org\") (org-babel-tangle) (kill-buffer))"
web:
@echo "Generating HTML..."
emacs -Q -batch -eval "(progn (load \"~/git/IPSUR/www/publish_config.el\") (org-publish \"ipsurweb\"))"
@echo "HTML generation done"
-rm -r ~/.org-timestamps
publish:
@echo "Generating HTML..."
emacs -Q -batch -eval "(progn (load \"~/git/IPSUR/www/publish_config.el\") (org-publish \"ipsurweb\"))"
@echo "HTML generation done"
-rm -r ~/.org-timestamps
cd ~/git/IPSURweb
git add -A
git commit -m "publishing website"
git push
cd ~/git/IPSUR
backup:
-mkdir $(backdir)
cp $(texdir)/$(orgfile).pdf $(backdir)/$(orgfile).pdf
clean:
-rm -r $(texdir)
-rm -r $(pdfdir)
-rm -r IPSUR.Rcheck
-rm -r ~/.org-timestamps
distclean:
-rm -r $(texdir)
-rm -r $(pdfdir)
-rm -r $(backdir)
-rm -r $(Rdir)
-rm -r IPSUR.Rcheck
-rm -r ~/.org-timestamps