|
|
1.1 root 1: srcdir = .
2: CFLAGS = -g
3: C_FLAGS = $(CFLAGS) -I$(srcdir) -I.. -I$(srcdir)/.. $(XTRAFLAGS) -DDBZ_FINISH='_IO_flush_all()'
4: CC = `if [ -f ../../../gcc/gcc ] ; \
5: then echo ../../../gcc/gcc -B../../../gcc/ ; \
6: else echo gcc ; fi`
7: LIBIO = ../libio.a ../../libiberty/libiberty.a
8: LIBS = $(LIBIO)
9: # LIBS = ../libcnews.a
10: DBM =
11: RFC = -DHAVERFCIZE
12: CASE = case.o
13: DEBUG = -DDBZDEBUG
14: LINTFLAGS = -h $(DEBUG) $(RFC) -I$(srcdir)
15: LDFLAGS =
16: # =()<NEWSBIN = @<NEWSBIN>@>()=
17: NEWSBIN = /usr/lib/newsbin
18: # workaround for System V make bug
19: SHELL = /bin/sh
20:
21: # database sizes for performance tests, regression, and regression prime-find
22: TSIZE=12007
23: RSIZE=4019
24: RPSIZE=2679
25:
26: #### host and target dependent Makefile fragments come in here.
27: ##
28:
29: # history files for regression and performance tests
30: RHIST=hist3.3
31: R2HIST=hist10
32: THIST=hist13
33:
34: #all: dbz
35: all:
36: install:
37: install-info:
38: info:
39:
40: check: r rclean
41:
42: bininstall: dbz
43: cp dbz $(NEWSBIN)
44:
45: cmp: dbz
46: cmp dbz $(NEWSBIN)/dbz
47:
48: newsinstall:
49: : nothing
50:
51: u: dbz.o
52: ar ruv ../libcnews.a dbz.o
53: cmp dbz.h ../h/dbz.h
54:
55: t: tdbz fake
56:
57: lint:
58: lint $(LINTFLAGS) dbzmain.c dbz.c
59:
60: .c.o:
61: $(CC) $(C_FLAGS) -c $<
62:
63: rdbz.o: rdbz.c
64: $(CC) $(C_FLAGS) $(DEBUG) -DDEFSIZE=$(RSIZE) -c rdbz.c
65:
66: rdbzmain.o: rdbzmain.c
67: $(CC) $(C_FLAGS) $(RFC) -c rdbzmain.c
68:
69: tdbz.o: $(srcdir)/dbz.c
70: cp $(srcdir)/dbz.c tdbz.c
71: $(CC) $(C_FLAGS) -DDEFSIZE=$(TSIZE) -c tdbz.c
72: rm tdbz.c
73:
74: dbz: dbzmain.o $(CASE)
75: $(CC) $(LDFLAGS) dbzmain.o $(CASE) $(PRE) $(DBM) $(LIBS) $(POST) -o $@
76:
77: tdbz: dbzmain.o tdbz.o $(CASE)
78: $(CC) $(LDFLAGS) dbzmain.o tdbz.o $(CASE) $(PRE) $(LIBS) $(POST) -o $@
79:
80: rdbz: rdbzmain.o rdbz.o $(CASE)
81: $(CC) $(LDFLAGS) rdbzmain.o rdbz.o $(CASE) $(PRE) $(LIBS) $(POST) -o $@
82:
83: fake: fake.o random.o
84: $(CC) $(LDFLAGS) fake.o random.o $(PRE) $(LIBS) $(POST) -o $@
85:
86: byteflip: byteflip.o
87: $(CC) $(LDFLAGS) byteflip.o $(PRE) $(LIBS) $(POST) -o $@
88:
89: hist10: fake
90: ./fake -t -e 75 10000 >$@
91:
92: hist3.3: fake
93: ./fake -t -e 75 3300 >$@
94:
95: hist13: fake
96: ./fake -t -e 75 13000 >$@
97:
98: r: rdbz $(RHIST) $(R2HIST) byteflip $(srcdir)/getmap $(srcdir)/revbytes $(srcdir)/altbytes stamp-r8
99: : success!
100:
101: stamp-r0:
102: : 'WARNING: creates about 2MB of debris; do "make rclean" afterward'
103: rm -f dbase dbase[23] dbase.* dbase[23].*
104: test ! -d xx || rmdir xx
105: @touch stamp-r0
106:
107: stamp-r1: stamp-r0
108: : crude check of synthetic history file
109: ( sed 25q $(RHIST) ; tail -25 $(RHIST) ) >histjunk
110: cmp histjunk $(srcdir)/firstlast25
111: rm histjunk
112: @touch stamp-r1
113:
114: r2a: stamp-r1
115: : basic tests, exercising as many options as possible
116: cp $(RHIST) dbase
117: mkdir xx
118: chmod -w xx
119: ./rdbz -E 1000 -0 -M -i -S -u -U -C xx dbase
120: rmdir xx
121: sed '/> 0/d' $(RHIST) >dbase.used
122: test "`cat dbase.used | wc -l`" -eq "`sed -n '2s/ .*//p' dbase.dir`" ;
123:
124: stamp-r2: r2a
125: cp $(RHIST) dbase2
126: ./rdbz -E 1000 -0 -p $(RPSIZE) -t ' ' dbase2
127: cmp $(RHIST) dbase
128: cmp dbase dbase2
129: cmp dbase.dir dbase2.dir
130: cmp dbase.pag dbase2.pag
131: ./rdbz -E 1000 -0 -c dbase
132: ./rdbz -E 1000 -0 -c -i -q -M -U dbase
133: @touch stamp-r2
134:
135: stamp-r3: stamp-r2
136: : build a database and then add to it
137: sed 1000q $(RHIST) >dbase2
138: sed 1,1000d $(RHIST) >dbase2.add
139: ./rdbz -E 1000 -0 dbase2
140: ./rdbz -E 1000 -0 -a dbase2 dbase2.add
141: cmp dbase dbase2
142: cmp dbase.dir dbase2.dir
143: cmp dbase.pag dbase2.pag
144: @touch stamp-r3
145:
146: stamp-r4: stamp-r3
147: : build based on existing one, test extraction and readonly files
148: ./rdbz -E 1000 -0 -f dbase dbase2
149: test "`cat dbase.used | wc -l`" -eq "`awk 'NR==2{print $$1}' dbase2.dir`" ;
150: test "`cat dbase.used | wc -l`" -eq "`awk 'NR==2{print $$2}' dbase2.dir`" ;
151: chmod -w dbase2.dir dbase2.pag
152: ./rdbz -E 1000 -x dbase2 dbase >dbase.temp
153: cmp dbase.used dbase.temp
154: @touch stamp-r4
155:
156: stamp-r5: stamp-r4
157: : try some small case perversions
158: sed 's/\(@[^ ]*\)A/\1a/' dbase >dbase.ick
159: ./rdbz -E 1000 -x dbase2 dbase.ick >dbase.temp
160: cmp dbase.used dbase.temp
161: sed -n 's/A\([^ ]*@\)/a\1/p' dbase >dbase.ick
162: ./rdbz -x dbase2 dbase.ick >dbase.temp
163: test ! -s dbase.temp ;
164: rm -f dbase2.dir dbase2.pag
165: @touch stamp-r5
166:
167: stamp-r6: stamp-r5
168: : try it without tags, case-insensitive, with case perversions
169: ./rdbz -E 1000 -0 -p '0 b 1' dbase2
170: tr '[A-M][n-z]' '[a-m][N-Z]' <dbase2 >dbase.ick
171: ./rdbz -E 1000 -x dbase2 dbase.ick >dbase.temp
172: cmp dbase.used dbase.temp
173: rm -f dbase.temp dbase.ick
174: @touch stamp-r6
175:
176: stamp-r7: stamp-r6
177: : test various perversions of byte ordering
178: awk -f $(srcdir)/revbytes dbase.dir >dbase2.dir
179: ./byteflip `$(srcdir)/getmap dbase.dir` `$(srcdir)/getmap dbase2.dir` <dbase.pag >dbase2.pag
180: cp dbase dbase2
181: ./rdbz -E 1000 -0 -c dbase2
182: awk -f $(srcdir)/altbytes dbase.dir >dbase2.dir
183: dd conv=swab <dbase.pag >dbase2.pag
184: ./rdbz -E 1000 -0 -c dbase2
185: cp dbase2 dbase3
186: ./rdbz -E 1000 -0 -f dbase2 dbase3
187: ./rdbz -E 1000 -0 -c dbase3
188: test " `$(srcdir)/getmap dbase2.dir`" = " `$(srcdir)/getmap dbase3.dir`" ;
189: @touch stamp-r7
190:
191: stamp-r8: stamp-r7
192: : test massive overflow, throw in case sensitivity and tag mask
193: cp $(R2HIST) dbase
194: ./rdbz -E 1000 -0 -p '0 0 7ffc0000' dbase
195: ./rdbz -E 1000 -0 -cq dbase
196: sed 100q dbase | egrep '[aA].* ' | tr aA Aa >dbase.ick
197: ./rdbz -x dbase dbase.ick >dbase.temp
198: test ! -s dbase.temp ;
199: @touch stamp-r8
200:
201: rclean:
202: rm -f dbase dbase[23] dbase.* dbase[23].* fake fake.o random.o
203: rm -f rdbz rdbz.o rdbzmain.o $(RHIST) $(R2HIST) byteflip byteflip.o
204: rm -f histjunk core stamp-r? *~
205: test ! -d xx || rmdir xx
206:
207: clean: rclean
208: rm -f *.o dbz [a-z]dbz [a-z][a-z]dbz junk* PostScript.out
209: rm -f hist* dbase* *.bak mon.out gmon.out core dbm.h
210:
211: distclean: clean
212: rm -rf Makefile config.status rdbz.c rdbzmain.c
213:
214: realclean: distclean
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.