-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
44 lines (44 loc) · 1.69 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
NAME = utfpr-pg
EX = exemplos
TCC = $(EX)/exemplo-tcc
SHELL = bash
PWD = $(shell pwd)
TEMP := $(shell mktemp -d)
TDIR = $(TEMP)/$(NAME)
VERS = $(shell ltxfileinfo -v $(NAME).dtx)
UTREE = $(shell kpsewhich --var-value TEXMFHOME)
LOCAL = $(shell kpsewhich --var-value TEXMFLOCAL)
all: $(NAME).pdf clean
$(NAME).cls: $(NAME).dtx
pdflatex -shell-escape -recorder $(NAME).dtx
$(NAME).pdf: $(NAME).dtx
pdflatex -shell-escape -recorder $(NAME).dtx
bibtex $(NAME).aux
if [ -f $(NAME).glo ]; then makeindex -q -s gglo.ist -o $(NAME).gls $(NAME).glo; fi
if [ -f $(NAME).idx ]; then makeindex -q -s gind.ist -o $(NAME).ind $(NAME).idx; fi
pdflatex --recorder --interaction=nonstopmode $(NAME).dtx > /dev/null
pdflatex --recorder --interaction=nonstopmode $(NAME).dtx > /dev/null
tcc: $(TCC).tex $(NAME).cls
pdflatex -shell-escape -recorder --output-directory=$(EX) $(TCC).tex
cp $(TCC).bib ./
bibtex $(TCC).aux
bibtex $(EX)/this.aux
bibtex $(EX)/thisen.aux
pdflatex --recorder --interaction=nonstopmode --output-directory=$(EX) $(TCC).tex > /dev/null
pdflatex --recorder --interaction=nonstopmode --output-directory=$(EX) $(TCC).tex > /dev/null
make clean
clean:
find -maxdepth 1 -iregex '.*\.\(log\|aux\|lof\|lot\|bit\|idx\|glo\|bbl\|ilg\|toc\|ind\|ins\|out\|blg\|synctex.gz\|log\|bm\|brf\|bak\|bst\|fls\|loq\|hd\)' -delete
rm -f *.bib
distclean: clean
rm -f $(NAME).{pdf,cls}
rm -f $(TCC).{pdf,cls}
inst: all
mkdir -p $(UTREE)/{tex,source,doc}/latex/$(NAME)
cp $(NAME).dtx $(UTREE)/source/latex/$(NAME)
cp $(NAME).cls $(UTREE)/tex/latex/$(NAME)
cp $(NAME).pdf $(UTREE)/doc/latex/$(NAME)
zip: all
mkdir $(TDIR)
cp $(NAME).{pdf,cls,dtx} $(TDIR)
cd $(TEMP); zip -Drq $(PWD)/$(NAME)-$(VERS).zip $(NAME)