Debian Codegraph @

pit/suse-bzip2/Makefile

raw symbols SCIP
1 # ------------------------------------------------------------------
2 # This file is part of bzip2/libbzip2, a program and library for
3 # lossless, block-sorting data compression.
4 #
5 # bzip2/libbzip2 version 1.0.6 of 6 September 2010
6 # Copyright (C) 1996-2010 Julian Seward <[email protected]>
7 #
8 # Please read the WARNING, DISCLAIMER and PATENTS sections in the
9 # README file.
10 #
11 # This program is released under the terms of the license contained
12 # in the file LICENSE.
13 # ------------------------------------------------------------------
14
15 somajor=1.0
16 sominor=$(somajor).4
17 SHELL=/bin/sh
18
19 # Determine the operating system name to decide whether to build a
20 # shared object library libbz2.so or a dynamic library libbz2.dylib.
21 UNAME_S := $(shell uname -s)
22
23 # To assist in cross-compiling
24 CC=gcc
25 AR=ar
26 RANLIB=ranlib
27 LDFLAGS=
28
29 BIGFILES=-D_FILE_OFFSET_BITS=64
30 CFLAGS=-Wall -Winline -O2 -g $(BIGFILES) $(DEBCFLAGS)
31
32 # Where you want it installed when you do 'make install'
33 PREFIX=/usr/local
34
35
36 OBJS= blocksort.o \
37 huffman.o \
38 crctable.o \
39 randtable.o \
40 compress.o \
41 decompress.o \
42 bzlib.o
43
44 all: libbz2.a bzip2
45
46 ifeq ("$(UNAME_S)","Darwin")
47 soext=dylib
48 soext_major=$(somajor).$(soext)
49 soext_minor=$(sominor).$(soext)
50 LDDLFLAGS=-dynamiclib \
51 -Wl,-headerpad_max_install_names,-undefined,dynamic_lookup,-compatibility_version,$(somajor),-current_version,$(sominor),-install_name,$(PREFIX)/lib/pristine-tar/suse-bzip2/libbz2.$(soext_minor)
52 else
53 soext=so
54 soext_major=$(soext).$(somajor)
55 soext_minor=$(soext).$(sominor)
56 LDDLFLAGS=-shared -Wl,-soname,libbz2.$(soext_major)
57 endif
58
59 LDDLFLAGS += $(patsubst -fPIE -pie,,$(LDFLAGS))
60
61 bzip2: libbz2.$(soext) bzip2.o
62 $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o bzip2 bzip2.o -L. -lbz2
63
64 bzip2recover: bzip2recover.o
65 $(CC) $(CPPFLAGS) $(CFLAGS) $(LDFLAGS) -o bzip2recover bzip2recover.o
66
67 libbz2.a: $(OBJS)
68 rm -f libbz2.a
69 $(AR) cq libbz2.a $(OBJS)
70 @if ( test -f $(RANLIB) || test -f /usr/bin/ranlib || \
71 test -f /bin/ranlib || test -f /usr/ccs/bin/ranlib ) ; then \
72 echo $(RANLIB) libbz2.a ; \
73 $(RANLIB) libbz2.a ; \
74 fi
75
76 libbz2.$(soext): libbz2.$(soext_major)
77 ln -sf $< $@
78
79 libbz2.$(soext_major): libbz2.$(soext_minor)
80 ln -sf $< $@
81
82 libbz2.$(soext_minor): $(OBJS:%.o=%.sho)
83 $(CC) $(LDDLFLAGS) -o $@ $^ -lc
84
85 %.sho: %.c
86 $(CC) $(CPPFLAGS) $(CFLAGS) -D_REENTRANT -fPIC -o $@ -c $<
87
88 %.o: %.c
89 $(CC) $(CPPFLAGS) $(CFLAGS) -D_REENTRANT -o $@ -c $<
90
91 check: test
92
93 ifeq ("${UNAME_S}", "Darwin")
94 # On Mac OS X, $DYLD_LIBRARY_PATH needs to be set to test libbz2.dylib.
95 LD_PATH_VAR=DYLD_LIBRARY_PATH
96 else
97 # On all other (Unix-like) systems, set $LD_LIBRARY_PATH to test libbz2.so.
98 LD_PATH_VAR=LD_LIBRARY_PATH
99 endif
100
101 test: bzip2
102 @cat words1
103 $(LD_PATH_VAR)=.:$$$(LD_PATH_VAR) \
104 ./bzip2 -1 < sample1.ref > sample1.rb2
105 $(LD_PATH_VAR)=.:$$$(LD_PATH_VAR) \
106 ./bzip2 -2 < sample2.ref > sample2.rb2
107 $(LD_PATH_VAR)=.:$$$(LD_PATH_VAR) \
108 ./bzip2 -3 < sample3.ref > sample3.rb2
109 $(LD_PATH_VAR)=.:$$$(LD_PATH_VAR) \
110 ./bzip2 -d < sample1.bz2 > sample1.tst
111 $(LD_PATH_VAR)=.:$$$(LD_PATH_VAR) \
112 ./bzip2 -d < sample2.bz2 > sample2.tst
113 $(LD_PATH_VAR)=.:$$$(LD_PATH_VAR) \
114 ./bzip2 -ds < sample3.bz2 > sample3.tst
115 cmp sample1.bz2 sample1.rb2
116 cmp sample2.bz2 sample2.rb2
117 cmp sample3.bz2 sample3.rb2
118 cmp sample1.tst sample1.ref
119 cmp sample2.tst sample2.ref
120 cmp sample3.tst sample3.ref
121 @cat words3
122
123 install: bzip2 bzip2recover libbz2.a
124 if ( test ! -d $(PREFIX)/bin ) ; then mkdir -p $(PREFIX)/bin ; fi
125 if ( test ! -d $(PREFIX)/lib ) ; then mkdir -p $(PREFIX)/lib ; fi
126 if ( test ! -d $(PREFIX)/man ) ; then mkdir -p $(PREFIX)/man ; fi
127 if ( test ! -d $(PREFIX)/man/man1 ) ; then mkdir -p $(PREFIX)/man/man1 ; fi
128 if ( test ! -d $(PREFIX)/include ) ; then mkdir -p $(PREFIX)/include ; fi
129 cp -f bzip2 $(PREFIX)/bin/bzip2
130 ln $(PREFIX)/bin/bzip2 $(PREFIX)/bin/bunzip2
131 ln $(PREFIX)/bin/bzip2 $(PREFIX)/bin/bzcat
132 cp -f bzip2recover $(PREFIX)/bin/bzip2recover
133 chmod a+x $(PREFIX)/bin/bzip2
134 chmod a+x $(PREFIX)/bin/bunzip2
135 chmod a+x $(PREFIX)/bin/bzcat
136 chmod a+x $(PREFIX)/bin/bzip2recover
137 cp -f bzip2.1 $(PREFIX)/man/man1
138 chmod a+r $(PREFIX)/man/man1/bzip2.1
139 cp -f bzlib.h $(PREFIX)/include
140 chmod a+r $(PREFIX)/include/bzlib.h
141 cp -fa libbz2.a libbz2.so* $(PREFIX)/lib
142 chmod a+r $(PREFIX)/lib/libbz2.a
143 cp -f bzexe $(PREFIX)/bin/bzexe
144 chmod a+x $(PREFIX)/bin/bzexe
145 cp -f bzgrep $(PREFIX)/bin/bzgrep
146 ln -s -f $(PREFIX)/bin/bzgrep $(PREFIX)/bin/bzegrep
147 ln -s -f $(PREFIX)/bin/bzgrep $(PREFIX)/bin/bzfgrep
148 chmod a+x $(PREFIX)/bin/bzgrep
149 cp -f bzmore $(PREFIX)/bin/bzmore
150 ln -s -f $(PREFIX)/bin/bzmore $(PREFIX)/bin/bzless
151 chmod a+x $(PREFIX)/bin/bzmore
152 cp -f bzdiff $(PREFIX)/bin/bzdiff
153 ln -s -f $(PREFIX)/bin/bzdiff $(PREFIX)/bin/bzcmp
154 chmod a+x $(PREFIX)/bin/bzdiff
155 cp -f bzexe.1 bzgrep.1 bzmore.1 bzdiff.1 $(PREFIX)/man/man1
156 chmod a+r $(PREFIX)/man/man1/bzexe.1
157 chmod a+r $(PREFIX)/man/man1/bzgrep.1
158 chmod a+r $(PREFIX)/man/man1/bzmore.1
159 chmod a+r $(PREFIX)/man/man1/bzdiff.1
160 echo ".so man1/bzgrep.1" > $(PREFIX)/man/man1/bzegrep.1
161 echo ".so man1/bzgrep.1" > $(PREFIX)/man/man1/bzfgrep.1
162 echo ".so man1/bzmore.1" > $(PREFIX)/man/man1/bzless.1
163 echo ".so man1/bzdiff.1" > $(PREFIX)/man/man1/bzcmp.1
164
165 clean:
166 rm -f *.o *.sho libbz2.a libbz2.so* libbz2.*.dylib \
167 bzip2 bzip2recover \
168 sample1.rb2 sample2.rb2 sample3.rb2 \
169 sample1.tst sample2.tst sample3.tst
170
171
172 distclean: clean
173 #rm -f manual.ps manual.html manual.pdf
174
175 DISTNAME=bzip2-1.0.6
176 dist: check manual
177 rm -f $(DISTNAME)
178 ln -s -f . $(DISTNAME)
179 tar cvf $(DISTNAME).tar \
180 $(DISTNAME)/blocksort.c \
181 $(DISTNAME)/huffman.c \
182 $(DISTNAME)/crctable.c \
183 $(DISTNAME)/randtable.c \
184 $(DISTNAME)/compress.c \
185 $(DISTNAME)/decompress.c \
186 $(DISTNAME)/bzlib.c \
187 $(DISTNAME)/bzip2.c \
188 $(DISTNAME)/bzip2recover.c \
189 $(DISTNAME)/bzlib.h \
190 $(DISTNAME)/bzlib_private.h \
191 $(DISTNAME)/Makefile \
192 $(DISTNAME)/LICENSE \
193 $(DISTNAME)/bzip2.1 \
194 $(DISTNAME)/bzip2.1.preformatted \
195 $(DISTNAME)/bzip2.txt \
196 $(DISTNAME)/words0 \
197 $(DISTNAME)/words1 \
198 $(DISTNAME)/words2 \
199 $(DISTNAME)/words3 \
200 $(DISTNAME)/sample1.ref \
201 $(DISTNAME)/sample2.ref \
202 $(DISTNAME)/sample3.ref \
203 $(DISTNAME)/sample1.bz2 \
204 $(DISTNAME)/sample2.bz2 \
205 $(DISTNAME)/sample3.bz2 \
206 $(DISTNAME)/dlltest.c \
207 $(DISTNAME)/manual.html \
208 $(DISTNAME)/manual.pdf \
209 $(DISTNAME)/manual.ps \
210 $(DISTNAME)/README \
211 $(DISTNAME)/README.COMPILATION.PROBLEMS \
212 $(DISTNAME)/README.XML.STUFF \
213 $(DISTNAME)/CHANGES \
214 $(DISTNAME)/libbz2.def \
215 $(DISTNAME)/libbz2.dsp \
216 $(DISTNAME)/dlltest.dsp \
217 $(DISTNAME)/makefile.msc \
218 $(DISTNAME)/unzcrash.c \
219 $(DISTNAME)/spewG.c \
220 $(DISTNAME)/mk251.c \
221 $(DISTNAME)/bzdiff \
222 $(DISTNAME)/bzdiff.1 \
223 $(DISTNAME)/bzmore \
224 $(DISTNAME)/bzmore.1 \
225 $(DISTNAME)/bzexe \
226 $(DISTNAME)/bzexe.1 \
227 $(DISTNAME)/bzgrep \
228 $(DISTNAME)/bzgrep.1 \
229 $(DISTNAME)/Makefile-libbz2_so \
230 $(DISTNAME)/bz-common.xsl \
231 $(DISTNAME)/bz-fo.xsl \
232 $(DISTNAME)/bz-html.xsl \
233 $(DISTNAME)/bzip.css \
234 $(DISTNAME)/entities.xml \
235 $(DISTNAME)/manual.xml \
236 $(DISTNAME)/format.pl \
237 $(DISTNAME)/xmlproc.sh
238 gzip -v $(DISTNAME).tar
239
240 # For rebuilding the manual from sources on my SuSE 9.1 box
241
242 MANUAL_SRCS= bz-common.xsl bz-fo.xsl bz-html.xsl bzip.css \
243 entities.xml manual.xml
244
245 manual: manual.html manual.ps manual.pdf
246
247 manual.ps: $(MANUAL_SRCS)
248 ./xmlproc.sh -ps manual.xml
249
250 manual.pdf: $(MANUAL_SRCS)
251 ./xmlproc.sh -pdf manual.xml
252
253 manual.html: $(MANUAL_SRCS)
254 ./xmlproc.sh -html manual.xml