-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
71 lines (54 loc) · 1.64 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
# Make File for creating Tex documents in Linux with bibliographies in the .bib form.
# Made by Nat Welch
#
# Targets:
#
# ps --- builds the postscript version of the document
# pdf --- builds the pdf version of the document
# all --- builds both the pdf and ps versions of the document
# clean --- cleans up everything that can be regenerated
# Your Shell
SH = /bin/bash
# Your Tex files
TEXFILES = texreport.tex
# Your Bib files
BIBFILES = texreport.bib
# The name of your compiled files (x.pdf and x.ps)
NAME = texreport
# The location of your tex compiler
LATEX = pdflatex
BIBTEX = bibtex
PS = dvips
# Compile flags
PSFLAGS = -f -t letter -Ppdf
# Begin target definitions
all: ps pdf smallclean
ps: $(NAME).ps
pdf: $(NAME).pdf
wordcount: $(TEXFILES)
@./scripts/texcount.pl $(TEXFILES)
smallprint: $(NAME).pdf
lpr -P Deskjet_F4200 -o page-ranges=1-12 $(NAME).pdf
print: $(NAME).pdf
lpr -P Deskjet_F4200 $(NAME).pdf
%.ps: %.dvi
$(PS) $(PSFLAGS) $(NAME).dvi > $(NAME).ps
%.pdf: %.ps
@gs -q -sDEVICE=pdfwrite -sOutputFile=$@ -dNOPAUSE -dBATCH $<
%.dvi: $(TEXFILES) $(BIBFILES)
@echo " --- Running LaTeX"
$(LATEX) $(TEXFILES)
@echo " --- Running BibTeX"
$(BIBTEX) $(NAME)
@echo " Running LaTeX until complete"
if $(LATEX) $(TEXFILES) | tee /dev/tty | fgrep -is rerun; then \
@echo " --- Rerunning LaTeX"; \
while $(LATEX) $(TEXFILES) | fgrep -is rerun; do \
@echo " Re-Rerunning LaTeX"; \
done; \
fi
smallclean:
rm -f $(NAME).dvi $(NAME).log $(NAME).aux *~ *.bbl *.blg *.toc
rm -f $(NAME).bbl $(NAME).blg $(NAME).synctex.gz
clean: smallclean
rm -f $(NAME).ps $(NAME).pdf