5
5
# To compile and test, type:
6
6
# ./configure; make test
7
# The call of configure is optional if you don't have special requirements
8
# If you wish to build zlib as a shared library, use: ./configure -s
7
# Normally configure builds both a static and a shared library.
8
# If you want to build just a static library, use: ./configure --static
10
10
# To use the asm code, type:
11
11
# cp contrib/asm?86/match.S ./match.S
52
53
OBJC = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \
53
54
zutil.o inflate.o infback.o inftrees.o inffast.o
56
PIC_OBJC = adler32.lo compress.lo crc32.lo gzio.lo uncompr.lo deflate.lo trees.lo \
57
zutil.lo inflate.lo infback.lo inftrees.lo inffast.lo
59
# to use the asm code: make OBJA=match.o, PIC_OBJA=match.lo
56
# to use the asm code: make OBJA=match.o
58
63
OBJS = $(OBJC) $(OBJA)
60
PIC_OBJS = $(OBJS:%.o=%.lo)
62
TEST_OBJS = example.o minigzip.o
64
allstatic: example$(EXE) minigzip$(EXE)
66
allshared: examplesh$(EXE) minigzipsh$(EXE)
68
all: allstatic allshared
65
PIC_OBJS = $(PIC_OBJC) $(PIC_OBJA)
69
static: example$(EXE) minigzip$(EXE)
71
shared: examplesh$(EXE) minigzipsh$(EXE)
73
all64: example64$(EXE) minigzip64$(EXE)
77
test: all teststatic testshared
71
80
@echo hello world | ./minigzip | ./minigzip -d || \
72
81
echo ' *** minigzip test FAILED ***' ; \
73
82
if ./example; then \
76
85
echo ' *** zlib test FAILED ***'; \
80
89
@LD_LIBRARY_PATH=`pwd`:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \
90
LD_LIBRARYN32_PATH=`pwd`:$(LD_LIBRARYN32_PATH) ; export LD_LIBRARYN32_PATH; \
81
91
DYLD_LIBRARY_PATH=`pwd`:$(DYLD_LIBRARY_PATH) ; export DYLD_LIBRARY_PATH; \
82
92
SHLIB_PATH=`pwd`:$(SHLIB_PATH) ; export SHLIB_PATH; \
83
93
echo hello world | ./minigzipsh | ./minigzipsh -d || \
88
98
echo ' *** zlib shared test FAILED ***'; \
91
test: teststatic testshared
102
@echo hello world | ./minigzip64 | ./minigzip64 -d || \
103
echo ' *** minigzip 64-bit test FAILED ***' ; \
104
if ./example64; then \
105
echo ' *** zlib 64-bit test OK ***'; \
107
echo ' *** zlib 64-bit test FAILED ***'; \
108
123
mv _match.o match.lo
112
$(CC) $(SFLAGS) -DPIC -c $< -o $@
126
example64.o: example.c zlib.h zconf.h zlibdefs.h
127
$(CC) $(CFLAGS) -D_FILE_OFFSET_BITS=64 -c -o $@ $<
129
minigzip64.o: minigzip.c zlib.h zconf.h zlibdefs.h
130
$(CC) $(CFLAGS) -D_FILE_OFFSET_BITS=64 -c -o $@ $<
135
-@if [ ! -d objs ]; then mkdir objs; fi
136
$(CC) $(SFLAGS) -DPIC -c -o objs/$*.o $<
114
139
$(SHAREDLIBV): $(PIC_OBJS)
115
$(LDSHARED) -o $@ $(PIC_OBJS) -lc
140
$(LDSHARED) $(SFLAGS) -o $@ $(PIC_OBJS) -lc
116
141
rm -f $(SHAREDLIB) $(SHAREDLIBM)
117
142
ln -s $@ $(SHAREDLIB)
118
143
ln -s $@ $(SHAREDLIBM)
120
example$(EXE): example.o $(LIBS)
146
example$(EXE): example.o $(STATICLIB)
121
147
$(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS)
123
minigzip$(EXE): minigzip.o $(LIBS)
149
minigzip$(EXE): minigzip.o $(STATICLIB)
124
150
$(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS)
126
examplesh$(EXE): example.o $(LIBS)
127
$(CC) $(CFLAGS) -o $@ example.o -L. $(SHAREDLIB)
129
minigzipsh$(EXE): minigzip.o $(LIBS)
130
$(CC) $(CFLAGS) -o $@ minigzip.o -L. $(SHAREDLIB)
152
examplesh$(EXE): example.o $(SHAREDLIBV)
153
$(CC) $(CFLAGS) -o $@ example.o -L. $(SHAREDLIBV)
155
minigzipsh$(EXE): minigzip.o $(SHAREDLIBV)
156
$(CC) $(CFLAGS) -o $@ minigzip.o -L. $(SHAREDLIBV)
158
example64$(EXE): example64.o $(STATICLIB)
159
$(CC) $(CFLAGS) -o $@ example64.o $(LDFLAGS)
161
minigzip64$(EXE): minigzip64.o $(STATICLIB)
162
$(CC) $(CFLAGS) -o $@ minigzip64.o $(LDFLAGS)
132
164
install-libs: $(LIBS)
133
165
-@if [ ! -d $(DESTDIR)$(exec_prefix) ]; then mkdir -p $(DESTDIR)$(exec_prefix); fi
169
201
rm -f *.o *.lo *~ \
170
202
example$(EXE) minigzip$(EXE) examplesh$(EXE) minigzipsh$(EXE) \
203
example64$(EXE) minigzip64$(EXE) \
171
204
libz.* foo.gz so_locations \
172
205
_match.s maketree contrib/infback9/*.o
174
208
maintainer-clean: distclean
187
221
# DO NOT DELETE THIS LINE -- make depend depends on it.
189
adler32.o: zlib.h zconf.h zlibdefs.h
190
compress.o: zlib.h zconf.h zlibdefs.h
191
crc32.o: crc32.h zlib.h zconf.h zlibdefs.h
223
adler32.o gzio.o zutil.o: zutil.h zlib.h zconf.h zlibdefs.h
224
compress.o example.o minigzip.o uncompr.o: zlib.h zconf.h zlibdefs.h
225
crc32.o: zutil.h zlib.h zconf.h zlibdefs.h crc32.h
192
226
deflate.o: deflate.h zutil.h zlib.h zconf.h zlibdefs.h
193
example.o: zlib.h zconf.h zlibdefs.h
194
gzio.o: zutil.h zlib.h zconf.h zlibdefs.h
227
infback.o inflate.o: zutil.h zlib.h zconf.h zlibdefs.h inftrees.h inflate.h inffast.h inffixed.h
195
228
inffast.o: zutil.h zlib.h zconf.h zlibdefs.h inftrees.h inflate.h inffast.h
196
inflate.o: zutil.h zlib.h zconf.h zlibdefs.h inftrees.h inflate.h inffast.h inffixed.h
197
infback.o: zutil.h zlib.h zconf.h zlibdefs.h inftrees.h inflate.h inffast.h inffixed.h
198
229
inftrees.o: zutil.h zlib.h zconf.h zlibdefs.h inftrees.h
199
minigzip.o: zlib.h zconf.h zlibdefs.h
200
230
trees.o: deflate.h zutil.h zlib.h zconf.h zlibdefs.h trees.h
201
uncompr.o: zlib.h zconf.h zlibdefs.h
202
zutil.o: zutil.h zlib.h zconf.h zlibdefs.h
204
adler32.lo: zlib.h zconf.h zlibdefs.h
205
compress.lo: zlib.h zconf.h zlibdefs.h
206
crc32.lo: crc32.h zlib.h zconf.h zlibdefs.h
232
adler32.lo gzio.lo zutil.lo: zutil.h zlib.h zconf.h zlibdefs.h
233
compress.lo example.lo minigzip.lo uncompr.lo: zlib.h zconf.h zlibdefs.h
234
crc32.lo: zutil.h zlib.h zconf.h zlibdefs.h crc32.h
207
235
deflate.lo: deflate.h zutil.h zlib.h zconf.h zlibdefs.h
208
gzio.lo: zutil.h zlib.h zconf.h zlibdefs.h
236
infback.lo inflate.lo: zutil.h zlib.h zconf.h zlibdefs.h inftrees.h inflate.h inffast.h inffixed.h
209
237
inffast.lo: zutil.h zlib.h zconf.h zlibdefs.h inftrees.h inflate.h inffast.h
210
inflate.lo: zutil.h zlib.h zconf.h zlibdefs.h inftrees.h inflate.h inffast.h inffixed.h
211
infback.lo: zutil.h zlib.h zconf.h zlibdefs.h inftrees.h inflate.h inffast.h inffixed.h
212
238
inftrees.lo: zutil.h zlib.h zconf.h zlibdefs.h inftrees.h
213
239
trees.lo: deflate.h zutil.h zlib.h zconf.h zlibdefs.h trees.h
214
uncompr.lo: zlib.h zconf.h zlibdefs.h
215
zutil.lo: zutil.h zlib.h zconf.h zlibdefs.h