summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile121
1 files changed, 35 insertions, 86 deletions
diff --git a/Makefile b/Makefile
index fe5b372..45c96e4 100644
--- a/Makefile
+++ b/Makefile
@@ -2,129 +2,78 @@
2# Copyright (C) 1995-1996 Jean-loup Gailly. 2# Copyright (C) 1995-1996 Jean-loup Gailly.
3# For conditions of distribution and use, see copyright notice in zlib.h 3# For conditions of distribution and use, see copyright notice in zlib.h
4 4
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
9# To install /usr/local/lib/libz.* and /usr/local/include/zlib.h, type:
10# make install
11# To install in $HOME instead of /usr/local, use:
12# make install prefix=$HOME
13
14CC=cc 5CC=cc
15
16CFLAGS=-O 6CFLAGS=-O
17#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7 7#use -O3 for gcc
8#CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
18#CFLAGS=-g -DDEBUG 9#CFLAGS=-g -DDEBUG
19#CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
20# -Wstrict-prototypes -Wmissing-prototypes
21
22LDFLAGS=-L. -lz 10LDFLAGS=-L. -lz
23LDSHARED=$(CC)
24 11
25VER=1.0
26LIBS=libz.a
27
28AR=ar rc
29RANLIB=ranlib 12RANLIB=ranlib
30TAR=tar
31 13
32prefix=/usr/local 14prefix=/usr/local
33exec_prefix = $(prefix) 15exec_prefix = ${prefix}
34 16
35OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \ 17OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \
36 zutil.o inflate.o infblock.o inftrees.o infcodes.o infutil.o inffast.o 18 zutil.o inflate.o infblock.o inftrees.o infcodes.o infutil.o inffast.o
37 19
38TEST_OBJS = example.o minigzip.o 20TEST_OBJS = example.o minigzip.o
39 21
40DISTFILES = README ChangeLog configure Makefile.in Makefile Makefile.msc \
41 Makefile.bor Makefile.tc Make_vms.com descrip.mms *.[ch]
42
43all: example minigzip 22all: example minigzip
44 23
45test: all 24test: all
46 ./example 25 ./example
47 echo hello world | ./minigzip | ./minigzip -d 26 echo hello world | ./minigzip | ./minigzip -d
48 27
49libz.a: $(OBJS) 28install: libz.a
50 $(AR) $@ $(OBJS) 29 -@mkdir $(prefix)/include
51 -@ ($(RANLIB) $@ || true) 2>/dev/null 30 -@mkdir $(exec_prefix)/lib
31 cp zlib.h zconf.h $(prefix)/include
32 chmod 644 $(prefix)/include/zlib.h $(prefix)/include/zconf.h
33 cp libz.a $(exec_prefix)/lib
34 chmod 644 $(exec_prefix)/lib/libz.a
35 -@$(RANLIB) $(prefix)/lib/libz.a
36# This second ranlib is needed on NeXTSTEP which checks file times
52 37
53libz.so.$(VER): $(OBJS) 38libz.a: $(OBJS)
54 $(LDSHARED) -o $@ $(OBJS) 39 ar rc $@ $(OBJS)
55 rm -f libz.so; ln -s $@ libz.so 40 -@$(RANLIB) $@
56 41
57example: example.o $(LIBS) 42example: example.o libz.a
58 $(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS) 43 $(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS)
59 44
60minigzip: minigzip.o $(LIBS) 45minigzip: minigzip.o libz.a
61 $(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS) 46 $(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS)
62 47
63install: $(LIBS)
64 -@if [ ! $(prefix)/include ]; then mkdir $(prefix)/include; fi
65 -@if [ ! $(exec_prefix)/lib ]; then mkdir $(exec_prefix)/lib; fi
66 cp zlib.h zconf.h $(prefix)/include
67 chmod 644 $(prefix)/include/zlib.h $(prefix)/include/zconf.h
68 cp $(LIBS) $(exec_prefix)/lib
69 cd $(exec_prefix)/lib; chmod 644 $(LIBS)
70 -@(cd $(exec_prefix)/lib; $(RANLIB) libz.a || true) >/dev/null 2>&1
71 cd $(exec_prefix)/lib; if test -f libz.so.$(VER); then \
72 ln -s libz.so.$(VER) libz.so; \
73 fi
74# The ranlib in install is needed on NeXTSTEP which checks file times
75
76uninstall:
77 cd $(exec_prefix)/lib; rm -f $(LIBS); \
78 if test -f libz.so; then \
79 v=`sed -n '/VERSION "/s/.*"\(.*\)".*/\1/p'<$(prefix)/include/zlib.h`;\
80 rm -f libz.so.$$v libz.so; \
81 fi
82 cd $(prefix)/include; rm -f zlib.h zconf.h
83
84clean: 48clean:
85 rm -f *.o *~ example minigzip libz.a libz.so* foo.gz 49 rm -f *.o example minigzip libz.a foo.gz
86 50
87zip: 51zip:
88 mv Makefile Makefile~; cp -p Makefile.in Makefile 52 zip -ul9 zlib README ChangeLog Makefile Make????.??? Makefile.?? \
89 v=`sed -n -e 's/\./-/' -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\ 53 descrip.mms *.[ch]
90 zip -ul9 zlib-$$v $(DISTFILES)
91 mv Makefile~ Makefile
92
93dist:
94 mv Makefile Makefile~; cp -p Makefile.in Makefile
95 d=zlib-`sed -n '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\
96 rm -f $$d.tar.gz; \
97 if test ! -d ../$$d; then rm -f ../$$d; ln -s `pwd` ../$$d; fi; \
98 files=""; \
99 for f in $(DISTFILES); do files="$$files $$d/$$f"; done; \
100 cd ..; \
101 GZIP=-9 $(TAR) chofz $$d/$$d.tar.gz $$files; \
102 if test ! -d $$d; then rm -f $$d; fi
103 mv Makefile~ Makefile
104
105tags:
106 etags *.[ch]
107 54
108depend: 55tgz:
109 makedepend -- $(CFLAGS) -- *.[ch] 56 cd ..; tar cfz zlib/zlib.tgz zlib/README zlib/ChangeLog zlib/Makefile \
57 zlib/Make????.??? zlib/Makefile.?? zlib/descrip.mms zlib/*.[ch]
58
59TAGS:
60 etags *.[ch]
110 61
111# DO NOT DELETE THIS LINE -- make depend depends on it. 62# DO NOT DELETE THIS LINE -- make depend depends on it.
112 63
113adler32.o: zlib.h zconf.h 64adler32.o: zutil.h zlib.h zconf.h
114compress.o: zlib.h zconf.h 65compress.o: zlib.h zconf.h
115crc32.o: zlib.h zconf.h 66crc32.o: zutil.h zlib.h zconf.h
116deflate.o: deflate.h zutil.h zlib.h zconf.h 67deflate.o: deflate.h zutil.h zlib.h zconf.h
117example.o: zlib.h zconf.h 68example.o: zlib.h zconf.h
118gzio.o: zutil.h zlib.h zconf.h 69gzio.o: zutil.h zlib.h zconf.h
119infblock.o: infblock.h inftrees.h infcodes.h infutil.h zutil.h zlib.h zconf.h 70infblock.o: zutil.h zlib.h zconf.h infblock.h inftrees.h infcodes.h infutil.h
120infcodes.o: zutil.h zlib.h zconf.h 71infcodes.o: zutil.h zlib.h zconf.h inftrees.h infutil.h infcodes.h inffast.h
121infcodes.o: inftrees.h infblock.h infcodes.h infutil.h inffast.h 72inffast.o: zutil.h zlib.h zconf.h inftrees.h infutil.h inffast.h
122inffast.o: zutil.h zlib.h zconf.h inftrees.h
123inffast.o: infblock.h infcodes.h infutil.h inffast.h
124inflate.o: zutil.h zlib.h zconf.h infblock.h 73inflate.o: zutil.h zlib.h zconf.h infblock.h
125inftrees.o: zutil.h zlib.h zconf.h inftrees.h 74inftrees.o: zutil.h zlib.h zconf.h inftrees.h
126infutil.o: zutil.h zlib.h zconf.h infblock.h inftrees.h infcodes.h infutil.h 75infutil.o: zutil.h zlib.h zconf.h inftrees.h infutil.h
127minigzip.o: zlib.h zconf.h 76minigzip.o: zlib.h zconf.h
128trees.o: deflate.h zutil.h zlib.h zconf.h 77trees.o: deflate.h zutil.h zlib.h zconf.h
129uncompr.o: zlib.h zconf.h 78uncompr.o: zlib.h zconf.h
130zutil.o: zutil.h zlib.h zconf.h 79zutil.o: zutil.h zlib.h zconf.h