source: trunk/minix/commands/bzip2-1.0.3/Makefile@ 9

Last change on this file since 9 was 9, checked in by Mattia Monga, 14 years ago

Minix 3.1.2a

File size: 6.0 KB
Line 
1
2SHELL=/bin/sh
3
4# To assist in cross-compiling
5CC=exec cc
6AR=ar
7ARFLAGS=cr
8RANLIB=ranlib
9LDFLAGS=
10
11BIGFILES=#-D_FILE_OFFSET_BITS=64
12CFLAGS=-Wall -Winline -O -g $(BIGFILES) -Dlstat=stat -D_POSIX_SOURCE=1
13
14# Where you want it installed when you do 'make install'
15PREFIX=/usr/local
16PREFIX_BIN=$(PREFIX)/bin
17PREFIX_LIB=$(PREFIX)/lib
18PREFIX_MAN=$(PREFIX)/man
19PREFIX_INC=$(PREFIX)/include
20
21
22OBJS= blocksort.o \
23 huffman.o \
24 crctable.o \
25 randtable.o \
26 compress.o \
27 decompress.o \
28 bzlib.o
29
30all: all_notest
31
32all_notest: libbz2.a bzip2 bzip2recover
33 chmem =8000000 bzip2
34
35bzip2: libbz2.a bzip2.o
36 $(CC) $(CFLAGS) $(LDFLAGS) -o bzip2 bzip2.o -L. -lbz2
37
38bzip2recover: bzip2recover.o
39 $(CC) $(CFLAGS) $(LDFLAGS) -o bzip2recover bzip2recover.o
40
41libbz2.a: $(OBJS)
42 rm -f libbz2.a
43 $(AR) $(ARFLAGS) libbz2.a $(OBJS)
44 @if ( test -f $(RANLIB) -o -f /usr/bin/ranlib -o \
45 -f /bin/ranlib -o -f /usr/ccs/bin/ranlib ) ; then \
46 echo $(RANLIB) libbz2.a ; \
47 $(RANLIB) libbz2.a ; \
48 fi
49
50check: test
51test: bzip2 test_nodep
52
53test_nodep:
54 @cat words1
55 ./bzip2 -1 < sample1.ref > sample1.rb2
56 ./bzip2 -2 < sample2.ref > sample2.rb2
57 ./bzip2 -3 < sample3.ref > sample3.rb2
58 ./bzip2 -d < sample1.bz2 > sample1.tst
59 ./bzip2 -d < sample2.bz2 > sample2.tst
60 ./bzip2 -ds < sample3.bz2 > sample3.tst
61 cmp sample1.bz2 sample1.rb2
62 cmp sample2.bz2 sample2.rb2
63 cmp sample3.bz2 sample3.rb2
64 cmp sample1.tst sample1.ref
65 cmp sample2.tst sample2.ref
66 cmp sample3.tst sample3.ref
67 @cat words3
68
69install: bzip2 bzip2recover
70 if ( test ! -d $(PREFIX_BIN) ) ; then mkdir -p $(PREFIX_BIN) ; fi
71 if ( test ! -d $(PREFIX_LIB) ) ; then mkdir -p $(PREFIX_LIB) ; fi
72 if ( test ! -d $(PREFIX_MAN) ) ; then mkdir -p $(PREFIX_MAN) ; fi
73 if ( test ! -d $(PREFIX_MAN)/man1 ) ; then mkdir -p $(PREFIX_MAN)/man1 ; fi
74 if ( test ! -d $(PREFIX_INC) ) ; then mkdir -p $(PREFIX_INC) ; fi
75 install -S 8M -o bin bzip2 $(PREFIX_BIN)/bzip2
76 install -S 4M -o bin bzip2 $(PREFIX_BIN)/bunzip2
77 install -S 2450k -o bin bzip2 $(PREFIX_BIN)/smallbunzip2
78 install -o bin bzip2 $(PREFIX_BIN)/bzcat
79 install -o bin bzip2recover $(PREFIX_BIN)/bzip2recover
80 chmod a+x $(PREFIX_BIN)/bzip2
81 chmod a+x $(PREFIX_BIN)/bunzip2
82 chmod a+x $(PREFIX_BIN)/bzcat
83 chmod a+x $(PREFIX_BIN)/bzip2recover
84 install -o bin bzip2.1 $(PREFIX_MAN)/man1
85 chmod a+r $(PREFIX_MAN)/man1/bzip2.1
86 install -o bin bzlib.h $(PREFIX_INC)
87 chmod a+r $(PREFIX_INC)/bzlib.h
88 install -o bin libbz2.a $(PREFIX_LIB)
89 chmod a+r $(PREFIX_LIB)/libbz2.a
90 install -o bin bzgrep $(PREFIX_BIN)/bzgrep
91 ln -f $(PREFIX_BIN)/bzgrep $(PREFIX_BIN)/bzegrep
92 ln -f $(PREFIX_BIN)/bzgrep $(PREFIX_BIN)/bzfgrep
93 chmod a+x $(PREFIX_BIN)/bzgrep
94 install -o bin bzmore $(PREFIX_BIN)/bzmore
95 ln -f $(PREFIX_BIN)/bzmore $(PREFIX_BIN)/bzless
96 chmod a+x $(PREFIX_BIN)/bzmore
97 install -o bin bzdiff $(PREFIX_BIN)/bzdiff
98 ln -f $(PREFIX_BIN)/bzdiff $(PREFIX_BIN)/bzcmp
99 chmod a+x $(PREFIX_BIN)/bzdiff
100 install -o bin bzgrep.1 bzmore.1 bzdiff.1 $(PREFIX_MAN)/man1
101 chmod a+r $(PREFIX_MAN)/man1/bzgrep.1
102 chmod a+r $(PREFIX_MAN)/man1/bzmore.1
103 chmod a+r $(PREFIX_MAN)/man1/bzdiff.1
104 echo ".so man1/bzgrep.1" > $(PREFIX_MAN)/man1/bzegrep.1
105 echo ".so man1/bzgrep.1" > $(PREFIX_MAN)/man1/bzfgrep.1
106 echo ".so man1/bzmore.1" > $(PREFIX_MAN)/man1/bzless.1
107 echo ".so man1/bzdiff.1" > $(PREFIX_MAN)/man1/bzcmp.1
108
109clean:
110 rm -f *.o libbz2.a bzip2 bzip2recover \
111 sample1.rb2 sample2.rb2 sample3.rb2 \
112 sample1.tst sample2.tst sample3.tst
113
114blocksort.o: blocksort.c
115 @cat words0
116 $(CC) $(CFLAGS) -c blocksort.c
117huffman.o: huffman.c
118 $(CC) $(CFLAGS) -c huffman.c
119crctable.o: crctable.c
120 $(CC) $(CFLAGS) -c crctable.c
121randtable.o: randtable.c
122 $(CC) $(CFLAGS) -c randtable.c
123compress.o: compress.c
124 $(CC) $(CFLAGS) -c compress.c
125decompress.o: decompress.c
126 $(CC) $(CFLAGS) -c decompress.c
127bzlib.o: bzlib.c
128 $(CC) $(CFLAGS) -c bzlib.c
129bzip2.o: bzip2.c
130 $(CC) $(CFLAGS) -c bzip2.c
131bzip2recover.o: bzip2recover.c
132 $(CC) $(CFLAGS) -c bzip2recover.c
133
134
135distclean: clean
136 rm -f manual.ps manual.html manual.pdf
137
138DISTNAME=bzip2-1.0.3
139dist: check manual
140 rm -f $(DISTNAME)
141 ln -sf . $(DISTNAME)
142 tar cvf $(DISTNAME).tar \
143 $(DISTNAME)/blocksort.c \
144 $(DISTNAME)/huffman.c \
145 $(DISTNAME)/crctable.c \
146 $(DISTNAME)/randtable.c \
147 $(DISTNAME)/compress.c \
148 $(DISTNAME)/decompress.c \
149 $(DISTNAME)/bzlib.c \
150 $(DISTNAME)/bzip2.c \
151 $(DISTNAME)/bzip2recover.c \
152 $(DISTNAME)/bzlib.h \
153 $(DISTNAME)/bzlib_private.h \
154 $(DISTNAME)/Makefile \
155 $(DISTNAME)/LICENSE \
156 $(DISTNAME)/bzip2.1 \
157 $(DISTNAME)/bzip2.1.preformatted \
158 $(DISTNAME)/bzip2.txt \
159 $(DISTNAME)/words0 \
160 $(DISTNAME)/words1 \
161 $(DISTNAME)/words2 \
162 $(DISTNAME)/words3 \
163 $(DISTNAME)/sample1.ref \
164 $(DISTNAME)/sample2.ref \
165 $(DISTNAME)/sample3.ref \
166 $(DISTNAME)/sample1.bz2 \
167 $(DISTNAME)/sample2.bz2 \
168 $(DISTNAME)/sample3.bz2 \
169 $(DISTNAME)/dlltest.c \
170 $(DISTNAME)/manual.html \
171 $(DISTNAME)/manual.pdf \
172 $(DISTNAME)/manual.ps \
173 $(DISTNAME)/README \
174 $(DISTNAME)/README.COMPILATION.PROBLEMS \
175 $(DISTNAME)/README.XML.STUFF \
176 $(DISTNAME)/CHANGES \
177 $(DISTNAME)/libbz2.def \
178 $(DISTNAME)/libbz2.dsp \
179 $(DISTNAME)/dlltest.dsp \
180 $(DISTNAME)/makefile.msc \
181 $(DISTNAME)/Y2K_INFO \
182 $(DISTNAME)/unzcrash.c \
183 $(DISTNAME)/spewG.c \
184 $(DISTNAME)/mk251.c \
185 $(DISTNAME)/bzdiff \
186 $(DISTNAME)/bzdiff.1 \
187 $(DISTNAME)/bzmore \
188 $(DISTNAME)/bzmore.1 \
189 $(DISTNAME)/bzgrep \
190 $(DISTNAME)/bzgrep.1 \
191 $(DISTNAME)/Makefile-libbz2_so \
192 $(DISTNAME)/bz-common.xsl \
193 $(DISTNAME)/bz-fo.xsl \
194 $(DISTNAME)/bz-html.xsl \
195 $(DISTNAME)/bzip.css \
196 $(DISTNAME)/entities.xml \
197 $(DISTNAME)/manual.xml \
198 $(DISTNAME)/format.pl \
199 $(DISTNAME)/xmlproc.sh
200 gzip -v $(DISTNAME).tar
201
202# For rebuilding the manual from sources on my SuSE 9.1 box
203
204MANUAL_SRCS= bz-common.xsl bz-fo.xsl bz-html.xsl bzip.css \
205 entities.xml manual.xml
206
207manual: manual.html manual.ps manual.pdf
208
209manual.ps: $(MANUAL_SRCS)
210 ./xmlproc.sh -ps manual.xml
211
212manual.pdf: $(MANUAL_SRCS)
213 ./xmlproc.sh -pdf manual.xml
214
215manual.html: $(MANUAL_SRCS)
216 ./xmlproc.sh -html manual.xml
Note: See TracBrowser for help on using the repository browser.