home *** CD-ROM | disk | FTP | other *** search
/ Gold Fish 1 / GoldFishApril1994_CD2.img / d4xx / d473 / cnewssrc / cnews_src.lzh / dbz / Makefile < prev    next >
Makefile  |  1990-12-15  |  5KB  |  170 lines

  1. #
  2. #    $Id$
  3. #
  4. # if no DBZDEBUG, use "COPTS = -bs -sob -wl -pa -DAMIGA -DFJE"
  5. COPTS = -bs -sabm -wl -pa -DAMIGA -DFJE -DDBZDEBUG
  6. CC = cc
  7.  
  8. # -lc before libcnews.a so we get fread etc. from system
  9. # DBMLIBS = -lc ../libcnews.a
  10. # FLAGS = -I../include
  11. # RFC = -DHAVERFCIZE
  12. CNLIB = +l /libcnews.lib +l
  13. FLAGS = -I/include
  14. RFC =
  15.  
  16. DEBUG = -DDBZDEBUG
  17. CFLAGS = $(COPTS) $(FLAGS)
  18. # LINTFLAGS = -h $(FLAGS) $(DEBUG) $(RFC)
  19. LDFLAGS = -g -w
  20. # -lmisc is replacement routines for some inefficient system functions;
  21. # if you [probably] don't have it just delete it from the next line...
  22. LIB = -lmisc -lc
  23. LD = ln
  24.  
  25. # workaround for System V make bug
  26. SHELL = /bin/sh
  27.  
  28. # database sizes for performance tests, regression, and regression prime-find
  29. TSIZE=12007
  30. RSIZE=4019
  31. RPSIZE=3012
  32.  
  33. # history files for regression and performance tests
  34. RHIST=hist3.3
  35. R2HIST=hist10
  36. THIST=hist13
  37.  
  38. .c.o:
  39.     $(CC) $(CFLAGS) $*.c
  40.  
  41. it:    dbz.o
  42.  
  43. all:    dbz
  44.  
  45. bininstall:    dbz
  46.     cp dbz $(NEWSBIN)
  47.  
  48. newsinstall:
  49.     : nothing
  50.  
  51. t:    tdbz fake
  52.  
  53. #rdbz.o:    dbz.c
  54. #    $(CC) $(CFLAGS) $(DEBUG) -DDEFSIZE=$(RSIZE) -o rdbz.o dbz.c
  55.  
  56. #rdbzmain.o:    dbzmain.c
  57. #    $(CC) $(CFLAGS) $(RFC) -o rdbzmain.o dbzmain.c
  58.  
  59. tdbz.o:    dbz.c
  60.     $(CC) $(CFLAGS) -DDEFSIZE=$(TSIZE) -o tdbz.o dbz.c
  61.  
  62. dbz:    dbzmain.o dbz.o
  63.     $(LD) $(LDFLAGS) dbzmain.o dbz.o -o $@ $(LIB) $(CNLIB)
  64.  
  65. tdbz:    dbzmain.o tdbz.o
  66.     $(LD) $(LDFLAGS) dbzmain.o tdbz.o -o $@ $(LIB) $(CNLIB)
  67.  
  68. #rdbz:    rdbzmain.o rdbz.o
  69. #    $(LD) $(LDFLAGS) rdbzmain.o rdbz.o -o $@ $(LIB) $(CNLIB)
  70.  
  71. #fake:    fake.o random.o
  72. #    $(LD) $(LDFLAGS) fake.o random.o -o $@ $(LIB) $(CNLIB)
  73.  
  74. #byteflip:    byteflip.o
  75. #    $(LD) $(LDFLAGS) byteflip.o -o $@ $(LIB) $(CNLIB)
  76.  
  77. #hist10:    fake
  78. #    fake -t -e 75 10000 >$@
  79.  
  80. #hist3.3:    fake
  81. #    fake -t -e 75 3300 >$@
  82.  
  83. #hist13:    fake
  84. #    fake -t -e 75 13000 >$@
  85.  
  86. #r:    rdbz $(RHIST) $(R2HIST) byteflip getmap revbytes altbytes
  87. #    : 'WARNING:  creates about 2MB of debris; do "make rclean" afterward'
  88. #    rm -f dbase dbase[23] dbase.* dbase[23].*
  89. #    test ! -d xx || rmdir xx
  90. #    : crude check of synthetic history file
  91. #    ( sed 25q $(RHIST) ; tail -25 $(RHIST) ) >histjunk
  92. #    cmp histjunk firstlast25
  93. #    rm histjunk
  94. #    : basic tests, exercising as many options as possible
  95. #    cp $(RHIST) dbase
  96. #    mkdir xx
  97. #    chmod -w xx
  98. #    rdbz -E 1000 -0 -M -i -S -u -U -C xx dbase
  99. #    rmdir xx
  100. #    sed '/>    0/d' $(RHIST) >dbase.used
  101. #    test "`cat dbase.used | wc -l`" -eq "`sed -n '2s/ .*//p' dbase.dir`" ;
  102. #    cp $(RHIST) dbase2
  103. #    rdbz -E 1000 -0 -p $(RPSIZE) -t '    ' dbase2
  104. #    cmp $(RHIST) dbase
  105. #    cmp dbase dbase2
  106. #    cmp dbase.dir dbase2.dir
  107. #    cmp dbase.pag dbase2.pag
  108. #    rdbz -E 1000 -0 -c dbase
  109. #    rdbz -E 1000 -0 -c -i -q -M -U dbase
  110. #    : build a database and then add to it
  111. #    sed 1000q $(RHIST) >dbase2
  112. #    sed 1,1000d $(RHIST) >dbase2.add
  113. #    rdbz -E 1000 -0 dbase2
  114. #    rdbz -E 1000 -0 -a dbase2 dbase2.add
  115. #    cmp dbase dbase2
  116. #    cmp dbase.dir dbase2.dir
  117. #    cmp dbase.pag dbase2.pag
  118. #    : build based on existing one, test extraction and readonly files
  119. #    rdbz -E 1000 -0 -f dbase dbase2
  120. #    test "`cat dbase.used | wc -l`" -eq "`awk 'NR==2{print $$1}' dbase2.dir`" ;
  121. #    test "`cat dbase.used | wc -l`" -eq "`awk 'NR==2{print $$2}' dbase2.dir`" ;
  122. #    chmod -w dbase2.dir dbase2.pag
  123. #    rdbz -E 1000 -x dbase2 dbase >dbase.temp
  124. #    cmp dbase.used dbase.temp
  125. #    : try some small case perversions
  126. #    sed 's/\(@[^     ]*\)A/\1a/' dbase >dbase.ick
  127. #    rdbz -E 1000 -x dbase2 dbase.ick >dbase.temp
  128. #    cmp dbase.used dbase.temp
  129. #    sed -n 's/A\([^     ]*@\)/a\1/p' dbase >dbase.ick
  130. #    rdbz -x dbase2 dbase.ick >dbase.temp
  131. #    test ! -s dbase.temp ;
  132. #    rm -f dbase2.dir dbase2.pag
  133. #    : try it without tags, case-insensitive, with case perversions
  134. #    rdbz -E 1000 -0 -p '0 b 1' dbase2
  135. #    tr '[A-M][n-z]' '[a-m][N-Z]' <dbase2 >dbase.ick
  136. #    rdbz -E 1000 -x dbase2 dbase.ick >dbase.temp
  137. #    cmp dbase.used dbase.temp
  138. #    rm -f dbase.temp dbase.ick
  139. #    : test various perversions of byte ordering
  140. #    awk -f revbytes dbase.dir >dbase2.dir
  141. #    chmod +x getmap
  142. #    byteflip `./getmap dbase.dir` `./getmap dbase2.dir` <dbase.pag >dbase2.pag
  143. #    cp dbase dbase2
  144. #    rdbz -E 1000 -0 -c dbase2
  145. #    awk -f altbytes dbase.dir >dbase2.dir
  146. #    dd conv=swab <dbase.pag >dbase2.pag
  147. #    rdbz -E 1000 -0 -c dbase2
  148. #    cp dbase2 dbase3
  149. #    rdbz -E 1000 -0 -f dbase2 dbase3
  150. #    rdbz -E 1000 -0 -c dbase3
  151. #    test " `./getmap dbase2.dir`" = " `./getmap dbase3.dir`" ;
  152. #    : test massive overflow, throw in case sensitivity and tag mask
  153. #    cp $(R2HIST) dbase
  154. #    rdbz -E 1000 -0 -p '0 0 7ff00000' dbase
  155. #    rdbz -E 1000 -0 -cq dbase
  156. #    sed 100q dbase | egrep '[aA].*    ' | tr aA Aa >dbase.ick
  157. #    rdbz -x dbase dbase.ick >dbase.temp
  158. #    test ! -s dbase.temp ;
  159. #    : success!
  160.  
  161. #rclean:
  162. #    rm -f dbase dbase[23] dbase.* dbase[23].* fake fake.o random.o
  163. #    rm -f rdbz rdbz.o rdbzmain.o $(RHIST) $(R2HIST) byteflip byteflip.o
  164. #    rm -f histjunk core
  165. #    test ! -d xx || rmdir xx
  166.  
  167. #clean:    rclean
  168. #    rm -f *.o dbz [a-z]dbz [a-z][a-z]dbz junk* PostScript.out
  169. #    rm -f hist* dbase* *.bak mon.out gmon.out core dbm.h
  170.