home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 October / usenetsourcesnewsgroupsinfomagicoctober1994disk2.iso / unix / volume24 / yabbawhap / part01 / Makefile next >
Makefile  |  1991-10-09  |  9KB  |  208 lines

  1. CC=cc
  2. CCOPTS=-O2 -DTYPE=int -DPTRS -DBZERO -DRANDINIT="getpid()"
  3.  
  4. # These options would be best to compile ``large'' yabba and unyabba
  5. # on a Sun or other generic 32-bit UNIX machine:
  6. # CCOPTS=-O2 -DTYPE=int -DPTRS -DBZERO -DZEROFILLED -DRANDINIT="getpid()"
  7. # On a System V machine, -DMEMZERO should be used instead of -DBZERO.
  8. # If you want more speed, add -DMOD=131072.
  9. # For large compressions, try -DNODEMAX=500000 -DMOD=1048576 -DNODENUM=65533.
  10. # On a small machine, these options might be more appropriate:
  11. # CCOPTS=-O2 -DTYPE=short -DOPTCANT5
  12. # To see what the options mean and find out what other options are
  13. # available, keep reading.
  14.  
  15. # You should already have run the sysconf script (at least on any UNIX box)
  16. # to test for system features. sysconf may have modified the CCOPTS line
  17. # on line 2 of this Makefile.
  18.  
  19. # To check your configuration decisions before compiling, type
  20. # % make checkconf
  21. # % ./checkconf
  22. # or something equivalent on non-UNIX systems, and read through
  23. # checkconf's output. You can give checkconf any -D or -U options to
  24. # see what effect changes will have. On a UNIX machine, you can use
  25. # the ``try'' shell script to test yabba and unyabba and see how they
  26. # measure up against compress and uncompress in speed and effectiveness.
  27.  
  28. # TYPE and PTRS have the biggest effect on how yabba and unyabba operate.
  29. #
  30. # TYPE is the type that yabba and unyabba will use for indexing. It
  31. # should almost certainly be either short or int. If PTRS is defined,
  32. # yabba (and unyabba and whap, but not unwhap) will use pointers rather
  33. # than integers wherever possible. On almost all machines yabba runs
  34. # faster with -DPTRS. More precisely:
  35. #
  36. # -UPTRS -DTYPE=short: Use shorts. This is ``small'' yabba and unyabba.
  37. # -UPTRS -DTYPE=int: Use ints everywhere. On large machines this is
  38. # usually quite a bit faster than the small version, but also uses
  39. # twice as much memory.
  40. # -DPTRS -DTYPE=short: small unwhap, but use pointers in yabba
  41. # wherever possible. This typically doubles yabba's memory use.
  42. # -DPTRS -DTYPE=int: Use ints everywhere, with pointers wherever
  43. # possible. This is ``large'' yabba and unyabba. On large machines it is
  44. # the fastest configuration, but uses twice as much memory as ``small.''
  45. #
  46. # If you want to generate very large-block compressions (see below)
  47. # on a small machine where int is 16 bits, you may want to try compiling
  48. # with -DPTRS -DTYPE=long.
  49.  
  50. # NODEMAX and NODENUM control the compression block size.
  51. #
  52. # Any adaptive dictionary compressor has a block size. It can keep
  53. # track of this much input, or this much output, or this many strings
  54. # at once, and compress by looking for patterns in the input data.
  55. # But eventually there's too much to keep track of, and the compressor
  56. # has to stop adapting to the patterns.
  57. #
  58. # In the LZW-based UNIX ``compress'' program, for instance, the block
  59. # size is stated as the number of bits that the coder can use to
  60. # identify strings in its dictionary. Once it runs out of identifying
  61. # numbers, it can't adapt any further.
  62. #
  63. # In this compressor, the natural block size is the size of input.
  64. # NODENUM sets the number of bytes of input that yabba can adapt to at
  65. # once. Past that it will stick to the current dictionary as long as the
  66. # patterns seem useful, then clear the strings and start adapting all
  67. # over again.
  68. #
  69. # The user can set NODENUM dynamically with -m. NODEMAX (minimum 512,
  70. # default 65533---NODEMAX + 2 must fit into TYPE) sets the maximum
  71. # possible value; several fixed arrays in yabba and unyabba are
  72. # dimensioned with size NODEMAX. NODENUM defaults to NODEMAX.
  73. #
  74. # NODENUM and NODEMAX also control the size of input expected by unyabba.
  75. # unyabba *must* be given the same -m parameter as yabba was given for
  76. # compression. That means that if you compress on one machine where
  77. # yabba has NODENUM set to 60000, you won't be able to decompress on
  78. # another machine where unyabba has NODEMAX set to 20000. -m has the
  79. # same effect on portability that -b does for compress (though -m is
  80. # expressed in somewhat more tractable units).
  81.  
  82. # MOD (default 65536) is the size of a hash table kept by yabba. It must
  83. # be a power of two. It should be on a similar order of magnitude as
  84. # NODEMAX---if it is much too small, the hash table will be too crowded,
  85. # and if it is much too big, the table will waste memory.
  86.  
  87. # BITBUFSIZE only affects yabba (at the moment). It is the size of two
  88. # output buffers kept by the bit-packing coroutines. It defaults to 1000.
  89.  
  90. # HASHTYPE (default TYPE) is the type used for storing hash values in
  91. # yabba. It has little effect on whap memory use, so on large machines
  92. # you may want to set -DHASHTYPE=int even for small whap. However, it
  93. # does affect memory use in yabba and unyabba, so -DHASHTYPE=short may
  94. # be useful. In any case, MOD - 1 must fit into unsigned HASHTYPE.
  95.  
  96. # RESETNUM (default 8192) and RESETFUZZ (default 30, can be negative)
  97. # control how yabba decides when to clear its dictionary. After NODENUM or
  98. # the -m limit is reached, yabba checks every RESETNUM input characters
  99. # whether compression is still worth it. RESETFUZZ has some vaguely
  100. # defined effect on the meaning of ``worth it'': the higher RESETFUZZ
  101. # is, the longer yabba holds out before clearing the old patterns. The user
  102. # can change RESETFUZZ and RESETNUM dynamically, so don't worry about them
  103. # too much.
  104.  
  105. # Under -r, yabba needs some reasonably random value from the environment.
  106. # If you define an integer RANDINIT, yabba will initialize its generator
  107. # based on that value. Otherwise it has to stick to a default sequence,
  108. # which does not add as much security. (If you can't think up a good
  109. # definition for RANDINIT, open up your phone book and pick a number.)
  110.  
  111. # Many operating systems have brain-damaged putc(): if you put a
  112. # (perfectly valid) 255 byte, putc() will return EOF, indicating an error.
  113. # This is the case under Ultrix 3.1 and Convex UNIX 8.0, for instance.
  114. # You MUST define -DBRAINDAMAGED if sysconf tells you to; otherwise yabba
  115. # and unyabba will crash mysteriously. Also complain to your vendor.
  116.  
  117. # If your compiler blows up on yw.c, you may want to set -DOPTCANT5.
  118. # This will change certain heavily unrolled loops to lightly unrolled.
  119. # If that still doesn't help, try -DOPTCANT2; then -DOPTCANT1.
  120.  
  121. # If the internal representation of the NULL pointer on your machine is
  122. # 0, you can make yabba run slightly faster with -DBZERO or -DMEMZERO.
  123. # (checkconf will tell you if this is true.) If you have bzero(), use
  124. # -DBZERO. If you have ANSI memset(), use -DMEMZERO. If you have
  125. # neither, you're out of luck. MEMZERO is ignored under -DBZERO.
  126.  
  127. # If you have a machine with particularly fast memory access (perhaps
  128. # certain microcomputers), you might try defining -DHASHPTRS. This will
  129. # use some more memory but may run faster. I have not seen any machines
  130. # where -DHASHPTRS helps.
  131.  
  132. # Finally, you should set -DZEROFILLED if your operating system
  133. # guarantees that static arrays are initialized to zeros. Don't set it
  134. # under -DPTRS if NULL pointers don't have internal representation 0.
  135. # ZEROFILLED just makes yabba start up a bit faster. (checkconf warns you
  136. # if it notices a non-zero-filled array, but its test isn't guaranteed.)
  137. # UNIX systems generally guarantee -DZEROFILLED.
  138.  
  139. # All of the above comments apply equally to whap as to yabba except
  140. # where otherwise noted.
  141.  
  142. default: all
  143.  
  144. AP: whap unwhap
  145.  
  146. all: yabba unyabba
  147.  
  148. checkconf: checkconf.c Makefile
  149.     $(CC) $(CCOPTS) -o checkconf checkconf.c
  150.  
  151. yabba: yabba.o bitout.o percent.o ytexts.o Makefile
  152.     $(CC) $(CCOPTS) -o yabba yabba.o bitout.o percent.o ytexts.o
  153.  
  154. unyabba: unyabba.o percent.o ytexts.o Makefile
  155.     $(CC) $(CCOPTS) -o unyabba unyabba.o percent.o ytexts.o
  156.  
  157. whap: whap.o bitout.o percent.o wtexts.o Makefile
  158.     @echo 'Warning! If you use AP coding except for instruction and amusement,'
  159.     @echo 'you may be infringing on a patent.'
  160.     @echo 'If you understand this, press return:'
  161.     @read foo;
  162.     $(CC) $(CCOPTS) -DWHAP -o whap whap.o bitout.o percent.o wtexts.o
  163.  
  164. unwhap: unwhap.o percent.o wtexts.o Makefile
  165.     $(CC) $(CCOPTS) -DWHAP -o unwhap unwhap.o percent.o wtexts.o
  166.  
  167. bitout.o: bitout.c bitout.h Makefile
  168.     $(CC) $(CCOPTS) -c bitout.c
  169.  
  170. percent.o: percent.c percent.h Makefile
  171.     $(CC) $(CCOPTS) -c percent.c
  172.  
  173. ytexts.o: texts.c texts.h Makefile
  174.     $(CC) $(CCOPTS) -c texts.c
  175.     mv texts.o ytexts.o
  176.  
  177. wtexts.o: texts.c texts.h Makefile
  178.     $(CC) $(CCOPTS) -DWHAP -c texts.c
  179.     mv texts.o wtexts.o
  180.  
  181. yabba.o: yw.c bitout.h percent.h texts.h huptrie.h Makefile
  182.     $(CC) $(CCOPTS) -c yw.c
  183.     mv yw.o yabba.o
  184.  
  185. whap.o: yw.c bitout.h percent.h texts.h huptrie.h Makefile
  186.     $(CC) $(CCOPTS) -DWHAP -c yw.c
  187.     mv yw.o whap.o
  188.  
  189. unyabba.o: unyabba.c bitout.h percent.h texts.h huptrie.h Makefile
  190.     $(CC) $(CCOPTS) -c unyabba.c
  191.  
  192. unwhap.o: unwhap.c percent.h texts.h Makefile
  193.     $(CC) $(CCOPTS) -DWHAP -c unwhap.c
  194.  
  195. install:
  196.     @echo 'Run INSTALL in a root shell.'
  197.     exit 1
  198.  
  199. clean:
  200.     @echo 'Why do you want to make clean, anyway?'
  201.     @echo 'If you changed the Makefile, it knows it should remake.'
  202.     @echo 'If you want to save space, do make shar and then remove everything.'
  203.     rm -f unwhap.o unyabba.o whap.o yabba.o yw.o texts.o bitout.o percent.o wtexts.o ytexts.o checkconf whap unwhap yabba unyabba
  204.  
  205. shar:
  206.     shar `cat FILES` > yw.shar
  207.     chmod 400 yw.shar
  208.