-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathMakefile
147 lines (138 loc) · 3.25 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
#
# Makefile
# Makefile to systematically compile the john_slides.tex to produce
# john_slides_[presentation|distribution].pdf (and clean up temporary files).
#
# In order to create the PDF files, just type
#
# make
#
# This and other associated files are 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.
#
# For questions, comments and/or concerns about this template, please contact
#
# Dr. Gowtham, PhD
# Director of Research Computing, IT
# Adj. Asst. Professor, Physics/ECE
# Michigan Technological University
# Email: [email protected]
# File suffixes
.SUFFIXES: .tex .dvi .eps .ps .pdf .jpg .gif
# Basic variables
SHELL = /bin/sh
CP = cp
RM = rm
MV = mv
AWK = awk
SED = sed
ZIP = zip
MKDIR = mkdir
RSYNC = rsync
SLEEP = sleep
LATEX = latex
PDFLATEX = pdflatex
BIBTEX = bibtex
DVIPS = dvips
DVIPDF = dvipdf
PS2PDF = ps2pdf
MAINFILE = $(shell ls *_*.tex | awk -F '.' '{ print $$1}')
DATETIME = $(shell date +"%Y%m%d_%H%M%S")
# Class file
CLASSFILE = MichiganTech.cls
# List of temporary file types
TMPFILES = acr \
alg \
aux \
bbl \
bcf \
blg \
blx \
brf \
dvi \
fdb_latexmk \
fls \
glg \
glo \
gls \
idx \
ilg \
ind \
ist \
loa \
lof \
log \
lol \
lot \
maf \
mtc \
mtc0 \
nav \
nlo \
out \
pdfsync \
ps \
pyg \
run.xml \
sagetex.py \
sagetex.sage \
sagetex.scmd \
snm \
sout \
sympy \
synctex.gz \
tdo \
thm \
toc \
vrb \
xdy
# Default target
all:
make clean
make presentation
make distribution
make clean
# Presentation materail
presentation:
@echo
@echo " Slides for presentation (with animation/transition)"
@echo
$(PDFLATEX) --shell-escape $(MAINFILE).tex
$(PDFLATEX) --shell-escape $(MAINFILE).tex
$(MV) $(MAINFILE).pdf $(MAINFILE)_presentation.pdf
@echo
@echo
# Distribution materail
distribution:
@echo
@echo " Slides for distribution (without animation/transition)"
@echo
$(MV) $(CLASSFILE) $(CLASSFILE)_presentation
$(SED) 's/aspectratio=43/handout,aspectratio=43/g' $(CLASSFILE)_presentation > $(CLASSFILE)
$(PDFLATEX) --shell-escape $(MAINFILE).tex
$(PDFLATEX) --shell-escape $(MAINFILE).tex
$(MV) $(MAINFILE).pdf $(MAINFILE)_distribution.pdf
$(MV) $(CLASSFILE)_presentation $(CLASSFILE)
@echo
@echo
# Snapshot
snapshot:
@echo
@echo " Making a snapshot of all files and folders"
@echo
$(MKDIR) -p Snapshots/$(DATETIME)
$(RSYNC) -a --exclude '*.swp' --exclude '.git' --exclude 'Snapshots' ./ Snapshots/$(DATETIME)/
cd Snapshots/ ; $(ZIP) -qr $(DATETIME).zip $(DATETIME)
cd Snapshots/ ; $(RM) -rf $(DATETIME)
@echo
@echo
# Clean up
clean:
@echo
@echo " Removing temporary files"
@echo
for tmpfile in $(TMPFILES); do ( $(RM) -f $(MAINFILE).$$tmpfile* ); done
$(RM) -f *.gnuplot *.table
@echo
@echo