Makefile 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. # ------------------------------------------------------------------
  2. # This file is part of bzip2/libbzip2, a program and library for
  3. # lossless, block-sorting data compression.
  4. #
  5. # bzip2/libbzip2 version 1.0.6 of 6 September 2010
  6. # Copyright (C) 1996-2010 Julian Seward <jseward@bzip.org>
  7. #
  8. # Please read the WARNING, DISCLAIMER and PATENTS sections in the
  9. # README file.
  10. #
  11. # This program is released under the terms of the license contained
  12. # in the file LICENSE.
  13. # ------------------------------------------------------------------
  14. SHELL=/bin/sh
  15. # To assist in cross-compiling
  16. CC=gcc
  17. AR=ar
  18. RANLIB=ranlib
  19. LDFLAGS=
  20. BIGFILES=-D_FILE_OFFSET_BITS=64
  21. CFLAGS=-Wall -Winline -O2 -g $(BIGFILES)
  22. # Where you want it installed when you do 'make install'
  23. PREFIX=/usr/local
  24. OBJS= blocksort.o \
  25. huffman.o \
  26. crctable.o \
  27. randtable.o \
  28. compress.o \
  29. decompress.o \
  30. bzlib.o
  31. all: libbz2.a bzip2 bzip2recover test
  32. bzip2: libbz2.a bzip2.o
  33. $(CC) $(CFLAGS) $(LDFLAGS) -o bzip2 bzip2.o -L. -lbz2
  34. bzip2recover: bzip2recover.o
  35. $(CC) $(CFLAGS) $(LDFLAGS) -o bzip2recover bzip2recover.o
  36. libbz2.a: $(OBJS)
  37. rm -f libbz2.a
  38. $(AR) cq libbz2.a $(OBJS)
  39. @if ( test -f $(RANLIB) -o -f /usr/bin/ranlib -o \
  40. -f /bin/ranlib -o -f /usr/ccs/bin/ranlib ) ; then \
  41. echo $(RANLIB) libbz2.a ; \
  42. $(RANLIB) libbz2.a ; \
  43. fi
  44. check: test
  45. test: bzip2
  46. @cat words1
  47. ./bzip2 -1 < sample1.ref > sample1.rb2
  48. ./bzip2 -2 < sample2.ref > sample2.rb2
  49. ./bzip2 -3 < sample3.ref > sample3.rb2
  50. ./bzip2 -d < sample1.bz2 > sample1.tst
  51. ./bzip2 -d < sample2.bz2 > sample2.tst
  52. ./bzip2 -ds < sample3.bz2 > sample3.tst
  53. cmp sample1.bz2 sample1.rb2
  54. cmp sample2.bz2 sample2.rb2
  55. cmp sample3.bz2 sample3.rb2
  56. cmp sample1.tst sample1.ref
  57. cmp sample2.tst sample2.ref
  58. cmp sample3.tst sample3.ref
  59. @cat words3
  60. install: bzip2 bzip2recover
  61. if ( test ! -d $(PREFIX)/bin ) ; then mkdir -p $(PREFIX)/bin ; fi
  62. if ( test ! -d $(PREFIX)/lib ) ; then mkdir -p $(PREFIX)/lib ; fi
  63. if ( test ! -d $(PREFIX)/man ) ; then mkdir -p $(PREFIX)/man ; fi
  64. if ( test ! -d $(PREFIX)/man/man1 ) ; then mkdir -p $(PREFIX)/man/man1 ; fi
  65. if ( test ! -d $(PREFIX)/include ) ; then mkdir -p $(PREFIX)/include ; fi
  66. cp -f bzip2 $(PREFIX)/bin/bzip2
  67. cp -f bzip2 $(PREFIX)/bin/bunzip2
  68. cp -f bzip2 $(PREFIX)/bin/bzcat
  69. cp -f bzip2recover $(PREFIX)/bin/bzip2recover
  70. chmod a+x $(PREFIX)/bin/bzip2
  71. chmod a+x $(PREFIX)/bin/bunzip2
  72. chmod a+x $(PREFIX)/bin/bzcat
  73. chmod a+x $(PREFIX)/bin/bzip2recover
  74. cp -f bzip2.1 $(PREFIX)/man/man1
  75. chmod a+r $(PREFIX)/man/man1/bzip2.1
  76. cp -f bzlib.h $(PREFIX)/include
  77. chmod a+r $(PREFIX)/include/bzlib.h
  78. cp -f libbz2.a $(PREFIX)/lib
  79. chmod a+r $(PREFIX)/lib/libbz2.a
  80. cp -f bzgrep $(PREFIX)/bin/bzgrep
  81. ln -s -f $(PREFIX)/bin/bzgrep $(PREFIX)/bin/bzegrep
  82. ln -s -f $(PREFIX)/bin/bzgrep $(PREFIX)/bin/bzfgrep
  83. chmod a+x $(PREFIX)/bin/bzgrep
  84. cp -f bzmore $(PREFIX)/bin/bzmore
  85. ln -s -f $(PREFIX)/bin/bzmore $(PREFIX)/bin/bzless
  86. chmod a+x $(PREFIX)/bin/bzmore
  87. cp -f bzdiff $(PREFIX)/bin/bzdiff
  88. ln -s -f $(PREFIX)/bin/bzdiff $(PREFIX)/bin/bzcmp
  89. chmod a+x $(PREFIX)/bin/bzdiff
  90. cp -f bzgrep.1 bzmore.1 bzdiff.1 $(PREFIX)/man/man1
  91. chmod a+r $(PREFIX)/man/man1/bzgrep.1
  92. chmod a+r $(PREFIX)/man/man1/bzmore.1
  93. chmod a+r $(PREFIX)/man/man1/bzdiff.1
  94. echo ".so man1/bzgrep.1" > $(PREFIX)/man/man1/bzegrep.1
  95. echo ".so man1/bzgrep.1" > $(PREFIX)/man/man1/bzfgrep.1
  96. echo ".so man1/bzmore.1" > $(PREFIX)/man/man1/bzless.1
  97. echo ".so man1/bzdiff.1" > $(PREFIX)/man/man1/bzcmp.1
  98. clean:
  99. rm -f *.o libbz2.a bzip2 bzip2recover \
  100. sample1.rb2 sample2.rb2 sample3.rb2 \
  101. sample1.tst sample2.tst sample3.tst
  102. blocksort.o: blocksort.c
  103. @cat words0
  104. $(CC) $(CFLAGS) -c blocksort.c
  105. huffman.o: huffman.c
  106. $(CC) $(CFLAGS) -c huffman.c
  107. crctable.o: crctable.c
  108. $(CC) $(CFLAGS) -c crctable.c
  109. randtable.o: randtable.c
  110. $(CC) $(CFLAGS) -c randtable.c
  111. compress.o: compress.c
  112. $(CC) $(CFLAGS) -c compress.c
  113. decompress.o: decompress.c
  114. $(CC) $(CFLAGS) -c decompress.c
  115. bzlib.o: bzlib.c
  116. $(CC) $(CFLAGS) -c bzlib.c
  117. bzip2.o: bzip2.c
  118. $(CC) $(CFLAGS) -c bzip2.c
  119. bzip2recover.o: bzip2recover.c
  120. $(CC) $(CFLAGS) -c bzip2recover.c
  121. distclean: clean
  122. rm -f manual.ps manual.html manual.pdf
  123. DISTNAME=bzip2-1.0.6
  124. dist: check manual
  125. rm -f $(DISTNAME)
  126. ln -s -f . $(DISTNAME)
  127. tar cvf $(DISTNAME).tar \
  128. $(DISTNAME)/blocksort.c \
  129. $(DISTNAME)/huffman.c \
  130. $(DISTNAME)/crctable.c \
  131. $(DISTNAME)/randtable.c \
  132. $(DISTNAME)/compress.c \
  133. $(DISTNAME)/decompress.c \
  134. $(DISTNAME)/bzlib.c \
  135. $(DISTNAME)/bzip2.c \
  136. $(DISTNAME)/bzip2recover.c \
  137. $(DISTNAME)/bzlib.h \
  138. $(DISTNAME)/bzlib_private.h \
  139. $(DISTNAME)/Makefile \
  140. $(DISTNAME)/LICENSE \
  141. $(DISTNAME)/bzip2.1 \
  142. $(DISTNAME)/bzip2.1.preformatted \
  143. $(DISTNAME)/bzip2.txt \
  144. $(DISTNAME)/words0 \
  145. $(DISTNAME)/words1 \
  146. $(DISTNAME)/words2 \
  147. $(DISTNAME)/words3 \
  148. $(DISTNAME)/sample1.ref \
  149. $(DISTNAME)/sample2.ref \
  150. $(DISTNAME)/sample3.ref \
  151. $(DISTNAME)/sample1.bz2 \
  152. $(DISTNAME)/sample2.bz2 \
  153. $(DISTNAME)/sample3.bz2 \
  154. $(DISTNAME)/dlltest.c \
  155. $(DISTNAME)/manual.html \
  156. $(DISTNAME)/manual.pdf \
  157. $(DISTNAME)/manual.ps \
  158. $(DISTNAME)/README \
  159. $(DISTNAME)/README.COMPILATION.PROBLEMS \
  160. $(DISTNAME)/README.XML.STUFF \
  161. $(DISTNAME)/CHANGES \
  162. $(DISTNAME)/libbz2.def \
  163. $(DISTNAME)/libbz2.dsp \
  164. $(DISTNAME)/dlltest.dsp \
  165. $(DISTNAME)/makefile.msc \
  166. $(DISTNAME)/unzcrash.c \
  167. $(DISTNAME)/spewG.c \
  168. $(DISTNAME)/mk251.c \
  169. $(DISTNAME)/bzdiff \
  170. $(DISTNAME)/bzdiff.1 \
  171. $(DISTNAME)/bzmore \
  172. $(DISTNAME)/bzmore.1 \
  173. $(DISTNAME)/bzgrep \
  174. $(DISTNAME)/bzgrep.1 \
  175. $(DISTNAME)/Makefile-libbz2_so \
  176. $(DISTNAME)/bz-common.xsl \
  177. $(DISTNAME)/bz-fo.xsl \
  178. $(DISTNAME)/bz-html.xsl \
  179. $(DISTNAME)/bzip.css \
  180. $(DISTNAME)/entities.xml \
  181. $(DISTNAME)/manual.xml \
  182. $(DISTNAME)/format.pl \
  183. $(DISTNAME)/xmlproc.sh
  184. gzip -v $(DISTNAME).tar
  185. # For rebuilding the manual from sources on my SuSE 9.1 box
  186. MANUAL_SRCS= bz-common.xsl bz-fo.xsl bz-html.xsl bzip.css \
  187. entities.xml manual.xml
  188. manual: manual.html manual.ps manual.pdf
  189. manual.ps: $(MANUAL_SRCS)
  190. ./xmlproc.sh -ps manual.xml
  191. manual.pdf: $(MANUAL_SRCS)
  192. ./xmlproc.sh -pdf manual.xml
  193. manual.html: $(MANUAL_SRCS)
  194. ./xmlproc.sh -html manual.xml