-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
69 lines (55 loc) · 1.96 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
# NOTE: This program was automatically generated by the Nuweb
# literate programming tool. It is not intended to be modified
# directly. If you wish to modify the code or use it in another
# project, you should start with the master, which is kept in the
# file orbits.w in the public GitHub repository:
# https://github.com/Fourmilab/orbits.git
# and is documented in the file orbits.pdf in the root directory
# of that repository.
PROJECT = orbits
# Path names for build utilities
NUWEB = nuweb
LATEX = xelatex
PDFVIEW = evince
LSLINT = lslint
GNUFIND = find
duh:
@echo "What'll it be, mate? build view peek lint stats clean"
build:
perl tools/build/update_build.pl
$(NUWEB) -t $(PROJECT).w
@if [ \( ! -f Makefile \) -o \( Makefile.mkf -nt Makefile \) ] ; then \
echo Makefile.mkf is newer than Makefile ; \
sed "s/ \*$$//" Makefile.mkf | unexpand >Makefile ; \
fi
view:
$(NUWEB) -o -r $(PROJECT).w
$(LATEX) $(PROJECT).tex
# We have to re-run Nuweb to incorporate the updated TOC
$(NUWEB) -o -r $(PROJECT).w
$(LATEX) $(PROJECT).tex
$(PDFVIEW) $(PROJECT).pdf
peek:
$(PDFVIEW) $(PROJECT).pdf
lint:
@# Uses GNU find extension to quit on first lslint error
$(GNUFIND) scripts -type f -name \*.lsl -print \
\( -exec $(LSLINT) {} \; -o -quit \)
stats:
@echo Build `grep "Build number" build.w | sed 's/[^0-9]//g'` \
`grep "Build date and time " build.w | \
sed 's/[^:0-9 \-]//g' | sed 's/^ *//'`
@echo Web: `wc -l *.w`
@echo Scripts: `find scripts -type f -name \*.lsl -print | wc -l`
@echo Lines: `find scripts -type f -name \*.lsl -exec cat {} \; | wc -l`
@if [ -f $(PROJECT).log ] ; then \
echo -n "Pages: " ; \
tail -5 $(PROJECT).log | grep pages | sed 's/[^0-9]//g' ; \
fi
clean:
rm -f nw[0-9]*[0-9] rm *.aux *.log *.out *.pdf *.tex *.toc
squeaky:
#make clean
#rm -f Makefile.mkf
#find scripts -type f -name \*.lsl -exec rm -f {} \;
# Need to clean tools directory after all integrated here