blob: dcf64584d98c45ba372f7e79ddeca326cbd7a6f1 [file] [log] [blame]
Patrick Williamsc124f4f2015-09-15 14:41:29 -05001
2lib_LTLIBRARIES = libbz2.la
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05003libbz2_la_LDFLAGS = -version-info 1:6:0
Patrick Williamsc124f4f2015-09-15 14:41:29 -05004
5libbz2_la_SOURCES = blocksort.c \
6 huffman.c \
7 crctable.c \
8 randtable.c \
9 compress.c \
10 decompress.c \
11 bzlib.c
12
13bin_PROGRAMS = bzip2 bzip2recover
14
15bzip2_SOURCES = bzip2.c
16bzip2_LDADD = libbz2.la
17bzip2_DEPENDENCIES = libbz2.la
18
19include_HEADERS = bzlib.h
20
21bzip2recover_SOURCES = bzip2recover.c
22bzip2recover_LDADD = libbz2.la
23bzip2recover_DEPENDENCIES = libbz2.la
24
25bin_SCRIPTS = bzgrep bzmore bzdiff
26
27man_MANS = bzip2.1 bzgrep.1 bzmore.1 bzdiff.1
28EXTRA_DIST = $(man_MANS)
29
30runtest:
31 ./bzip2 -1 < sample1.ref > sample1.rb2
32 ./bzip2 -2 < sample2.ref > sample2.rb2
33 ./bzip2 -3 < sample3.ref > sample3.rb2
34 ./bzip2 -d < sample1.bz2 > sample1.tst
35 ./bzip2 -d < sample2.bz2 > sample2.tst
36 ./bzip2 -ds < sample3.bz2 > sample3.tst
37 @if cmp sample1.bz2 sample1.rb2; then echo "PASS: sample1 compress";\
38 else echo "FAIL: sample1 compress"; fi
39 @if cmp sample2.bz2 sample2.rb2; then echo "PASS: sample2 compress";\
40 else echo "FAIL: sample2 compress"; fi
41 @if cmp sample3.bz2 sample3.rb2; then echo "PASS: sample3 compress";\
42 else echo "FAIL: sample3 compress"; fi
43 @if cmp sample1.tst sample1.ref; then echo "PASS: sample1 decompress";\
44 else echo "FAIL: sample1 decompress"; fi
45 @if cmp sample2.tst sample2.ref; then echo "PASS: sample2 decompress";\
46 else echo "FAIL: sample2 decompress"; fi
47 @if cmp sample3.tst sample3.ref; then echo "PASS: sample3 decompress";\
48 else echo "FAIL: sample3 decompress"; fi
49
50install-ptest:
Brad Bishopd7bf8c12018-02-25 22:55:05 -050051 sed -n '/^runtest:/,/^install-ptest:/{/^install-ptest:/!p}' \
52 $(srcdir)/Makefile.am > $(DESTDIR)/Makefile
Patrick Williamsc124f4f2015-09-15 14:41:29 -050053 cp $(srcdir)/sample1.ref $(DESTDIR)/
54 cp $(srcdir)/sample2.ref $(DESTDIR)/
55 cp $(srcdir)/sample3.ref $(DESTDIR)/
56 cp $(srcdir)/sample1.bz2 $(DESTDIR)/
57 cp $(srcdir)/sample2.bz2 $(DESTDIR)/
58 cp $(srcdir)/sample3.bz2 $(DESTDIR)/
59 ln -s $(bindir)/bzip2 $(DESTDIR)/bzip2
60
61install-exec-hook:
62 ln -s $(bindir)/bzip2$(EXEEXT) $(DESTDIR)$(bindir)/bunzip2$(EXEEXT)
63 ln -s $(bindir)/bzip2$(EXEEXT) $(DESTDIR)$(bindir)/bzcat$(EXEEXT)
64 ln -s $(bindir)/bzgrep$(EXEEXT) $(DESTDIR)$(bindir)/bzegrep$(EXEEXT)
65 ln -s $(bindir)/bzgrep$(EXEEXT) $(DESTDIR)$(bindir)/bzfgrep$(EXEEXT)
66 ln -s $(bindir)/bzmore$(EXEEXT) $(DESTDIR)$(bindir)/bzless$(EXEEXT)
67 ln -s $(bindir)/bzdiff$(EXEEXT) $(DESTDIR)$(bindir)/bzcmp$(EXEEXT)
68
69install-data-hook:
70 echo ".so man1/bzgrep.1" > $(DESTDIR)$(mandir)/man1/bzegrep.1
71 echo ".so man1/bzgrep.1" > $(DESTDIR)$(mandir)/man1/bzfgrep.1
72 echo ".so man1/bzmore.1" > $(DESTDIR)$(mandir)/man1/bzless.1
73 echo ".so man1/bzdiff.1" > $(DESTDIR)$(mandir)/man1/bzcmp.1