aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/venti/srv/mkfile
blob: 2fd4508e888a4477c741bca2aa227aad0687116e (plain)
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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<$PLAN9/src/mkhdr
CC=9c

AR=ar

LIBOFILES=\
	arena.$O\
	arenas.$O\
	bloom.$O\
	buildbuck.$O\
	clump.$O\
	config.$O\
	conv.$O\
	dcache.$O\
	dump.$O\
	graph.$O\
	httpd.$O\
	icache.$O\
	icachewrite.$O\
	ifile.$O\
	index.$O\
	lump.$O\
	lumpcache.$O\
	lumpqueue.$O\
	part.$O\
	png.$O\
	round.$O\
	score.$O\
	sortientry.$O\
	stats.$O\
	syncarena.$O\
	syncindex0.$O\
	trace.$O\
	unwhack.$O\
	utils.$O\
	unittoull.$O\
	whack.$O\
	xml.$O\
	zblock.$O\
	zeropart.$O\

SLIB=libvs.a

LIB=$SLIB

HFILES=	dat.h\
	fns.h\
	stdinc.h\

TARG=\
	venti\
	fmtarenas\
	fmtbloom\
	fmtisect\
	fmtindex\
	buildindex\
	checkarenas\
	checkindex\
	clumpstats\
	findscore\
	rdarena\
	wrarena\
	syncindex\
	printarena\
	verifyarena\

OFILES=

BIN=$BIN/venti

it:V: $O.venti

$O.venti: # debugmalloc2.$O # debugmalloc.$O #_p9dir.$O debugmalloc.$O

CLEANFILES=$CLEANFILES $SLIB

<$PLAN9/src/mkmany

$SLIB: $LIBOFILES
	$AR rvc $SLIB $LIBOFILES

# xml.c:D:	mkxml dat.h
# 	./mkxml dat.h > xml.c

ainstall:V: ${TARG:%=%.ainstall}

%.ainstall:V:	$O.%
	scp $prereq amsterdam:/usr/local/bin/venti/$stem

test:VQ: ${TARG:%=o.%}
	slay o.venti|rc
	vtmp=/home/tmp
	echo '**********' FMTARENAS
	./o.fmtarenas -a 40M -b 8k arenas $vtmp/arena
	echo '**********' FMTBLOOM
	./o.fmtbloom -s 10M $vtmp/bloom
	echo '**********' FMTISECT
	./o.fmtisect -b 8k isect $vtmp/isect
	(
		echo index main
		echo isect $vtmp/isect
		echo arenas $vtmp/arena
		echo bloom $vtmp/bloom
		echo webroot $HOME/src/venti/www
		echo mem 64M
		echo icmem 64M
		echo bcmem 64M
	) >vtmp.conf
	echo '**********' FMTINDEX
	./o.fmtindex vtmp.conf
	echo '**********' VENTI
	# ./o.venti -c vtmp.conf -B 64M -I 64M -C 64M -a 'tcp!*!17034' -h 'tcp!*!8001'  >a 2>&1 &
	./o.venti -c vtmp.conf -a 'tcp!*!17034' -h 'tcp!*!8001'  >a 2>&1 &
	sleep 5
	echo '**********' VAC
	venti='tcp!127.0.0.1!17034' export venti
	9 time vac /usr/local/plan9 >a.vac
	case ${websync:-no} in
	yes)
		echo '**********' SYNC VIA WEB
		hget http://127.0.0.1:8001/flushdcache
		hget http://127.0.0.1:8001/flushicache
		hget http://127.0.0.1:8001/flushdcache
		echo '**********' KILL VENTI
		killall -9 o.venti
		;;
	no)
		echo '**********' KILL VENTI
		killall -9 o.venti
		echo '**********' SYNCINDEX
		./o.syncindex -B64M -I64M -f vtmp.conf
		;;
	esac
	echo '**********' CHECKINDEX
	./o.checkindex -B64M vtmp.conf /home/tmp/check >check.out
	wc check.out

luadisk.o: luadisk.c
	gcc -c -ggdb -Wall -I/usr/include/lua50 luadisk.c

libluadisk.so: luadisk.o
	gcc -shared -o $target luadisk.o -llua50 -llualib50

$O.xwrarena: xwrarena.$O
	$LD -o $target xwrarena.$O