-
Notifications
You must be signed in to change notification settings - Fork 24
Expand file tree
/
Copy pathMakefile
More file actions
178 lines (166 loc) · 4.18 KB
/
Makefile
File metadata and controls
178 lines (166 loc) · 4.18 KB
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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
#
# Makefile
# Makefile to systematically compile the john_DEGREE.tex to produce
# john_DEGREE.pdf (and clean up temporary files).
#
# In order to create the PDF file, 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.
#
# DO NOT send your questions, comments and/or concerns about this template to
# Michigan Tech's Graduate School staff. Instead, please contact
#
# Gowtham
# Director of Research Computing, IT
# Adj. Asst. Professor, Physics/ECE
# Michigan Technological University
# Email: g@mtu.edu
#
# 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
SLEEP = sleep
LATEX = latex
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")
#
# List of class and style files
CLASSFILE = MichiganTech.cls
STYLEFILES = Packages/MS.sty \
Packages/PhD.sty
#
# List of folders
FOLDERS = Appendices Chapters FrontMatter References
#
# List of files
TEXFILES = FrontMatter/Abstract.tex \
FrontMatter/Acknowledgments.tex \
FrontMatter/Dedication.tex \
FrontMatter/Preface.tex \
Chapters/Chapter1.tex \
Chapters/Chapter2.tex \
Chapters/Chapter3.tex \
References/References.tex \
References/References.bib \
Appendices/AppendixA.tex \
Appendices/AppendixB.tex \
Appendices/AppendixC.tex
#
# 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 dvi
make ps
make pdf
make clean
dvi: $(MAINFILE).tex $(TEXFILES) $(CLASSFILE) $(STYLEFILES)
@echo
@echo " LaTeX --> DVI"
$(LATEX) --shell-escape $(MAINFILE)
$(LATEX) --shell-escape $(MAINFILE)
$(BIBTEX) $(MAINFILE)
$(BIBTEX) $(MAINFILE)
$(LATEX) --shell-escape $(MAINFILE)
$(LATEX) --shell-escape $(MAINFILE)
ps: $(MAINFILE).dvi
@echo
@echo " DVI --> PS"
@echo
$(DVIPS) -R0 -Ppdf -t letter -o $(MAINFILE).ps $<
@echo
@echo " Fixing any Gnuplot mess"
@echo
# If using a Mac, comment the line below, and uncomment the commented
# lines
$(SED) -i '/^SDict begin \[$$/,/^end$$/d' $(MAINFILE).ps
# $(SED) '/^SDict begin \[$$/,/^end$$/d' $(MAINFILE).ps > $(MAINFILE)_tmp.ps
# mv $(MAINFILE)_tmp.ps $(MAINFILE).ps
pdf: $(MAINFILE).ps
@echo
@echo " PS --> PDF (embedded fonts)"
@echo
$(PS2PDF) -dPDFSETTINGS=/prepress -dSubsetFonts=true -dEmbedAllFonts=true -dMaxSubsetPct=100 $< $(MAINFILE).pdf
@echo
@echo
snapshot:
@echo
@echo " Making a snapshot of all files and folders"
$(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
clean:
@echo
@echo " Removing temporary files"
@echo
for tmpfile in $(TMPFILES); do ( $(RM) -f $(MAINFILE).$$tmpfile* ); done
@echo
for folder in $(FOLDERS); do ( cd $$folder; for tmpfile in $(TMPFILES); do ( $(RM) -f *.$$tmpfile* ); done ); done
@echo
rm -f *.gnuplot *.table
@echo