-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
126 lines (102 loc) · 3.38 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
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
# 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 blockchain_tools.w in the public GitHub repository:
# https://github.com/Fourmilab/blockchain_tools.git
# and is documented in the file blockchain_tools.pdf in the root directory
# of that repository.
PROJECT = blockchain_tools
VERSION = 1.0.5
# Path names for build utilities
NUWEB = nuweb
LATEX = xelatex
PDFVIEW = evince
GNUFIND = find
duh:
@echo "What'll it be, mate? build view pdf peek gview gpdf geek lint stats clean bl"
build:
perl tools/build/update_build.pl
$(NUWEB) -t $(PROJECT).w
chmod 755 perl/*.pl
chmod 755 python/*.py
@if [ \( ! -f Makefile \) -o \( Makefile.mkf -nt Makefile \) ] ; then \
echo Makefile.mkf is newer than Makefile ; \
sed "s/ \*$$//" Makefile.mkf | unexpand >Makefile ; \
fi
pdf:
rm -f $(PROJECT).log $(PROJECT).toc $(PROJECT).out $(PROJECT).aux
$(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
view:
make pdf
$(PDFVIEW) $(PROJECT).pdf
peek:
$(PDFVIEW) $(PROJECT).pdf
gpdf:
rm -f $(PROJECT)_user_guide.log $(PROJECT)_user_guide.toc \
$(PROJECT)_user_guide.out $(PROJECT)_user_guide.aux
$(NUWEB) -o -r $(PROJECT).w
sed -e '/^\\expunge{begin}{userguide}$$/,/^\\expunge{end}{userguide}$$/d' \
$(PROJECT).tex | \
sed -e 's/\\impunge{userguide}//' >$(PROJECT)_user_guide.tex
$(LATEX) $(PROJECT)_user_guide.tex
$(LATEX) $(PROJECT)_user_guide.tex
gview:
make gpdf
$(PDFVIEW) $(PROJECT)_user_guide.pdf
geek:
$(PDFVIEW) $(PROJECT)_user_guide.pdf
lint:
@# Uses GNU find extension to quit on first error
$(GNUFIND) perl tools -type f -name \*.pl -print \
\( -exec perl -c {} \; -o -quit \)
bl:
make --no-print-directory build
make --no-print-directory lint
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 Lines: `find . -type f \( -wholename ./perl/\*.pl \
-o -wholename ./python/\*.py \) -exec cat {} \; | wc -l`
@if [ -f $(PROJECT).log ] ; then \
echo -n "Pages: " ; \
tail -5 $(PROJECT).log | grep pages | sed 's/[^0-9]//g' ; \
fi
dist:
make bl
make pdf
make gpdf
cp -pv perl/*.pl python/*.py bin
cp -pv $(PROJECT).pdf $(PROJECT)_user_guide.pdf doc
release:
rm -rf $(PROJECT)-$(VERSION)
tar cfv release_temp.tar \
*.w Makefile bin doc \
figures perl/.keep python/.keep tools \
--exclude="test/test_output" test
mkdir $(PROJECT)-$(VERSION)
( cd $(PROJECT)-$(VERSION) ; tar xfv ../release_temp.tar )
rm release_temp.tar
tar cfvz $(PROJECT)-$(VERSION).tar.gz $(PROJECT)-$(VERSION)
rm -rf $(PROJECT)-$(VERSION)
clean:
rm -f nw[0-9]*[0-9] rm *.aux *.log *.out *.pdf *.tex *.toc \
perl/*.pl python/*.py *.gz bin/*.p[ly] doc/*.pdf
rm -rf test/test_output
squeaky:
make clean
rm -f Makefile.mkf
regress:
@if cmp -s perl/blockchain_address.pl bin/blockchain_address.pl; [ $$? -ne 0 ] ; \
then \
echo "Did you forget to make dist?" ; \
fi
/bin/bash test/test.sh
regress_update:
cp -p test/test_output/test_log.txt test/test_log_expected.txt