10
|
1 # Makefile for zlib
|
|
2 # Copyright (C) 1995 Jean-loup Gailly.
|
|
3 # For conditions of distribution and use, see copyright notice in zlib.h
|
|
4
|
|
5 CC=cc
|
|
6 CFLAGS=-O
|
|
7 #use -O3 for gcc to take advantage of inlining
|
|
8 #CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
|
|
9 #CFLAGS=-g -DDEBUG
|
|
10 LDFLAGS=-L. -lz
|
|
11
|
|
12 RANLIB=ranlib
|
|
13
|
|
14 prefix=/usr/local
|
|
15
|
|
16 OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \
|
|
17 zutil.o inflate.o infblock.o inftrees.o infcodes.o infutil.o inffast.o
|
|
18
|
|
19 TEST_OBJS = example.o minigzip.o
|
|
20
|
|
21 all: example minigzip
|
|
22
|
|
23 test: all
|
|
24 ./example
|
|
25 echo hello world | ./minigzip | ./minigzip -d
|
|
26
|
|
27 install: libz.a
|
|
28 -@mkdir $(prefix)/include
|
|
29 -@mkdir $(prefix)/lib
|
|
30 cp zlib.h zconf.h $(prefix)/include
|
|
31 chmod 644 $(prefix)/include/zlib.h $(prefix)/include/zconf.h
|
|
32 cp libz.a $(prefix)/lib
|
|
33 chmod 644 $(prefix)/lib/libz.a
|
|
34
|
|
35 libz.a: $(OBJS)
|
|
36 ar rc $@ $(OBJS)
|
|
37 $(RANLIB) $@
|
|
38
|
|
39 example: example.o libz.a
|
|
40 $(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS)
|
|
41
|
|
42 minigzip: minigzip.o libz.a
|
|
43 $(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS)
|
|
44
|
|
45 clean:
|
|
46 rm -f *.o example minigzip libz.a foo.gz
|
|
47
|
|
48 zip:
|
|
49 zip -ul9 zlib README ChangeLog Makefile Make????.??? Makefile.?? \
|
|
50 descrip.mms *.[ch]
|
|
51
|
|
52 tgz:
|
|
53 cd ..; tar cfz zlib/zlib.tgz zlib/README zlib/ChangeLog zlib/Makefile \
|
|
54 zlib/Make????.??? zlib/Makefile.?? zlib/descrip.mms zlib/*.[ch]
|
|
55
|
|
56 # DO NOT DELETE THIS LINE -- make depend depends on it.
|
|
57
|
|
58 adler32.o: zutil.h zlib.h zconf.h
|
|
59 compress.o: zlib.h zconf.h
|
|
60 crc32.o: zutil.h zlib.h zconf.h
|
|
61 deflate.o: deflate.h zutil.h zlib.h zconf.h
|
|
62 example.o: zlib.h zconf.h
|
|
63 gzio.o: zutil.h zlib.h zconf.h
|
|
64 infblock.o: zutil.h zlib.h zconf.h infblock.h inftrees.h infcodes.h infutil.h
|
|
65 infcodes.o: zutil.h zlib.h zconf.h inftrees.h infutil.h infcodes.h inffast.h
|
|
66 inffast.o: zutil.h zlib.h zconf.h inftrees.h infutil.h inffast.h
|
|
67 inflate.o: zutil.h zlib.h zconf.h infblock.h
|
|
68 inftrees.o: zutil.h zlib.h zconf.h inftrees.h
|
|
69 infutil.o: zutil.h zlib.h zconf.h inftrees.h infutil.h
|
|
70 minigzip.o: zlib.h zconf.h
|
|
71 trees.o: deflate.h zutil.h zlib.h zconf.h
|
|
72 uncompr.o: zlib.h zconf.h
|
|
73 zutil.o: zutil.h zlib.h zconf.h
|