diff options
| author | Julian Seward <jseward@acm.org> | 2001-12-30 22:13:13 +0100 |
|---|---|---|
| committer | Julian Seward <jseward@acm.org> | 2001-12-30 22:13:13 +0100 |
| commit | 099d844292f60f9d58914da29e5773204dc55e7a (patch) | |
| tree | 04bdb38dbcd894d6fdbbc3253e216d029cade5c6 /Makefile | |
| parent | 795b859eee96c700e8f3c3fe68e6a9a39d95797c (diff) | |
| download | bzip2-1.0.2.tar.gz bzip2-1.0.2.tar.bz2 bzip2-1.0.2.zip | |
bzip2-1.0.2bzip2-1.0.2
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 81 |
1 files changed, 66 insertions, 15 deletions
| @@ -1,9 +1,20 @@ | |||
| 1 | 1 | ||
| 2 | SHELL=/bin/sh | 2 | SHELL=/bin/sh |
| 3 | |||
| 4 | # To assist in cross-compiling | ||
| 3 | CC=gcc | 5 | CC=gcc |
| 6 | AR=ar | ||
| 7 | RANLIB=ranlib | ||
| 8 | LDFLAGS= | ||
| 9 | |||
| 10 | # Suitably paranoid flags to avoid bugs in gcc-2.7 | ||
| 4 | BIGFILES=-D_FILE_OFFSET_BITS=64 | 11 | BIGFILES=-D_FILE_OFFSET_BITS=64 |
| 5 | CFLAGS=-Wall -Winline -O2 -fomit-frame-pointer -fno-strength-reduce $(BIGFILES) | 12 | CFLAGS=-Wall -Winline -O2 -fomit-frame-pointer -fno-strength-reduce $(BIGFILES) |
| 6 | 13 | ||
| 14 | # Where you want it installed when you do 'make install' | ||
| 15 | PREFIX=/usr | ||
| 16 | |||
| 17 | |||
| 7 | OBJS= blocksort.o \ | 18 | OBJS= blocksort.o \ |
| 8 | huffman.o \ | 19 | huffman.o \ |
| 9 | crctable.o \ | 20 | crctable.o \ |
| @@ -15,20 +26,21 @@ OBJS= blocksort.o \ | |||
| 15 | all: libbz2.a bzip2 bzip2recover test | 26 | all: libbz2.a bzip2 bzip2recover test |
| 16 | 27 | ||
| 17 | bzip2: libbz2.a bzip2.o | 28 | bzip2: libbz2.a bzip2.o |
| 18 | $(CC) $(CFLAGS) -o bzip2 bzip2.o -L. -lbz2 | 29 | $(CC) $(CFLAGS) $(LDFLAGS) -o bzip2 bzip2.o -L. -lbz2 |
| 19 | 30 | ||
| 20 | bzip2recover: bzip2recover.o | 31 | bzip2recover: bzip2recover.o |
| 21 | $(CC) $(CFLAGS) -o bzip2recover bzip2recover.o | 32 | $(CC) $(CFLAGS) $(LDFLAGS) -o bzip2recover bzip2recover.o |
| 22 | 33 | ||
| 23 | libbz2.a: $(OBJS) | 34 | libbz2.a: $(OBJS) |
| 24 | rm -f libbz2.a | 35 | rm -f libbz2.a |
| 25 | ar cq libbz2.a $(OBJS) | 36 | $(AR) cq libbz2.a $(OBJS) |
| 26 | @if ( test -f /usr/bin/ranlib -o -f /bin/ranlib -o \ | 37 | @if ( test -f $(RANLIB) -o -f /usr/bin/ranlib -o \ |
| 27 | -f /usr/ccs/bin/ranlib ) ; then \ | 38 | -f /bin/ranlib -o -f /usr/ccs/bin/ranlib ) ; then \ |
| 28 | echo ranlib libbz2.a ; \ | 39 | echo $(RANLIB) libbz2.a ; \ |
| 29 | ranlib libbz2.a ; \ | 40 | $(RANLIB) libbz2.a ; \ |
| 30 | fi | 41 | fi |
| 31 | 42 | ||
| 43 | check: test | ||
| 32 | test: bzip2 | 44 | test: bzip2 |
| 33 | @cat words1 | 45 | @cat words1 |
| 34 | ./bzip2 -1 < sample1.ref > sample1.rb2 | 46 | ./bzip2 -1 < sample1.ref > sample1.rb2 |
| @@ -45,14 +57,12 @@ test: bzip2 | |||
| 45 | cmp sample3.tst sample3.ref | 57 | cmp sample3.tst sample3.ref |
| 46 | @cat words3 | 58 | @cat words3 |
| 47 | 59 | ||
| 48 | PREFIX=/usr | ||
| 49 | |||
| 50 | install: bzip2 bzip2recover | 60 | install: bzip2 bzip2recover |
| 51 | if ( test ! -d $(PREFIX)/bin ) ; then mkdir $(PREFIX)/bin ; fi | 61 | if ( test ! -d $(PREFIX)/bin ) ; then mkdir -p $(PREFIX)/bin ; fi |
| 52 | if ( test ! -d $(PREFIX)/lib ) ; then mkdir $(PREFIX)/lib ; fi | 62 | if ( test ! -d $(PREFIX)/lib ) ; then mkdir -p $(PREFIX)/lib ; fi |
| 53 | if ( test ! -d $(PREFIX)/man ) ; then mkdir $(PREFIX)/man ; fi | 63 | if ( test ! -d $(PREFIX)/man ) ; then mkdir -p $(PREFIX)/man ; fi |
| 54 | if ( test ! -d $(PREFIX)/man/man1 ) ; then mkdir $(PREFIX)/man/man1 ; fi | 64 | if ( test ! -d $(PREFIX)/man/man1 ) ; then mkdir -p $(PREFIX)/man/man1 ; fi |
| 55 | if ( test ! -d $(PREFIX)/include ) ; then mkdir $(PREFIX)/include ; fi | 65 | if ( test ! -d $(PREFIX)/include ) ; then mkdir -p $(PREFIX)/include ; fi |
| 56 | cp -f bzip2 $(PREFIX)/bin/bzip2 | 66 | cp -f bzip2 $(PREFIX)/bin/bzip2 |
| 57 | cp -f bzip2 $(PREFIX)/bin/bunzip2 | 67 | cp -f bzip2 $(PREFIX)/bin/bunzip2 |
| 58 | cp -f bzip2 $(PREFIX)/bin/bzcat | 68 | cp -f bzip2 $(PREFIX)/bin/bzcat |
| @@ -67,7 +77,26 @@ install: bzip2 bzip2recover | |||
| 67 | chmod a+r $(PREFIX)/include/bzlib.h | 77 | chmod a+r $(PREFIX)/include/bzlib.h |
| 68 | cp -f libbz2.a $(PREFIX)/lib | 78 | cp -f libbz2.a $(PREFIX)/lib |
| 69 | chmod a+r $(PREFIX)/lib/libbz2.a | 79 | chmod a+r $(PREFIX)/lib/libbz2.a |
| 80 | cp -f bzgrep $(PREFIX)/bin/bzgrep | ||
| 81 | ln $(PREFIX)/bin/bzgrep $(PREFIX)/bin/bzegrep | ||
| 82 | ln $(PREFIX)/bin/bzgrep $(PREFIX)/bin/bzfgrep | ||
| 83 | chmod a+x $(PREFIX)/bin/bzgrep | ||
| 84 | cp -f bzmore $(PREFIX)/bin/bzmore | ||
| 85 | ln $(PREFIX)/bin/bzmore $(PREFIX)/bin/bzless | ||
| 86 | chmod a+x $(PREFIX)/bin/bzmore | ||
| 87 | cp -f bzdiff $(PREFIX)/bin/bzdiff | ||
| 88 | ln $(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 | ||
| 70 | 98 | ||
| 99 | distclean: clean | ||
| 71 | clean: | 100 | clean: |
| 72 | rm -f *.o libbz2.a bzip2 bzip2recover \ | 101 | rm -f *.o libbz2.a bzip2 bzip2recover \ |
| 73 | sample1.rb2 sample2.rb2 sample3.rb2 \ | 102 | sample1.rb2 sample2.rb2 sample3.rb2 \ |
| @@ -93,7 +122,7 @@ bzip2.o: bzip2.c | |||
| 93 | bzip2recover.o: bzip2recover.c | 122 | bzip2recover.o: bzip2recover.c |
| 94 | $(CC) $(CFLAGS) -c bzip2recover.c | 123 | $(CC) $(CFLAGS) -c bzip2recover.c |
| 95 | 124 | ||
| 96 | DISTNAME=bzip2-1.0.1 | 125 | DISTNAME=bzip2-1.0.2 |
| 97 | tarfile: | 126 | tarfile: |
| 98 | rm -f $(DISTNAME) | 127 | rm -f $(DISTNAME) |
| 99 | ln -sf . $(DISTNAME) | 128 | ln -sf . $(DISTNAME) |
| @@ -112,6 +141,7 @@ tarfile: | |||
| 112 | $(DISTNAME)/Makefile \ | 141 | $(DISTNAME)/Makefile \ |
| 113 | $(DISTNAME)/manual.texi \ | 142 | $(DISTNAME)/manual.texi \ |
| 114 | $(DISTNAME)/manual.ps \ | 143 | $(DISTNAME)/manual.ps \ |
| 144 | $(DISTNAME)/manual.pdf \ | ||
| 115 | $(DISTNAME)/LICENSE \ | 145 | $(DISTNAME)/LICENSE \ |
| 116 | $(DISTNAME)/bzip2.1 \ | 146 | $(DISTNAME)/bzip2.1 \ |
| 117 | $(DISTNAME)/bzip2.1.preformatted \ | 147 | $(DISTNAME)/bzip2.1.preformatted \ |
| @@ -138,4 +168,25 @@ tarfile: | |||
| 138 | $(DISTNAME)/Y2K_INFO \ | 168 | $(DISTNAME)/Y2K_INFO \ |
| 139 | $(DISTNAME)/unzcrash.c \ | 169 | $(DISTNAME)/unzcrash.c \ |
| 140 | $(DISTNAME)/spewG.c \ | 170 | $(DISTNAME)/spewG.c \ |
| 171 | $(DISTNAME)/mk251.c \ | ||
| 172 | $(DISTNAME)/bzdiff \ | ||
| 173 | $(DISTNAME)/bzdiff.1 \ | ||
| 174 | $(DISTNAME)/bzmore \ | ||
| 175 | $(DISTNAME)/bzmore.1 \ | ||
| 176 | $(DISTNAME)/bzgrep \ | ||
| 177 | $(DISTNAME)/bzgrep.1 \ | ||
| 141 | $(DISTNAME)/Makefile-libbz2_so | 178 | $(DISTNAME)/Makefile-libbz2_so |
| 179 | gzip -v $(DISTNAME).tar | ||
| 180 | |||
| 181 | # For rebuilding the manual from sources on my RedHat 7.2 box | ||
| 182 | manual: manual.ps manual.pdf manual.html | ||
| 183 | |||
| 184 | manual.ps: manual.texi | ||
| 185 | tex manual.texi | ||
| 186 | dvips -o manual.ps manual.dvi | ||
| 187 | |||
| 188 | manual.pdf: manual.ps | ||
| 189 | ps2pdf manual.ps | ||
| 190 | |||
| 191 | manual.html: manual.texi | ||
| 192 | texi2html -split_chapter manual.texi | ||
