summaryrefslogtreecommitdiffstats
path: root/contrib/bzip2/Makefile
diff options
context:
space:
mode:
authorsobomax <sobomax@FreeBSD.org>2002-02-01 16:28:01 +0000
committersobomax <sobomax@FreeBSD.org>2002-02-01 16:28:01 +0000
commitb718740c2fa9f3e14e09fba90eca26f829b7d43a (patch)
treea3ca69a02ff78d685a9ad50cd867c166ab387609 /contrib/bzip2/Makefile
parentda41d3ce6ee0a7c399e6438525caf651b761080b (diff)
downloadFreeBSD-src-b718740c2fa9f3e14e09fba90eca26f829b7d43a.zip
FreeBSD-src-b718740c2fa9f3e14e09fba90eca26f829b7d43a.tar.gz
Virgin import (trimmed) of Bzip2 version 1.0.2
Diffstat (limited to 'contrib/bzip2/Makefile')
-rw-r--r--contrib/bzip2/Makefile81
1 files changed, 66 insertions, 15 deletions
diff --git a/contrib/bzip2/Makefile b/contrib/bzip2/Makefile
index ab17f49..8305235 100644
--- a/contrib/bzip2/Makefile
+++ b/contrib/bzip2/Makefile
@@ -1,9 +1,20 @@
SHELL=/bin/sh
+
+# To assist in cross-compiling
CC=gcc
+AR=ar
+RANLIB=ranlib
+LDFLAGS=
+
+# Suitably paranoid flags to avoid bugs in gcc-2.7
BIGFILES=-D_FILE_OFFSET_BITS=64
CFLAGS=-Wall -Winline -O2 -fomit-frame-pointer -fno-strength-reduce $(BIGFILES)
+# Where you want it installed when you do 'make install'
+PREFIX=/usr
+
+
OBJS= blocksort.o \
huffman.o \
crctable.o \
@@ -15,20 +26,21 @@ OBJS= blocksort.o \
all: libbz2.a bzip2 bzip2recover test
bzip2: libbz2.a bzip2.o
- $(CC) $(CFLAGS) -o bzip2 bzip2.o -L. -lbz2
+ $(CC) $(CFLAGS) $(LDFLAGS) -o bzip2 bzip2.o -L. -lbz2
bzip2recover: bzip2recover.o
- $(CC) $(CFLAGS) -o bzip2recover bzip2recover.o
+ $(CC) $(CFLAGS) $(LDFLAGS) -o bzip2recover bzip2recover.o
libbz2.a: $(OBJS)
rm -f libbz2.a
- ar cq libbz2.a $(OBJS)
- @if ( test -f /usr/bin/ranlib -o -f /bin/ranlib -o \
- -f /usr/ccs/bin/ranlib ) ; then \
- echo ranlib libbz2.a ; \
- ranlib libbz2.a ; \
+ $(AR) cq libbz2.a $(OBJS)
+ @if ( test -f $(RANLIB) -o -f /usr/bin/ranlib -o \
+ -f /bin/ranlib -o -f /usr/ccs/bin/ranlib ) ; then \
+ echo $(RANLIB) libbz2.a ; \
+ $(RANLIB) libbz2.a ; \
fi
+check: test
test: bzip2
@cat words1
./bzip2 -1 < sample1.ref > sample1.rb2
@@ -45,14 +57,12 @@ test: bzip2
cmp sample3.tst sample3.ref
@cat words3
-PREFIX=/usr
-
install: bzip2 bzip2recover
- if ( test ! -d $(PREFIX)/bin ) ; then mkdir $(PREFIX)/bin ; fi
- if ( test ! -d $(PREFIX)/lib ) ; then mkdir $(PREFIX)/lib ; fi
- if ( test ! -d $(PREFIX)/man ) ; then mkdir $(PREFIX)/man ; fi
- if ( test ! -d $(PREFIX)/man/man1 ) ; then mkdir $(PREFIX)/man/man1 ; fi
- if ( test ! -d $(PREFIX)/include ) ; then mkdir $(PREFIX)/include ; fi
+ if ( test ! -d $(PREFIX)/bin ) ; then mkdir -p $(PREFIX)/bin ; fi
+ if ( test ! -d $(PREFIX)/lib ) ; then mkdir -p $(PREFIX)/lib ; fi
+ if ( test ! -d $(PREFIX)/man ) ; then mkdir -p $(PREFIX)/man ; fi
+ if ( test ! -d $(PREFIX)/man/man1 ) ; then mkdir -p $(PREFIX)/man/man1 ; fi
+ if ( test ! -d $(PREFIX)/include ) ; then mkdir -p $(PREFIX)/include ; fi
cp -f bzip2 $(PREFIX)/bin/bzip2
cp -f bzip2 $(PREFIX)/bin/bunzip2
cp -f bzip2 $(PREFIX)/bin/bzcat
@@ -67,7 +77,26 @@ install: bzip2 bzip2recover
chmod a+r $(PREFIX)/include/bzlib.h
cp -f libbz2.a $(PREFIX)/lib
chmod a+r $(PREFIX)/lib/libbz2.a
+ cp -f bzgrep $(PREFIX)/bin/bzgrep
+ ln $(PREFIX)/bin/bzgrep $(PREFIX)/bin/bzegrep
+ ln $(PREFIX)/bin/bzgrep $(PREFIX)/bin/bzfgrep
+ chmod a+x $(PREFIX)/bin/bzgrep
+ cp -f bzmore $(PREFIX)/bin/bzmore
+ ln $(PREFIX)/bin/bzmore $(PREFIX)/bin/bzless
+ chmod a+x $(PREFIX)/bin/bzmore
+ cp -f bzdiff $(PREFIX)/bin/bzdiff
+ ln $(PREFIX)/bin/bzdiff $(PREFIX)/bin/bzcmp
+ chmod a+x $(PREFIX)/bin/bzdiff
+ cp -f bzgrep.1 bzmore.1 bzdiff.1 $(PREFIX)/man/man1
+ chmod a+r $(PREFIX)/man/man1/bzgrep.1
+ chmod a+r $(PREFIX)/man/man1/bzmore.1
+ chmod a+r $(PREFIX)/man/man1/bzdiff.1
+ echo ".so man1/bzgrep.1" > $(PREFIX)/man/man1/bzegrep.1
+ echo ".so man1/bzgrep.1" > $(PREFIX)/man/man1/bzfgrep.1
+ echo ".so man1/bzmore.1" > $(PREFIX)/man/man1/bzless.1
+ echo ".so man1/bzdiff.1" > $(PREFIX)/man/man1/bzcmp.1
+distclean: clean
clean:
rm -f *.o libbz2.a bzip2 bzip2recover \
sample1.rb2 sample2.rb2 sample3.rb2 \
@@ -93,7 +122,7 @@ bzip2.o: bzip2.c
bzip2recover.o: bzip2recover.c
$(CC) $(CFLAGS) -c bzip2recover.c
-DISTNAME=bzip2-1.0.1
+DISTNAME=bzip2-1.0.2
tarfile:
rm -f $(DISTNAME)
ln -sf . $(DISTNAME)
@@ -112,6 +141,7 @@ tarfile:
$(DISTNAME)/Makefile \
$(DISTNAME)/manual.texi \
$(DISTNAME)/manual.ps \
+ $(DISTNAME)/manual.pdf \
$(DISTNAME)/LICENSE \
$(DISTNAME)/bzip2.1 \
$(DISTNAME)/bzip2.1.preformatted \
@@ -138,4 +168,25 @@ tarfile:
$(DISTNAME)/Y2K_INFO \
$(DISTNAME)/unzcrash.c \
$(DISTNAME)/spewG.c \
+ $(DISTNAME)/mk251.c \
+ $(DISTNAME)/bzdiff \
+ $(DISTNAME)/bzdiff.1 \
+ $(DISTNAME)/bzmore \
+ $(DISTNAME)/bzmore.1 \
+ $(DISTNAME)/bzgrep \
+ $(DISTNAME)/bzgrep.1 \
$(DISTNAME)/Makefile-libbz2_so
+ gzip -v $(DISTNAME).tar
+
+# For rebuilding the manual from sources on my RedHat 7.2 box
+manual: manual.ps manual.pdf manual.html
+
+manual.ps: manual.texi
+ tex manual.texi
+ dvips -o manual.ps manual.dvi
+
+manual.pdf: manual.ps
+ ps2pdf manual.ps
+
+manual.html: manual.texi
+ texi2html -split_chapter manual.texi
OpenPOWER on IntegriCloud