VirtualBox

source: vbox/trunk/src/libs/zlib-1.2.13/Makefile.in@ 107044

Last change on this file since 107044 was 97832, checked in by vboxsync, 2 years ago

zlib-1.2.13: adding svn:sync-process property to all zlib files (except LICESNSE and zlib.3.pdf). bugref:10335

  • Property svn:eol-style set to native
File size: 13.3 KB
Line 
1# Makefile for zlib
2# Copyright (C) 1995-2017 Jean-loup Gailly, Mark Adler
3# For conditions of distribution and use, see copyright notice in zlib.h
4
5# To compile and test, type:
6# ./configure; make test
7# Normally configure builds both a static and a shared library.
8# If you want to build just a static library, use: ./configure --static
9
10# To install /usr/local/lib/libz.* and /usr/local/include/zlib.h, type:
11# make install
12# To install in $HOME instead of /usr/local, use:
13# make install prefix=$HOME
14
15CC=cc
16
17CFLAGS=-O
18#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
19#CFLAGS=-g -DZLIB_DEBUG
20#CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
21# -Wstrict-prototypes -Wmissing-prototypes
22
23SFLAGS=-O
24LDFLAGS=
25TEST_LDFLAGS=$(LDFLAGS) -L. libz.a
26LDSHARED=$(CC)
27CPP=$(CC) -E
28
29STATICLIB=libz.a
30SHAREDLIB=libz.so
31SHAREDLIBV=libz.so.1.2.13
32SHAREDLIBM=libz.so.1
33LIBS=$(STATICLIB) $(SHAREDLIBV)
34
35AR=ar
36ARFLAGS=rc
37RANLIB=ranlib
38LDCONFIG=ldconfig
39LDSHAREDLIBC=-lc
40TAR=tar
41SHELL=/bin/sh
42EXE=
43
44prefix = /usr/local
45exec_prefix = ${prefix}
46libdir = ${exec_prefix}/lib
47sharedlibdir = ${libdir}
48includedir = ${prefix}/include
49mandir = ${prefix}/share/man
50man3dir = ${mandir}/man3
51pkgconfigdir = ${libdir}/pkgconfig
52SRCDIR=
53ZINC=
54ZINCOUT=-I.
55
56OBJZ = adler32.o crc32.o deflate.o infback.o inffast.o inflate.o inftrees.o trees.o zutil.o
57OBJG = compress.o uncompr.o gzclose.o gzlib.o gzread.o gzwrite.o
58OBJC = $(OBJZ) $(OBJG)
59
60PIC_OBJZ = adler32.lo crc32.lo deflate.lo infback.lo inffast.lo inflate.lo inftrees.lo trees.lo zutil.lo
61PIC_OBJG = compress.lo uncompr.lo gzclose.lo gzlib.lo gzread.lo gzwrite.lo
62PIC_OBJC = $(PIC_OBJZ) $(PIC_OBJG)
63
64# to use the asm code: make OBJA=match.o, PIC_OBJA=match.lo
65OBJA =
66PIC_OBJA =
67
68OBJS = $(OBJC) $(OBJA)
69
70PIC_OBJS = $(PIC_OBJC) $(PIC_OBJA)
71
72all: static shared
73
74static: example$(EXE) minigzip$(EXE)
75
76shared: examplesh$(EXE) minigzipsh$(EXE)
77
78all64: example64$(EXE) minigzip64$(EXE)
79
80check: test
81
82test: all teststatic testshared
83
84teststatic: static
85 @TMPST=tmpst_$$; \
86 if echo hello world | ${QEMU_RUN} ./minigzip | ${QEMU_RUN} ./minigzip -d && ${QEMU_RUN} ./example $$TMPST ; then \
87 echo ' *** zlib test OK ***'; \
88 else \
89 echo ' *** zlib test FAILED ***'; false; \
90 fi
91 @rm -f tmpst_$$
92
93testshared: shared
94 @LD_LIBRARY_PATH=`pwd`:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \
95 LD_LIBRARYN32_PATH=`pwd`:$(LD_LIBRARYN32_PATH) ; export LD_LIBRARYN32_PATH; \
96 DYLD_LIBRARY_PATH=`pwd`:$(DYLD_LIBRARY_PATH) ; export DYLD_LIBRARY_PATH; \
97 SHLIB_PATH=`pwd`:$(SHLIB_PATH) ; export SHLIB_PATH; \
98 TMPSH=tmpsh_$$; \
99 if echo hello world | ${QEMU_RUN} ./minigzipsh | ${QEMU_RUN} ./minigzipsh -d && ${QEMU_RUN} ./examplesh $$TMPSH; then \
100 echo ' *** zlib shared test OK ***'; \
101 else \
102 echo ' *** zlib shared test FAILED ***'; false; \
103 fi
104 @rm -f tmpsh_$$
105
106test64: all64
107 @TMP64=tmp64_$$; \
108 if echo hello world | ${QEMU_RUN} ./minigzip64 | ${QEMU_RUN} ./minigzip64 -d && ${QEMU_RUN} ./example64 $$TMP64; then \
109 echo ' *** zlib 64-bit test OK ***'; \
110 else \
111 echo ' *** zlib 64-bit test FAILED ***'; false; \
112 fi
113 @rm -f tmp64_$$
114
115infcover.o: $(SRCDIR)test/infcover.c $(SRCDIR)zlib.h zconf.h
116 $(CC) $(CFLAGS) $(ZINCOUT) -c -o $@ $(SRCDIR)test/infcover.c
117
118infcover: infcover.o libz.a
119 $(CC) $(CFLAGS) -o $@ infcover.o libz.a
120
121cover: infcover
122 rm -f *.gcda
123 ${QEMU_RUN} ./infcover
124 gcov inf*.c
125
126libz.a: $(OBJS)
127 $(AR) $(ARFLAGS) $@ $(OBJS)
128 -@ ($(RANLIB) $@ || true) >/dev/null 2>&1
129
130match.o: match.S
131 $(CPP) match.S > _match.s
132 $(CC) -c _match.s
133 mv _match.o match.o
134 rm -f _match.s
135
136match.lo: match.S
137 $(CPP) match.S > _match.s
138 $(CC) -c -fPIC _match.s
139 mv _match.o match.lo
140 rm -f _match.s
141
142example.o: $(SRCDIR)test/example.c $(SRCDIR)zlib.h zconf.h
143 $(CC) $(CFLAGS) $(ZINCOUT) -c -o $@ $(SRCDIR)test/example.c
144
145minigzip.o: $(SRCDIR)test/minigzip.c $(SRCDIR)zlib.h zconf.h
146 $(CC) $(CFLAGS) $(ZINCOUT) -c -o $@ $(SRCDIR)test/minigzip.c
147
148example64.o: $(SRCDIR)test/example.c $(SRCDIR)zlib.h zconf.h
149 $(CC) $(CFLAGS) $(ZINCOUT) -D_FILE_OFFSET_BITS=64 -c -o $@ $(SRCDIR)test/example.c
150
151minigzip64.o: $(SRCDIR)test/minigzip.c $(SRCDIR)zlib.h zconf.h
152 $(CC) $(CFLAGS) $(ZINCOUT) -D_FILE_OFFSET_BITS=64 -c -o $@ $(SRCDIR)test/minigzip.c
153
154
155adler32.o: $(SRCDIR)adler32.c
156 $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)adler32.c
157
158crc32.o: $(SRCDIR)crc32.c
159 $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)crc32.c
160
161deflate.o: $(SRCDIR)deflate.c
162 $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)deflate.c
163
164infback.o: $(SRCDIR)infback.c
165 $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)infback.c
166
167inffast.o: $(SRCDIR)inffast.c
168 $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)inffast.c
169
170inflate.o: $(SRCDIR)inflate.c
171 $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)inflate.c
172
173inftrees.o: $(SRCDIR)inftrees.c
174 $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)inftrees.c
175
176trees.o: $(SRCDIR)trees.c
177 $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)trees.c
178
179zutil.o: $(SRCDIR)zutil.c
180 $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)zutil.c
181
182compress.o: $(SRCDIR)compress.c
183 $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)compress.c
184
185uncompr.o: $(SRCDIR)uncompr.c
186 $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)uncompr.c
187
188gzclose.o: $(SRCDIR)gzclose.c
189 $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)gzclose.c
190
191gzlib.o: $(SRCDIR)gzlib.c
192 $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)gzlib.c
193
194gzread.o: $(SRCDIR)gzread.c
195 $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)gzread.c
196
197gzwrite.o: $(SRCDIR)gzwrite.c
198 $(CC) $(CFLAGS) $(ZINC) -c -o $@ $(SRCDIR)gzwrite.c
199
200
201adler32.lo: $(SRCDIR)adler32.c
202 -@mkdir objs 2>/dev/null || test -d objs
203 $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/adler32.o $(SRCDIR)adler32.c
204 -@mv objs/adler32.o $@
205
206crc32.lo: $(SRCDIR)crc32.c
207 -@mkdir objs 2>/dev/null || test -d objs
208 $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/crc32.o $(SRCDIR)crc32.c
209 -@mv objs/crc32.o $@
210
211deflate.lo: $(SRCDIR)deflate.c
212 -@mkdir objs 2>/dev/null || test -d objs
213 $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/deflate.o $(SRCDIR)deflate.c
214 -@mv objs/deflate.o $@
215
216infback.lo: $(SRCDIR)infback.c
217 -@mkdir objs 2>/dev/null || test -d objs
218 $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/infback.o $(SRCDIR)infback.c
219 -@mv objs/infback.o $@
220
221inffast.lo: $(SRCDIR)inffast.c
222 -@mkdir objs 2>/dev/null || test -d objs
223 $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/inffast.o $(SRCDIR)inffast.c
224 -@mv objs/inffast.o $@
225
226inflate.lo: $(SRCDIR)inflate.c
227 -@mkdir objs 2>/dev/null || test -d objs
228 $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/inflate.o $(SRCDIR)inflate.c
229 -@mv objs/inflate.o $@
230
231inftrees.lo: $(SRCDIR)inftrees.c
232 -@mkdir objs 2>/dev/null || test -d objs
233 $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/inftrees.o $(SRCDIR)inftrees.c
234 -@mv objs/inftrees.o $@
235
236trees.lo: $(SRCDIR)trees.c
237 -@mkdir objs 2>/dev/null || test -d objs
238 $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/trees.o $(SRCDIR)trees.c
239 -@mv objs/trees.o $@
240
241zutil.lo: $(SRCDIR)zutil.c
242 -@mkdir objs 2>/dev/null || test -d objs
243 $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/zutil.o $(SRCDIR)zutil.c
244 -@mv objs/zutil.o $@
245
246compress.lo: $(SRCDIR)compress.c
247 -@mkdir objs 2>/dev/null || test -d objs
248 $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/compress.o $(SRCDIR)compress.c
249 -@mv objs/compress.o $@
250
251uncompr.lo: $(SRCDIR)uncompr.c
252 -@mkdir objs 2>/dev/null || test -d objs
253 $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/uncompr.o $(SRCDIR)uncompr.c
254 -@mv objs/uncompr.o $@
255
256gzclose.lo: $(SRCDIR)gzclose.c
257 -@mkdir objs 2>/dev/null || test -d objs
258 $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/gzclose.o $(SRCDIR)gzclose.c
259 -@mv objs/gzclose.o $@
260
261gzlib.lo: $(SRCDIR)gzlib.c
262 -@mkdir objs 2>/dev/null || test -d objs
263 $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/gzlib.o $(SRCDIR)gzlib.c
264 -@mv objs/gzlib.o $@
265
266gzread.lo: $(SRCDIR)gzread.c
267 -@mkdir objs 2>/dev/null || test -d objs
268 $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/gzread.o $(SRCDIR)gzread.c
269 -@mv objs/gzread.o $@
270
271gzwrite.lo: $(SRCDIR)gzwrite.c
272 -@mkdir objs 2>/dev/null || test -d objs
273 $(CC) $(SFLAGS) $(ZINC) -DPIC -c -o objs/gzwrite.o $(SRCDIR)gzwrite.c
274 -@mv objs/gzwrite.o $@
275
276
277placebo $(SHAREDLIBV): $(PIC_OBJS) libz.a
278 $(LDSHARED) $(SFLAGS) -o $@ $(PIC_OBJS) $(LDSHAREDLIBC) $(LDFLAGS)
279 rm -f $(SHAREDLIB) $(SHAREDLIBM)
280 ln -s $@ $(SHAREDLIB)
281 ln -s $@ $(SHAREDLIBM)
282 -@rmdir objs
283
284example$(EXE): example.o $(STATICLIB)
285 $(CC) $(CFLAGS) -o $@ example.o $(TEST_LDFLAGS)
286
287minigzip$(EXE): minigzip.o $(STATICLIB)
288 $(CC) $(CFLAGS) -o $@ minigzip.o $(TEST_LDFLAGS)
289
290examplesh$(EXE): example.o $(SHAREDLIBV)
291 $(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS) -L. $(SHAREDLIBV)
292
293minigzipsh$(EXE): minigzip.o $(SHAREDLIBV)
294 $(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS) -L. $(SHAREDLIBV)
295
296example64$(EXE): example64.o $(STATICLIB)
297 $(CC) $(CFLAGS) -o $@ example64.o $(TEST_LDFLAGS)
298
299minigzip64$(EXE): minigzip64.o $(STATICLIB)
300 $(CC) $(CFLAGS) -o $@ minigzip64.o $(TEST_LDFLAGS)
301
302install-libs: $(LIBS)
303 -@if [ ! -d $(DESTDIR)$(exec_prefix) ]; then mkdir -p $(DESTDIR)$(exec_prefix); fi
304 -@if [ ! -d $(DESTDIR)$(libdir) ]; then mkdir -p $(DESTDIR)$(libdir); fi
305 -@if [ ! -d $(DESTDIR)$(sharedlibdir) ]; then mkdir -p $(DESTDIR)$(sharedlibdir); fi
306 -@if [ ! -d $(DESTDIR)$(man3dir) ]; then mkdir -p $(DESTDIR)$(man3dir); fi
307 -@if [ ! -d $(DESTDIR)$(pkgconfigdir) ]; then mkdir -p $(DESTDIR)$(pkgconfigdir); fi
308 rm -f $(DESTDIR)$(libdir)/$(STATICLIB)
309 cp $(STATICLIB) $(DESTDIR)$(libdir)
310 chmod 644 $(DESTDIR)$(libdir)/$(STATICLIB)
311 -@($(RANLIB) $(DESTDIR)$(libdir)/libz.a || true) >/dev/null 2>&1
312 -@if test -n "$(SHAREDLIBV)"; then \
313 rm -f $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBV); \
314 cp $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir); \
315 echo "cp $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)"; \
316 chmod 755 $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBV); \
317 echo "chmod 755 $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBV)"; \
318 rm -f $(DESTDIR)$(sharedlibdir)/$(SHAREDLIB) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBM); \
319 ln -s $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIB); \
320 ln -s $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBM); \
321 ($(LDCONFIG) || true) >/dev/null 2>&1; \
322 fi
323 rm -f $(DESTDIR)$(man3dir)/zlib.3
324 cp $(SRCDIR)zlib.3 $(DESTDIR)$(man3dir)
325 chmod 644 $(DESTDIR)$(man3dir)/zlib.3
326 rm -f $(DESTDIR)$(pkgconfigdir)/zlib.pc
327 cp zlib.pc $(DESTDIR)$(pkgconfigdir)
328 chmod 644 $(DESTDIR)$(pkgconfigdir)/zlib.pc
329# The ranlib in install is needed on NeXTSTEP which checks file times
330# ldconfig is for Linux
331
332install: install-libs
333 -@if [ ! -d $(DESTDIR)$(includedir) ]; then mkdir -p $(DESTDIR)$(includedir); fi
334 rm -f $(DESTDIR)$(includedir)/zlib.h $(DESTDIR)$(includedir)/zconf.h
335 cp $(SRCDIR)zlib.h zconf.h $(DESTDIR)$(includedir)
336 chmod 644 $(DESTDIR)$(includedir)/zlib.h $(DESTDIR)$(includedir)/zconf.h
337
338uninstall:
339 cd $(DESTDIR)$(includedir) && rm -f zlib.h zconf.h
340 cd $(DESTDIR)$(libdir) && rm -f libz.a; \
341 if test -n "$(SHAREDLIBV)" -a -f $(SHAREDLIBV); then \
342 rm -f $(SHAREDLIBV) $(SHAREDLIB) $(SHAREDLIBM); \
343 fi
344 cd $(DESTDIR)$(man3dir) && rm -f zlib.3
345 cd $(DESTDIR)$(pkgconfigdir) && rm -f zlib.pc
346
347docs: zlib.3.pdf
348
349zlib.3.pdf: $(SRCDIR)zlib.3
350 groff -mandoc -f H -T ps $(SRCDIR)zlib.3 | ps2pdf - $@
351
352zconf.h.cmakein: $(SRCDIR)zconf.h.in
353 -@ TEMPFILE=zconfh_$$; \
354 echo "/#define ZCONF_H/ a\\\\\n#cmakedefine Z_PREFIX\\\\\n#cmakedefine Z_HAVE_UNISTD_H\n" >> $$TEMPFILE &&\
355 sed -f $$TEMPFILE $(SRCDIR)zconf.h.in > $@ &&\
356 touch -r $(SRCDIR)zconf.h.in $@ &&\
357 rm $$TEMPFILE
358
359zconf: $(SRCDIR)zconf.h.in
360 cp -p $(SRCDIR)zconf.h.in zconf.h
361
362mostlyclean: clean
363clean:
364 rm -f *.o *.lo *~ \
365 example$(EXE) minigzip$(EXE) examplesh$(EXE) minigzipsh$(EXE) \
366 example64$(EXE) minigzip64$(EXE) \
367 infcover \
368 libz.* foo.gz so_locations \
369 _match.s maketree contrib/infback9/*.o
370 rm -rf objs
371 rm -f *.gcda *.gcno *.gcov
372 rm -f contrib/infback9/*.gcda contrib/infback9/*.gcno contrib/infback9/*.gcov
373
374maintainer-clean: distclean
375distclean: clean zconf zconf.h.cmakein
376 rm -f Makefile zlib.pc configure.log
377 -@rm -f .DS_Store
378 @if [ -f Makefile.in ]; then \
379 printf 'all:\n\t-@echo "Please use ./configure first. Thank you."\n' > Makefile ; \
380 printf '\ndistclean:\n\tmake -f Makefile.in distclean\n' >> Makefile ; \
381 touch -r $(SRCDIR)Makefile.in Makefile ; fi
382
383tags:
384 etags $(SRCDIR)*.[ch]
385
386adler32.o zutil.o: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h
387gzclose.o gzlib.o gzread.o gzwrite.o: $(SRCDIR)zlib.h zconf.h $(SRCDIR)gzguts.h
388compress.o example.o minigzip.o uncompr.o: $(SRCDIR)zlib.h zconf.h
389crc32.o: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)crc32.h
390deflate.o: $(SRCDIR)deflate.h $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h
391infback.o inflate.o: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)inftrees.h $(SRCDIR)inflate.h $(SRCDIR)inffast.h $(SRCDIR)inffixed.h
392inffast.o: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)inftrees.h $(SRCDIR)inflate.h $(SRCDIR)inffast.h
393inftrees.o: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)inftrees.h
394trees.o: $(SRCDIR)deflate.h $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)trees.h
395
396adler32.lo zutil.lo: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h
397gzclose.lo gzlib.lo gzread.lo gzwrite.lo: $(SRCDIR)zlib.h zconf.h $(SRCDIR)gzguts.h
398compress.lo example.lo minigzip.lo uncompr.lo: $(SRCDIR)zlib.h zconf.h
399crc32.lo: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)crc32.h
400deflate.lo: $(SRCDIR)deflate.h $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h
401infback.lo inflate.lo: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)inftrees.h $(SRCDIR)inflate.h $(SRCDIR)inffast.h $(SRCDIR)inffixed.h
402inffast.lo: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)inftrees.h $(SRCDIR)inflate.h $(SRCDIR)inffast.h
403inftrees.lo: $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)inftrees.h
404trees.lo: $(SRCDIR)deflate.h $(SRCDIR)zutil.h $(SRCDIR)zlib.h zconf.h $(SRCDIR)trees.h
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette