-
Notifications
You must be signed in to change notification settings - Fork 143
/
Makefile
40 lines (32 loc) · 906 Bytes
/
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
SRC=xv6-riscv-src/
T=latex.out
TEX=$(patsubst %,$(T)/%,$(wildcard *.tex))
SPELLTEX=$(wildcard *.tex)
all: book.pdf
.PHONY: all src clean
$(T)/%.tex: %.tex | src
mkdir -p latex.out
./lineref $(notdir $@) $(SRC) > $@
src:
if [ ! -d $(SRC) ]; then \
git clone git@github.com:mit-pdos/xv6-riscv.git $(SRC) ; \
else \
git -C $(SRC) pull ; \
fi; \
true
book.pdf: src book.tex $(TEX)
pdflatex book.tex
bibtex book
pdflatex book.tex
pdflatex book.tex
clean:
rm -f book.aux book.idx book.ilg book.ind book.log\
book.toc book.bbl book.blg book.out
rm -rf latex.out
rm -rf $(SRC)
spell:
@ for i in $(SPELLTEX); do aspell --mode=tex -p ./aspell.words -c $$i; done
@ for i in $(SPELLTEX); do perl bin/double.pl $$i; done
@ for i in $(SPELLTEX); do perl bin/capital.py $$i; done
@ ( head -1 aspell.words ; tail -n +2 aspell.words | sort ) > aspell.words~
@ mv aspell.words~ aspell.words