1275793eaSopenharmony_ci# Makefile for zlib
2275793eaSopenharmony_ci# Copyright (C) 1995-2024 Jean-loup Gailly, Mark Adler
3275793eaSopenharmony_ci# For conditions of distribution and use, see copyright notice in zlib.h
4275793eaSopenharmony_ci
5275793eaSopenharmony_ci# To compile and test, type:
6275793eaSopenharmony_ci#    ./configure; make test
7275793eaSopenharmony_ci# Normally configure builds both a static and a shared library.
8275793eaSopenharmony_ci# If you want to build just a static library, use: ./configure --static
9275793eaSopenharmony_ci
10275793eaSopenharmony_ci# To install /usr/local/lib/libz.* and /usr/local/include/zlib.h, type:
11275793eaSopenharmony_ci#    make install
12275793eaSopenharmony_ci# To install in $HOME instead of /usr/local, use:
13275793eaSopenharmony_ci#    make install prefix=$HOME
14275793eaSopenharmony_ci
15275793eaSopenharmony_ciCC=cc
16275793eaSopenharmony_ci
17275793eaSopenharmony_ciCFLAGS=-O
18275793eaSopenharmony_ci#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
19275793eaSopenharmony_ci#CFLAGS=-g -DZLIB_DEBUG
20275793eaSopenharmony_ci#CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
21275793eaSopenharmony_ci#           -Wstrict-prototypes -Wmissing-prototypes
22275793eaSopenharmony_ci
23275793eaSopenharmony_ciSFLAGS=-O
24275793eaSopenharmony_ciLDFLAGS=
25275793eaSopenharmony_ciTEST_LIBS=-L. libz.a
26275793eaSopenharmony_ciLDSHARED=$(CC)
27275793eaSopenharmony_ciCPP=$(CC) -E
28275793eaSopenharmony_ci
29275793eaSopenharmony_ciSTATICLIB=libz.a
30275793eaSopenharmony_ciSHAREDLIB=libz.so
31275793eaSopenharmony_ciSHAREDLIBV=libz.so.1.3.1
32275793eaSopenharmony_ciSHAREDLIBM=libz.so.1
33275793eaSopenharmony_ciLIBS=$(STATICLIB) $(SHAREDLIBV)
34275793eaSopenharmony_ci
35275793eaSopenharmony_ciAR=ar
36275793eaSopenharmony_ciARFLAGS=rc
37275793eaSopenharmony_ciRANLIB=ranlib
38275793eaSopenharmony_ciLDCONFIG=ldconfig
39275793eaSopenharmony_ciLDSHAREDLIBC=-lc
40275793eaSopenharmony_ciTAR=tar
41275793eaSopenharmony_ciSHELL=/bin/sh
42275793eaSopenharmony_ciEXE=
43275793eaSopenharmony_ci
44275793eaSopenharmony_ciprefix = /usr/local
45275793eaSopenharmony_ciexec_prefix = ${prefix}
46275793eaSopenharmony_cilibdir = ${exec_prefix}/lib
47275793eaSopenharmony_cisharedlibdir = ${libdir}
48275793eaSopenharmony_ciincludedir = ${prefix}/include
49275793eaSopenharmony_cimandir = ${prefix}/share/man
50275793eaSopenharmony_ciman3dir = ${mandir}/man3
51275793eaSopenharmony_cipkgconfigdir = ${libdir}/pkgconfig
52275793eaSopenharmony_ciSRCDIR=
53275793eaSopenharmony_ciZINC=
54275793eaSopenharmony_ciZINCOUT=-I.
55275793eaSopenharmony_ci
56275793eaSopenharmony_ciOBJZ = adler32.o crc32.o deflate.o infback.o inffast.o inflate.o inftrees.o trees.o zutil.o
57275793eaSopenharmony_ciOBJG = compress.o uncompr.o gzclose.o gzlib.o gzread.o gzwrite.o
58275793eaSopenharmony_ciOBJC = $(OBJZ) $(OBJG)
59275793eaSopenharmony_ci
60275793eaSopenharmony_ciPIC_OBJZ = adler32.lo crc32.lo deflate.lo infback.lo inffast.lo inflate.lo inftrees.lo trees.lo zutil.lo
61275793eaSopenharmony_ciPIC_OBJG = compress.lo uncompr.lo gzclose.lo gzlib.lo gzread.lo gzwrite.lo
62275793eaSopenharmony_ciPIC_OBJC = $(PIC_OBJZ) $(PIC_OBJG)
63275793eaSopenharmony_ci
64275793eaSopenharmony_ci# to use the asm code: make OBJA=match.o, PIC_OBJA=match.lo
65275793eaSopenharmony_ciOBJA =
66275793eaSopenharmony_ciPIC_OBJA =
67275793eaSopenharmony_ci
68275793eaSopenharmony_ciOBJS = $(OBJC) $(OBJA)
69275793eaSopenharmony_ci
70275793eaSopenharmony_ciPIC_OBJS = $(PIC_OBJC) $(PIC_OBJA)
71275793eaSopenharmony_ci
72275793eaSopenharmony_ciall: static shared
73275793eaSopenharmony_ci
74275793eaSopenharmony_cistatic: example$(EXE) minigzip$(EXE)
75275793eaSopenharmony_ci
76275793eaSopenharmony_cishared: examplesh$(EXE) minigzipsh$(EXE)
77275793eaSopenharmony_ci
78275793eaSopenharmony_ciall64: example64$(EXE) minigzip64$(EXE)
79275793eaSopenharmony_ci
80275793eaSopenharmony_cicheck: test
81275793eaSopenharmony_ci
82275793eaSopenharmony_citest: all teststatic testshared
83275793eaSopenharmony_ci
84275793eaSopenharmony_citeststatic: static
85275793eaSopenharmony_ci	@TMPST=tmpst_$$; \
86275793eaSopenharmony_ci	if echo hello world | ${QEMU_RUN} ./minigzip | ${QEMU_RUN} ./minigzip -d && ${QEMU_RUN} ./example $$TMPST ; then \
87275793eaSopenharmony_ci	  echo '		*** zlib test OK ***'; \
88275793eaSopenharmony_ci	else \
89275793eaSopenharmony_ci	  echo '		*** zlib test FAILED ***'; false; \
90275793eaSopenharmony_ci	fi
91275793eaSopenharmony_ci	@rm -f tmpst_$$
92275793eaSopenharmony_ci
93275793eaSopenharmony_citestshared: shared
94275793eaSopenharmony_ci	@LD_LIBRARY_PATH=`pwd`:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \
95275793eaSopenharmony_ci	LD_LIBRARYN32_PATH=`pwd`:$(LD_LIBRARYN32_PATH) ; export LD_LIBRARYN32_PATH; \
96275793eaSopenharmony_ci	DYLD_LIBRARY_PATH=`pwd`:$(DYLD_LIBRARY_PATH) ; export DYLD_LIBRARY_PATH; \
97275793eaSopenharmony_ci	SHLIB_PATH=`pwd`:$(SHLIB_PATH) ; export SHLIB_PATH; \
98275793eaSopenharmony_ci	TMPSH=tmpsh_$$; \
99275793eaSopenharmony_ci	if echo hello world | ${QEMU_RUN} ./minigzipsh | ${QEMU_RUN} ./minigzipsh -d && ${QEMU_RUN} ./examplesh $$TMPSH; then \
100275793eaSopenharmony_ci	  echo '		*** zlib shared test OK ***'; \
101275793eaSopenharmony_ci	else \
102275793eaSopenharmony_ci	  echo '		*** zlib shared test FAILED ***'; false; \
103275793eaSopenharmony_ci	fi
104275793eaSopenharmony_ci	@rm -f tmpsh_$$
105275793eaSopenharmony_ci
106275793eaSopenharmony_citest64: all64
107275793eaSopenharmony_ci	@TMP64=tmp64_$$; \
108275793eaSopenharmony_ci	if echo hello world | ${QEMU_RUN} ./minigzip64 | ${QEMU_RUN} ./minigzip64 -d && ${QEMU_RUN} ./example64 $$TMP64; then \
109275793eaSopenharmony_ci	  echo '		*** zlib 64-bit test OK ***'; \
110275793eaSopenharmony_ci	else \
111275793eaSopenharmony_ci	  echo '		*** zlib 64-bit test FAILED ***'; false; \
112275793eaSopenharmony_ci	fi
113275793eaSopenharmony_ci	@rm -f tmp64_$$
114275793eaSopenharmony_ci
115275793eaSopenharmony_ciinfcover.o: $(SRCDIR)test/infcover.c $(SRCDIR)zlib.h zconf.h
116275793eaSopenharmony_ci	$(CC) $(CFLAGS) $(ZINCOUT) -c -o $@ $(SRCDIR)test/infcover.c
117275793eaSopenharmony_ci
118275793eaSopenharmony_ciinfcover: infcover.o libz.a
119275793eaSopenharmony_ci	$(CC) $(CFLAGS) -o $@ infcover.o libz.a
120275793eaSopenharmony_ci
121275793eaSopenharmony_cicover: infcover
122275793eaSopenharmony_ci	rm -f *.gcda
123275793eaSopenharmony_ci	${QEMU_RUN} ./infcover
124275793eaSopenharmony_ci	gcov inf*.c
125275793eaSopenharmony_ci
126275793eaSopenharmony_cilibz.a: $(OBJS)
127275793eaSopenharmony_ci	$(AR) $(ARFLAGS) $@ $(OBJS)
128275793eaSopenharmony_ci	-@ ($(RANLIB) $@ || true) >/dev/null 2>&1
129275793eaSopenharmony_ci
130275793eaSopenharmony_cimatch.o: match.S
131275793eaSopenharmony_ci	$(CPP) match.S > _match.s
132275793eaSopenharmony_ci	$(CC) -c _match.s
133275793eaSopenharmony_ci	mv _match.o match.o
134275793eaSopenharmony_ci	rm -f _match.s
135275793eaSopenharmony_ci
136275793eaSopenharmony_cimatch.lo: match.S
137275793eaSopenharmony_ci	$(CPP) match.S > _match.s
138275793eaSopenharmony_ci	$(CC) -c -fPIC _match.s
139275793eaSopenharmony_ci	mv _match.o match.lo
140275793eaSopenharmony_ci	rm -f _match.s
141275793eaSopenharmony_ci
142275793eaSopenharmony_ciexample.o: $(SRCDIR)test/example.c $(SRCDIR)zlib.h zconf.h
143275793eaSopenharmony_ci	$(CC) $(CFLAGS) $(ZINCOUT) -c -o $@ $(SRCDIR)test/example.c
144275793eaSopenharmony_ci
145275793eaSopenharmony_ciminigzip.o: $(SRCDIR)test/minigzip.c $(SRCDIR)zlib.h zconf.h
146275793eaSopenharmony_ci	$(CC) $(CFLAGS) $(ZINCOUT) -c -o $@ $(SRCDIR)test/minigzip.c
147275793eaSopenharmony_ci
148275793eaSopenharmony_ciexample64.o: $(SRCDIR)test/example.c $(SRCDIR)zlib.h zconf.h
149275793eaSopenharmony_ci	$(CC) $(CFLAGS) $(ZINCOUT) -D_FILE_OFFSET_BITS=64 -c -o $@ $(SRCDIR)test/example.c
150275793eaSopenharmony_ci
151275793eaSopenharmony_ciminigzip64.o: $(SRCDIR)test/minigzip.c $(SRCDIR)zlib.h zconf.h
152275793eaSopenharmony_ci	$(CC) $(CFLAGS) $(ZINCOUT) -D_FILE_OFFSET_BITS=64 -c -o $@ $(SRCDIR)test/minigzip.c
153275793eaSopenharmony_ci
154275793eaSopenharmony_ci
155275793eaSopenharmony_ciadler32.o: $(SRCDIR)adler32.c
156275793eaSopenharmony_ci	$(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)adler32.c
157275793eaSopenharmony_ci
158275793eaSopenharmony_cicrc32.o: $(SRCDIR)crc32.c
159275793eaSopenharmony_ci	$(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)crc32.c
160275793eaSopenharmony_ci
161275793eaSopenharmony_cideflate.o: $(SRCDIR)deflate.c
162275793eaSopenharmony_ci	$(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)deflate.c
163275793eaSopenharmony_ci
164275793eaSopenharmony_ciinfback.o: $(SRCDIR)infback.c
165275793eaSopenharmony_ci	$(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)infback.c
166275793eaSopenharmony_ci
167275793eaSopenharmony_ciinffast.o: $(SRCDIR)inffast.c
168275793eaSopenharmony_ci	$(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)inffast.c
169275793eaSopenharmony_ci
170275793eaSopenharmony_ciinflate.o: $(SRCDIR)inflate.c
171275793eaSopenharmony_ci	$(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)inflate.c
172275793eaSopenharmony_ci
173275793eaSopenharmony_ciinftrees.o: $(SRCDIR)inftrees.c
174275793eaSopenharmony_ci	$(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)inftrees.c
175275793eaSopenharmony_ci
176275793eaSopenharmony_citrees.o: $(SRCDIR)trees.c
177275793eaSopenharmony_ci	$(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)trees.c
178275793eaSopenharmony_ci
179275793eaSopenharmony_cizutil.o: $(SRCDIR)zutil.c
180275793eaSopenharmony_ci	$(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)zutil.c
181275793eaSopenharmony_ci
182275793eaSopenharmony_cicompress.o: $(SRCDIR)compress.c
183275793eaSopenharmony_ci	$(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)compress.c
184275793eaSopenharmony_ci
185275793eaSopenharmony_ciuncompr.o: $(SRCDIR)uncompr.c
186275793eaSopenharmony_ci	$(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)uncompr.c
187275793eaSopenharmony_ci
188275793eaSopenharmony_cigzclose.o: $(SRCDIR)gzclose.c
189275793eaSopenharmony_ci	$(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)gzclose.c
190275793eaSopenharmony_ci
191275793eaSopenharmony_cigzlib.o: $(SRCDIR)gzlib.c
192275793eaSopenharmony_ci	$(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)gzlib.c
193275793eaSopenharmony_ci
194275793eaSopenharmony_cigzread.o: $(SRCDIR)gzread.c
195275793eaSopenharmony_ci	$(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)gzread.c
196275793eaSopenharmony_ci
197275793eaSopenharmony_cigzwrite.o: $(SRCDIR)gzwrite.c
198275793eaSopenharmony_ci	$(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)gzwrite.c
199275793eaSopenharmony_ci
200275793eaSopenharmony_ci
201275793eaSopenharmony_ciadler32.lo: $(SRCDIR)adler32.c
202275793eaSopenharmony_ci	-@mkdir objs 2>/dev/null || test -d objs
203275793eaSopenharmony_ci	$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/adler32.o $(SRCDIR)adler32.c
204275793eaSopenharmony_ci	-@mv objs/adler32.o $@
205275793eaSopenharmony_ci
206275793eaSopenharmony_cicrc32.lo: $(SRCDIR)crc32.c
207275793eaSopenharmony_ci	-@mkdir objs 2>/dev/null || test -d objs
208275793eaSopenharmony_ci	$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/crc32.o $(SRCDIR)crc32.c
209275793eaSopenharmony_ci	-@mv objs/crc32.o $@
210275793eaSopenharmony_ci
211275793eaSopenharmony_cideflate.lo: $(SRCDIR)deflate.c
212275793eaSopenharmony_ci	-@mkdir objs 2>/dev/null || test -d objs
213275793eaSopenharmony_ci	$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/deflate.o $(SRCDIR)deflate.c
214275793eaSopenharmony_ci	-@mv objs/deflate.o $@
215275793eaSopenharmony_ci
216275793eaSopenharmony_ciinfback.lo: $(SRCDIR)infback.c
217275793eaSopenharmony_ci	-@mkdir objs 2>/dev/null || test -d objs
218275793eaSopenharmony_ci	$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/infback.o $(SRCDIR)infback.c
219275793eaSopenharmony_ci	-@mv objs/infback.o $@
220275793eaSopenharmony_ci
221275793eaSopenharmony_ciinffast.lo: $(SRCDIR)inffast.c
222275793eaSopenharmony_ci	-@mkdir objs 2>/dev/null || test -d objs
223275793eaSopenharmony_ci	$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/inffast.o $(SRCDIR)inffast.c
224275793eaSopenharmony_ci	-@mv objs/inffast.o $@
225275793eaSopenharmony_ci
226275793eaSopenharmony_ciinflate.lo: $(SRCDIR)inflate.c
227275793eaSopenharmony_ci	-@mkdir objs 2>/dev/null || test -d objs
228275793eaSopenharmony_ci	$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/inflate.o $(SRCDIR)inflate.c
229275793eaSopenharmony_ci	-@mv objs/inflate.o $@
230275793eaSopenharmony_ci
231275793eaSopenharmony_ciinftrees.lo: $(SRCDIR)inftrees.c
232275793eaSopenharmony_ci	-@mkdir objs 2>/dev/null || test -d objs
233275793eaSopenharmony_ci	$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/inftrees.o $(SRCDIR)inftrees.c
234275793eaSopenharmony_ci	-@mv objs/inftrees.o $@
235275793eaSopenharmony_ci
236275793eaSopenharmony_citrees.lo: $(SRCDIR)trees.c
237275793eaSopenharmony_ci	-@mkdir objs 2>/dev/null || test -d objs
238275793eaSopenharmony_ci	$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/trees.o $(SRCDIR)trees.c
239275793eaSopenharmony_ci	-@mv objs/trees.o $@
240275793eaSopenharmony_ci
241275793eaSopenharmony_cizutil.lo: $(SRCDIR)zutil.c
242275793eaSopenharmony_ci	-@mkdir objs 2>/dev/null || test -d objs
243275793eaSopenharmony_ci	$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/zutil.o $(SRCDIR)zutil.c
244275793eaSopenharmony_ci	-@mv objs/zutil.o $@
245275793eaSopenharmony_ci
246275793eaSopenharmony_cicompress.lo: $(SRCDIR)compress.c
247275793eaSopenharmony_ci	-@mkdir objs 2>/dev/null || test -d objs
248275793eaSopenharmony_ci	$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/compress.o $(SRCDIR)compress.c
249275793eaSopenharmony_ci	-@mv objs/compress.o $@
250275793eaSopenharmony_ci
251275793eaSopenharmony_ciuncompr.lo: $(SRCDIR)uncompr.c
252275793eaSopenharmony_ci	-@mkdir objs 2>/dev/null || test -d objs
253275793eaSopenharmony_ci	$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/uncompr.o $(SRCDIR)uncompr.c
254275793eaSopenharmony_ci	-@mv objs/uncompr.o $@
255275793eaSopenharmony_ci
256275793eaSopenharmony_cigzclose.lo: $(SRCDIR)gzclose.c
257275793eaSopenharmony_ci	-@mkdir objs 2>/dev/null || test -d objs
258275793eaSopenharmony_ci	$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/gzclose.o $(SRCDIR)gzclose.c
259275793eaSopenharmony_ci	-@mv objs/gzclose.o $@
260275793eaSopenharmony_ci
261275793eaSopenharmony_cigzlib.lo: $(SRCDIR)gzlib.c
262275793eaSopenharmony_ci	-@mkdir objs 2>/dev/null || test -d objs
263275793eaSopenharmony_ci	$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/gzlib.o $(SRCDIR)gzlib.c
264275793eaSopenharmony_ci	-@mv objs/gzlib.o $@
265275793eaSopenharmony_ci
266275793eaSopenharmony_cigzread.lo: $(SRCDIR)gzread.c
267275793eaSopenharmony_ci	-@mkdir objs 2>/dev/null || test -d objs
268275793eaSopenharmony_ci	$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/gzread.o $(SRCDIR)gzread.c
269275793eaSopenharmony_ci	-@mv objs/gzread.o $@
270275793eaSopenharmony_ci
271275793eaSopenharmony_cigzwrite.lo: $(SRCDIR)gzwrite.c
272275793eaSopenharmony_ci	-@mkdir objs 2>/dev/null || test -d objs
273275793eaSopenharmony_ci	$(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/gzwrite.o $(SRCDIR)gzwrite.c
274275793eaSopenharmony_ci	-@mv objs/gzwrite.o $@
275275793eaSopenharmony_ci
276275793eaSopenharmony_ci
277275793eaSopenharmony_ciplacebo $(SHAREDLIBV): $(PIC_OBJS) libz.a
278275793eaSopenharmony_ci	$(LDSHARED) $(SFLAGS) -o $@ $(PIC_OBJS) $(LDSHAREDLIBC) $(LDFLAGS)
279275793eaSopenharmony_ci	rm -f $(SHAREDLIB) $(SHAREDLIBM)
280275793eaSopenharmony_ci	ln -s $@ $(SHAREDLIB)
281275793eaSopenharmony_ci	ln -s $@ $(SHAREDLIBM)
282275793eaSopenharmony_ci	-@rmdir objs
283275793eaSopenharmony_ci
284275793eaSopenharmony_ciexample$(EXE): example.o $(STATICLIB)
285275793eaSopenharmony_ci	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ example.o $(TEST_LIBS)
286275793eaSopenharmony_ci
287275793eaSopenharmony_ciminigzip$(EXE): minigzip.o $(STATICLIB)
288275793eaSopenharmony_ci	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ minigzip.o $(TEST_LIBS)
289275793eaSopenharmony_ci
290275793eaSopenharmony_ciexamplesh$(EXE): example.o $(SHAREDLIBV)
291275793eaSopenharmony_ci	$(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS) -L. $(SHAREDLIBV)
292275793eaSopenharmony_ci
293275793eaSopenharmony_ciminigzipsh$(EXE): minigzip.o $(SHAREDLIBV)
294275793eaSopenharmony_ci	$(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS) -L. $(SHAREDLIBV)
295275793eaSopenharmony_ci
296275793eaSopenharmony_ciexample64$(EXE): example64.o $(STATICLIB)
297275793eaSopenharmony_ci	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ example64.o $(TEST_LIBS)
298275793eaSopenharmony_ci
299275793eaSopenharmony_ciminigzip64$(EXE): minigzip64.o $(STATICLIB)
300275793eaSopenharmony_ci	$(CC) $(CFLAGS) $(LDFLAGS) -o $@ minigzip64.o $(TEST_LIBS)
301275793eaSopenharmony_ci
302275793eaSopenharmony_ciinstall-libs: $(LIBS)
303275793eaSopenharmony_ci	-@if [ ! -d $(DESTDIR)$(exec_prefix)  ]; then mkdir -p $(DESTDIR)$(exec_prefix); fi
304275793eaSopenharmony_ci	-@if [ ! -d $(DESTDIR)$(libdir)       ]; then mkdir -p $(DESTDIR)$(libdir); fi
305275793eaSopenharmony_ci	-@if [ ! -d $(DESTDIR)$(sharedlibdir) ]; then mkdir -p $(DESTDIR)$(sharedlibdir); fi
306275793eaSopenharmony_ci	-@if [ ! -d $(DESTDIR)$(man3dir)      ]; then mkdir -p $(DESTDIR)$(man3dir); fi
307275793eaSopenharmony_ci	-@if [ ! -d $(DESTDIR)$(pkgconfigdir) ]; then mkdir -p $(DESTDIR)$(pkgconfigdir); fi
308275793eaSopenharmony_ci	rm -f $(DESTDIR)$(libdir)/$(STATICLIB)
309275793eaSopenharmony_ci	cp $(STATICLIB) $(DESTDIR)$(libdir)
310275793eaSopenharmony_ci	chmod 644 $(DESTDIR)$(libdir)/$(STATICLIB)
311275793eaSopenharmony_ci	-@($(RANLIB) $(DESTDIR)$(libdir)/libz.a || true) >/dev/null 2>&1
312275793eaSopenharmony_ci	-@if test -n "$(SHAREDLIBV)"; then \
313275793eaSopenharmony_ci	  rm -f $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBV); \
314275793eaSopenharmony_ci	  cp $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir); \
315275793eaSopenharmony_ci	  echo "cp $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)"; \
316275793eaSopenharmony_ci	  chmod 755 $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBV); \
317275793eaSopenharmony_ci	  echo "chmod 755 $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBV)"; \
318275793eaSopenharmony_ci	  rm -f $(DESTDIR)$(sharedlibdir)/$(SHAREDLIB) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBM); \
319275793eaSopenharmony_ci	  ln -s $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIB); \
320275793eaSopenharmony_ci	  ln -s $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBM); \
321275793eaSopenharmony_ci	  ($(LDCONFIG) || true)  >/dev/null 2>&1; \
322275793eaSopenharmony_ci	fi
323275793eaSopenharmony_ci	rm -f $(DESTDIR)$(man3dir)/zlib.3
324275793eaSopenharmony_ci	cp $(SRCDIR)zlib.3 $(DESTDIR)$(man3dir)
325275793eaSopenharmony_ci	chmod 644 $(DESTDIR)$(man3dir)/zlib.3
326275793eaSopenharmony_ci	rm -f $(DESTDIR)$(pkgconfigdir)/zlib.pc
327275793eaSopenharmony_ci	cp zlib.pc $(DESTDIR)$(pkgconfigdir)
328275793eaSopenharmony_ci	chmod 644 $(DESTDIR)$(pkgconfigdir)/zlib.pc
329275793eaSopenharmony_ci# The ranlib in install is needed on NeXTSTEP which checks file times
330275793eaSopenharmony_ci# ldconfig is for Linux
331275793eaSopenharmony_ci
332275793eaSopenharmony_ciinstall: install-libs
333275793eaSopenharmony_ci	-@if [ ! -d $(DESTDIR)$(includedir)   ]; then mkdir -p $(DESTDIR)$(includedir); fi
334275793eaSopenharmony_ci	rm -f $(DESTDIR)$(includedir)/zlib.h $(DESTDIR)$(includedir)/zconf.h
335275793eaSopenharmony_ci	cp $(SRCDIR)zlib.h zconf.h $(DESTDIR)$(includedir)
336275793eaSopenharmony_ci	chmod 644 $(DESTDIR)$(includedir)/zlib.h $(DESTDIR)$(includedir)/zconf.h
337275793eaSopenharmony_ci
338275793eaSopenharmony_ciuninstall:
339275793eaSopenharmony_ci	cd $(DESTDIR)$(includedir) && rm -f zlib.h zconf.h
340275793eaSopenharmony_ci	cd $(DESTDIR)$(libdir) && rm -f libz.a; \
341275793eaSopenharmony_ci	if test -n "$(SHAREDLIBV)" -a -f $(SHAREDLIBV); then \
342275793eaSopenharmony_ci	  rm -f $(SHAREDLIBV) $(SHAREDLIB) $(SHAREDLIBM); \
343275793eaSopenharmony_ci	fi
344275793eaSopenharmony_ci	cd $(DESTDIR)$(man3dir) && rm -f zlib.3
345275793eaSopenharmony_ci	cd $(DESTDIR)$(pkgconfigdir) && rm -f zlib.pc
346275793eaSopenharmony_ci
347275793eaSopenharmony_cidocs: zlib.3.pdf
348275793eaSopenharmony_ci
349275793eaSopenharmony_cizlib.3.pdf: $(SRCDIR)zlib.3
350275793eaSopenharmony_ci	groff -mandoc -f H -T ps $(SRCDIR)zlib.3 | ps2pdf - $@
351275793eaSopenharmony_ci
352275793eaSopenharmony_cizconf.h.cmakein: $(SRCDIR)zconf.h.in
353275793eaSopenharmony_ci	-@ TEMPFILE=zconfh_$$; \
354275793eaSopenharmony_ci	echo "/#define ZCONF_H/ a\\\\\n#cmakedefine Z_PREFIX\\\\\n#cmakedefine Z_HAVE_UNISTD_H\n" >> $$TEMPFILE &&\
355275793eaSopenharmony_ci	sed -f $$TEMPFILE $(SRCDIR)zconf.h.in > $@ &&\
356275793eaSopenharmony_ci	touch -r $(SRCDIR)zconf.h.in $@ &&\
357275793eaSopenharmony_ci	rm $$TEMPFILE
358275793eaSopenharmony_ci
359275793eaSopenharmony_cizconf: $(SRCDIR)zconf.h.in
360275793eaSopenharmony_ci	cp -p $(SRCDIR)zconf.h.in zconf.h
361275793eaSopenharmony_ci
362275793eaSopenharmony_ciminizip-test: static
363275793eaSopenharmony_ci	cd contrib/minizip && { CC="$(CC)" CFLAGS="$(CFLAGS)" $(MAKE) test ; cd ../.. ; }
364275793eaSopenharmony_ci
365275793eaSopenharmony_ciminizip-clean:
366275793eaSopenharmony_ci	cd contrib/minizip && { $(MAKE) clean ; cd ../.. ; }
367275793eaSopenharmony_ci
368275793eaSopenharmony_cimostlyclean: clean
369275793eaSopenharmony_ciclean: minizip-clean
370275793eaSopenharmony_ci	rm -f *.o *.lo *~ \
371275793eaSopenharmony_ci	   example$(EXE) minigzip$(EXE) examplesh$(EXE) minigzipsh$(EXE) \
372275793eaSopenharmony_ci	   example64$(EXE) minigzip64$(EXE) \
373275793eaSopenharmony_ci	   infcover \
374275793eaSopenharmony_ci	   libz.* foo.gz so_locations \
375275793eaSopenharmony_ci	   _match.s maketree contrib/infback9/*.o
376275793eaSopenharmony_ci	rm -rf objs
377275793eaSopenharmony_ci	rm -f *.gcda *.gcno *.gcov
378275793eaSopenharmony_ci	rm -f contrib/infback9/*.gcda contrib/infback9/*.gcno contrib/infback9/*.gcov
379275793eaSopenharmony_ci
380275793eaSopenharmony_cimaintainer-clean: distclean
381275793eaSopenharmony_cidistclean: clean zconf zconf.h.cmakein
382275793eaSopenharmony_ci	rm -f Makefile zlib.pc configure.log
383275793eaSopenharmony_ci	-@rm -f .DS_Store
384275793eaSopenharmony_ci	@if [ -f Makefile.in ]; then \
385275793eaSopenharmony_ci	printf 'all:\n\t-@echo "Please use ./configure first.  Thank you."\n' > Makefile ; \
386275793eaSopenharmony_ci	printf '\ndistclean:\n\tmake -f Makefile.in distclean\n' >> Makefile ; \
387275793eaSopenharmony_ci	touch -r $(SRCDIR)Makefile.in Makefile ; fi
388275793eaSopenharmony_ci
389275793eaSopenharmony_citags:
390275793eaSopenharmony_ci	etags $(SRCDIR)*.[ch]
391275793eaSopenharmony_ci
392275793eaSopenharmony_ciadler32.o zutil.o: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h
393275793eaSopenharmony_cigzclose.o gzlib.o gzread.o gzwrite.o: $(SRCDIR)zlib.h zconf.h $(SRCDIR)gzguts.h
394275793eaSopenharmony_cicompress.o example.o minigzip.o uncompr.o: $(SRCDIR)zlib.h zconf.h
395275793eaSopenharmony_cicrc32.o: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)crc32.h
396275793eaSopenharmony_cideflate.o: $(SRCDIR)deflate.h $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h
397275793eaSopenharmony_ciinfback.o inflate.o: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)inftrees.h $(SRCDIR)inflate.h $(SRCDIR)inffast.h $(SRCDIR)inffixed.h
398275793eaSopenharmony_ciinffast.o: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)inftrees.h $(SRCDIR)inflate.h $(SRCDIR)inffast.h
399275793eaSopenharmony_ciinftrees.o: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)inftrees.h
400275793eaSopenharmony_citrees.o: $(SRCDIR)deflate.h $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)trees.h
401275793eaSopenharmony_ci
402275793eaSopenharmony_ciadler32.lo zutil.lo: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h
403275793eaSopenharmony_cigzclose.lo gzlib.lo gzread.lo gzwrite.lo: $(SRCDIR)zlib.h zconf.h $(SRCDIR)gzguts.h
404275793eaSopenharmony_cicompress.lo example.lo minigzip.lo uncompr.lo: $(SRCDIR)zlib.h zconf.h
405275793eaSopenharmony_cicrc32.lo: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)crc32.h
406275793eaSopenharmony_cideflate.lo: $(SRCDIR)deflate.h $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h
407275793eaSopenharmony_ciinfback.lo inflate.lo: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)inftrees.h $(SRCDIR)inflate.h $(SRCDIR)inffast.h $(SRCDIR)inffixed.h
408275793eaSopenharmony_ciinffast.lo: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)inftrees.h $(SRCDIR)inflate.h $(SRCDIR)inffast.h
409275793eaSopenharmony_ciinftrees.lo: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)inftrees.h
410275793eaSopenharmony_citrees.lo: $(SRCDIR)deflate.h $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)trees.h
411