2 # Copyright (C) 1995-1998 Jean-loup Gailly.
3 # For conditions of distribution and use, see copyright notice in zlib.h
5 # To compile and test, type:
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
10 # To install /usr/local/lib/libz.* and /usr/local/include/zlib.h, type:
12 # To install in $HOME instead of /usr/local, use:
13 # make install prefix=$HOME
18 #CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
20 #CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
21 # -Wstrict-prototypes -Wmissing-prototypes
36 exec_prefix = ${prefix}
38 OBJS
= adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \
39 zutil.o inflate.o infblock.o inftrees.o infcodes.o infutil.o inffast.o
41 TEST_OBJS
= example.o minigzip.o
43 DISTFILES
= README INDEX ChangeLog configure Make
*[a-z0-9
] *.
[ch
] descrip.mms \
44 algorithm.txt zlib
.3 msdos
/Make
*[a-z0-9
] msdos
/zlib.def msdos
/zlib.rc \
45 nt
/Makefile.nt nt
/zlib.dnt amiga
/Make
*.??? contrib
/README.contrib \
46 contrib
/*.txt contrib
/asm386
/*.asm contrib
/asm386
/*.c \
47 contrib
/asm386
/*.bat contrib
/asm386
/zlibvc.d?? contrib
/iostream
/*.
cpp \
48 contrib
/iostream
/*.h contrib
/iostream2
/*.h contrib
/iostream2
/*.
cpp \
49 contrib
/untgz
/Makefile contrib
/untgz
/*.c contrib
/untgz
/*.w32 \
50 contrib
/minizip
/[CM
]*[pe
] contrib
/minizip
/*.
[ch
] contrib
/minizip
/*.
[td
]??
56 @LD_LIBRARY_PATH
=.
:$(LD_LIBRARY_PATH
) ; export LD_LIBRARY_PATH
; \
57 echo hello world | .
/minigzip | .
/minigzip
-d || \
58 echo
' *** minigzip test FAILED ***' ; \
60 echo
' *** zlib test OK ***'; \
62 echo
' *** zlib test FAILED ***'; \
67 -@
($(RANLIB
) $@ || true
) >/dev
/null
2>&1
69 $(SHAREDLIB
).
$(VER
): $(OBJS
)
70 $(LDSHARED
) -o
$@
$(OBJS
)
71 rm -f
$(SHAREDLIB
) $(SHAREDLIB
).1
73 ln
-s
$@
$(SHAREDLIB
).1
75 example
: example.o
$(LIBS
)
76 $(CC
) $(CFLAGS
) -o
$@ example.o
$(LDFLAGS
)
78 minigzip
: minigzip.o
$(LIBS
)
79 $(CC
) $(CFLAGS
) -o
$@ minigzip.o
$(LDFLAGS
)
82 -@if
[ ! -d
$(prefix)/include ]; then mkdir
$(prefix)/include; fi
83 -@if
[ ! -d
$(exec_prefix)/lib
]; then mkdir
$(exec_prefix)/lib
; fi
84 cp zlib.h zconf.h
$(prefix)/include
85 chmod
644 $(prefix)/include/zlib.h
$(prefix)/include/zconf.h
86 cp
$(LIBS
) $(exec_prefix)/lib
87 cd
$(exec_prefix)/lib
; chmod
755 $(LIBS
)
88 -@
(cd
$(exec_prefix)/lib
; $(RANLIB
) libz.a || true
) >/dev
/null
2>&1
89 cd
$(exec_prefix)/lib
; if
test -f
$(SHAREDLIB
).
$(VER
); then \
90 rm -f
$(SHAREDLIB
) $(SHAREDLIB
).1; \
91 ln
-s
$(SHAREDLIB
).
$(VER
) $(SHAREDLIB
); \
92 ln
-s
$(SHAREDLIB
).
$(VER
) $(SHAREDLIB
).1; \
93 (ldconfig || true
) >/dev
/null
2>&1; \
95 # The ranlib in install is needed on NeXTSTEP which checks file times
96 # ldconfig is for Linux
99 cd
$(prefix)/include; \
101 if
test -f zlib.h
; then \
102 v
=`sed -n '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`; \
103 rm -f zlib.h zconf.h
; \
105 cd
$(exec_prefix)/lib
; rm -f libz.a
; \
106 if
test -f
$(SHAREDLIB
).
$$v; then \
107 rm -f
$(SHAREDLIB
).
$$v $(SHAREDLIB
) $(SHAREDLIB
).1; \
111 rm -f
*.o
*~ example minigzip libz.a libz.so
* foo.gz
116 mv Makefile Makefile~
; cp
-p Makefile.in Makefile
117 rm -f
test.c ztest
*.c contrib
/minizip
/test.zip
118 v
=`sed -n -e 's/\.//g' -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\
119 zip
-ul9 zlib
$$v $(DISTFILES
)
120 mv Makefile~ Makefile
123 mv Makefile Makefile~
; cp
-p Makefile.in Makefile
124 rm -f
test.c ztest
*.c contrib
/minizip
/test.zip
125 d
=zlib-
`sed -n '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\
127 if
test ! -d ..
/$$d; then
rm -f ..
/$$d; ln
-s
`pwd` ..
/$$d; fi
; \
129 for f in
$(DISTFILES
); do files
="$$files $$d/$$f"; done
; \
131 GZIP
=-9 $(TAR
) chofz
$$d/$$d.
tar.gz
$$files; \
132 if
test ! -d
$$d; then
rm -f
$$d; fi
133 mv Makefile~ Makefile
139 makedepend
-- $(CFLAGS
) -- *.
[ch
]
141 # DO NOT DELETE THIS LINE -- make depend depends on it.
143 adler32.o
: zlib.h zconf.h
144 compress.o
: zlib.h zconf.h
145 crc32.o
: zlib.h zconf.h
146 deflate.o
: deflate.h zutil.h zlib.h zconf.h
147 example.o
: zlib.h zconf.h
148 gzio.o
: zutil.h zlib.h zconf.h
149 infblock.o
: infblock.h inftrees.h infcodes.h infutil.h zutil.h zlib.h zconf.h
150 infcodes.o
: zutil.h zlib.h zconf.h
151 infcodes.o
: inftrees.h infblock.h infcodes.h infutil.h inffast.h
152 inffast.o
: zutil.h zlib.h zconf.h inftrees.h
153 inffast.o
: infblock.h infcodes.h infutil.h inffast.h
154 inflate.o
: zutil.h zlib.h zconf.h infblock.h
155 inftrees.o
: zutil.h zlib.h zconf.h inftrees.h
156 infutil.o
: zutil.h zlib.h zconf.h infblock.h inftrees.h infcodes.h infutil.h
157 minigzip.o
: zlib.h zconf.h
158 trees.o
: deflate.h zutil.h zlib.h zconf.h trees.h
159 uncompr.o
: zlib.h zconf.h
160 zutil.o
: zutil.h zlib.h zconf.h