3 C_FLAGS
= $(CFLAGS
) -I
$(srcdir) -I..
-I
$(srcdir)/..
-DDBZ_FINISH
='_IO_flush_all()'
4 CC
= `if [ -f ../../../gcc/gcc ] ; \
5 then echo ../../../gcc/gcc -B../../../gcc/ ; \
7 LIBIO
= ..
/libio.a ..
/..
/libiberty
/libiberty.a
14 LINTFLAGS
= -h
$(DEBUG
) $(RFC
) -I
$(srcdir)
16 # =()<NEWSBIN = @<NEWSBIN>@>()=
17 NEWSBIN
= /usr
/lib
/newsbin
18 # workaround for System V make bug
21 # database sizes for performance tests, regression, and regression prime-find
26 #### host and target dependent Makefile fragments come in here.
29 # history files for regression and performance tests
47 cmp dbz
$(NEWSBIN
)/dbz
53 ar ruv ..
/libcnews.a dbz.o
59 lint
$(LINTFLAGS
) dbzmain.c dbz.c
62 $(CC
) $(C_FLAGS
) -c
$<
65 $(CC
) $(C_FLAGS
) $(DEBUG
) -DDEFSIZE
=$(RSIZE
) -c rdbz.c
67 rdbzmain.o
: rdbzmain.c
68 $(CC
) $(C_FLAGS
) $(RFC
) -c rdbzmain.c
70 tdbz.o
: $(srcdir)/dbz.c
71 cp
$(srcdir)/dbz.c tdbz.c
72 $(CC
) $(C_FLAGS
) -DDEFSIZE
=$(TSIZE
) -c tdbz.c
75 dbz
: dbzmain.o
$(CASE
)
76 $(CC
) $(LDFLAGS
) dbzmain.o
$(CASE
) $(PRE
) $(DBM
) $(LIBS
) $(POST
) -o
$@
78 tdbz
: dbzmain.o tdbz.o
$(CASE
)
79 $(CC
) $(LDFLAGS
) dbzmain.o tdbz.o
$(CASE
) $(PRE
) $(LIBS
) $(POST
) -o
$@
81 rdbz
: rdbzmain.o rdbz.o
$(CASE
)
82 $(CC
) $(LDFLAGS
) rdbzmain.o rdbz.o
$(CASE
) $(PRE
) $(LIBS
) $(POST
) -o
$@
85 $(CC
) $(LDFLAGS
) fake.o random.o
$(PRE
) $(LIBS
) $(POST
) -o
$@
88 $(CC
) $(LDFLAGS
) byteflip.o
$(PRE
) $(LIBS
) $(POST
) -o
$@
91 .
/fake
-t
-e
75 10000 >$@
94 .
/fake
-t
-e
75 3300 >$@
97 .
/fake
-t
-e
75 13000 >$@
99 r
: $(srcdir)/getmap
$(srcdir)/revbytes
$(srcdir)/altbytes stamp-r8
103 : 'WARNING: creates about 2MB of debris; do "make rclean" afterward'
104 rm -f dbase dbase
[23] dbase.
* dbase
[23].
*
105 test ! -d xx || rmdir xx
108 stamp-r1
: $(RHIST
) $(R2HIST
) stamp-r0
109 : crude
check of synthetic history file
110 ( sed
25q
$(RHIST
) ; tail
-25 $(RHIST
) ) >histjunk
111 cmp histjunk
$(srcdir)/firstlast25
116 : basic tests
, exercising
as many options
as possible
120 .
/rdbz
-E
1000 -0 -M
-i
-S
-u
-U
-C xx dbase
122 sed
'/> 0/d' $(RHIST
) >dbase.used
123 test "`cat dbase.used | wc -l`" -eq
"`sed -n '2s/ .*//p' dbase.dir`" ;
127 .
/rdbz
-E
1000 -0 -p
$(RPSIZE
) -t
' ' dbase2
130 cmp dbase.
dir dbase2.
dir
131 cmp dbase.pag dbase2.pag
132 .
/rdbz
-E
1000 -0 -c dbase
133 .
/rdbz
-E
1000 -0 -c
-i
-q
-M
-U dbase
137 : build a database and then add to it
138 sed
1000q
$(RHIST
) >dbase2
139 sed
1,1000d
$(RHIST
) >dbase2.add
140 .
/rdbz
-E
1000 -0 dbase2
141 .
/rdbz
-E
1000 -0 -a dbase2 dbase2.add
143 cmp dbase.
dir dbase2.
dir
144 cmp dbase.pag dbase2.pag
148 : build based on existing one
, test extraction and readonly files
149 .
/rdbz
-E
1000 -0 -f dbase dbase2
150 test "`cat dbase.used | wc -l`" -eq
"`awk 'NR==2{print $$1}' dbase2.dir`" ;
151 test "`cat dbase.used | wc -l`" -eq
"`awk 'NR==2{print $$2}' dbase2.dir`" ;
152 chmod
-w dbase2.
dir dbase2.pag
153 .
/rdbz
-E
1000 -x dbase2 dbase
>dbase.temp
154 cmp dbase.used dbase.temp
158 : try some small case perversions
159 sed
's/\(@[^ ]*\)A/\1a/' dbase
>dbase.ick
160 .
/rdbz
-E
1000 -x dbase2 dbase.ick
>dbase.temp
161 cmp dbase.used dbase.temp
162 sed
-n
's/A\([^ ]*@\)/a\1/p' dbase
>dbase.ick
163 .
/rdbz
-x dbase2 dbase.ick
>dbase.temp
164 test ! -s dbase.temp
;
165 rm -f dbase2.
dir dbase2.pag
169 : try it without
tags, case-insensitive
, with case perversions
170 .
/rdbz
-E
1000 -0 -p
'0 b 1' dbase2
171 tr
'ABCDEFGHIJKLMnopqrstuvwxyz' 'abcdefghijklmNOPQRSTUVWXYZ' <dbase2
>dbase.ick
172 .
/rdbz
-E
1000 -x dbase2 dbase.ick
>dbase.temp
173 cmp dbase.used dbase.temp
174 rm -f dbase.temp dbase.ick
177 stamp-r7
: byteflip stamp-r6
178 : test various perversions of byte ordering
179 awk
-f
$(srcdir)/revbytes dbase.
dir >dbase2.
dir
180 .
/byteflip
`$(srcdir)/getmap dbase.dir` `$(srcdir)/getmap dbase2.dir` <dbase.pag
>dbase2.pag
182 .
/rdbz
-E
1000 -0 -c dbase2
183 awk
-f
$(srcdir)/altbytes dbase.
dir >dbase2.
dir
184 dd conv
=swab
<dbase.pag
>dbase2.pag
185 .
/rdbz
-E
1000 -0 -c dbase2
187 .
/rdbz
-E
1000 -0 -f dbase2 dbase3
188 .
/rdbz
-E
1000 -0 -c dbase3
189 test " `$(srcdir)/getmap dbase2.dir`" = " `$(srcdir)/getmap dbase3.dir`" ;
193 : test massive overflow
, throw in case sensitivity and tag mask
195 .
/rdbz
-E
1000 -0 -p
'0 0 7ffc0000' dbase
196 .
/rdbz
-E
1000 -0 -cq dbase
197 sed
100q dbase | egrep
'[aA].* ' | tr aA Aa
>dbase.ick
198 .
/rdbz
-x dbase dbase.ick
>dbase.temp
199 test ! -s dbase.temp
;
203 rm -f dbase dbase
[23] dbase.
* dbase
[23].
* fake fake.o random.o
204 rm -f rdbz rdbz.o rdbzmain.o
$(RHIST
) $(R2HIST
) byteflip byteflip.o
205 rm -f histjunk core stamp-r?
*~
206 test ! -d xx || rmdir xx
209 rm -f
*.o
[a-z
]dbz
[a-z
][a-z
]dbz junk
* PostScript.out
210 rm -f hist
* dbase
* *.bak mon.out gmon.out core dbm.h
216 rm -rf Makefile config.status rdbz.c rdbzmain.c
218 maintainer-clean
realclean: distclean