1# $FreeBSD$ 2 3BZ2DIR= ${.CURDIR}/../../contrib/bzip2 4.PATH: ${BZ2DIR} 5 6PROG= bzip2 7CFLAGS+= -D_FILE_OFFSET_BITS=64 8 9DPADD= ${LIBBZ2} 10LDADD= -lbz2 11 12LINKS= ${BINDIR}/bzip2 ${BINDIR}/bunzip2 13LINKS+= ${BINDIR}/bzip2 ${BINDIR}/bzcat 14MLINKS= bzip2.1 bunzip2.1 bzip2.1 bzcat.1 15 16REFFILES= sample1.ref sample2.ref sample3.ref 17DREFFILES= sample1.bz2 sample2.bz2 sample3.bz2 18TESTFILES= ${REFFILES} ${DREFFILES} 19 20CLEANFILES+= ${TESTFILES} \ 21 sample1.rb2 sample2.rb2 sample3.rb2 \ 22 sample1.tst sample2.tst sample3.tst 23 24.for f in ${REFFILES} 25${f}: ${f}.gz.uu 26 uudecode -p ${BZ2DIR}/${f}.gz.uu | gunzip > ${f} 27.endfor 28.for f in ${DREFFILES} 29${f}: ${f}.uu 30 uudecode ${BZ2DIR}/${f}.uu 31.endfor 32 33test: bzip2 ${TESTFILES} 34 @cat ${BZ2DIR}/words1 35 ./bzip2 -1 < sample1.ref > sample1.rb2 36 ./bzip2 -2 < sample2.ref > sample2.rb2 37 ./bzip2 -3 < sample3.ref > sample3.rb2 38 ./bzip2 -d < sample1.bz2 > sample1.tst 39 ./bzip2 -d < sample2.bz2 > sample2.tst 40 ./bzip2 -ds < sample3.bz2 > sample3.tst 41 cmp sample1.bz2 sample1.rb2 42 cmp sample2.bz2 sample2.rb2 43 cmp sample3.bz2 sample3.rb2 44 cmp sample1.tst sample1.ref 45 cmp sample2.tst sample2.ref 46 cmp sample3.tst sample3.ref 47 @cat ${BZ2DIR}/words3 48 49.include <bsd.prog.mk> 50