aboutsummaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile28
1 files changed, 19 insertions, 9 deletions
diff --git a/Makefile b/Makefile
index 3981614..0de616c 100644
--- a/Makefile
+++ b/Makefile
@@ -5,6 +5,7 @@
5# To compile and test, type: 5# To compile and test, type:
6# ./configure; make test 6# ./configure; make test
7# The call of configure is optional if you don't have special requirements 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
8 9
9# To install /usr/local/lib/libz.* and /usr/local/include/zlib.h, type: 10# To install /usr/local/lib/libz.* and /usr/local/include/zlib.h, type:
10# make install 11# make install
@@ -22,7 +23,7 @@ CFLAGS=-O
22LDFLAGS=-L. -lz 23LDFLAGS=-L. -lz
23LDSHARED=$(CC) 24LDSHARED=$(CC)
24 25
25VER=1.0.7 26VER=1.0.8
26LIBS=libz.a 27LIBS=libz.a
27SHAREDLIB=libz.so 28SHAREDLIB=libz.so
28 29
@@ -51,8 +52,13 @@ all: example minigzip
51 52
52test: all 53test: all
53 @LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \ 54 @LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \
54 ./example ; \ 55 echo hello world | ./minigzip | ./minigzip -d || \
55 echo hello world | ./minigzip | ./minigzip -d 56 echo ' *** minigzip test FAILED ***' ; \
57 if ./example; then \
58 echo ' *** zlib test OK ***'; \
59 else \
60 echo ' *** zlib test FAILED ***'; \
61 fi
56 62
57libz.a: $(OBJS) 63libz.a: $(OBJS)
58 $(AR) $@ $(OBJS) 64 $(AR) $@ $(OBJS)
@@ -88,12 +94,16 @@ install: $(LIBS)
88# ldconfig is for Linux 94# ldconfig is for Linux
89 95
90uninstall: 96uninstall:
91 cd $(exec_prefix)/lib; rm -f $(LIBS); \ 97 cd $(prefix)/include; \
92 if test -f $(SHAREDLIB); then \ 98 v=$(VER); \
93 v=`sed -n '/VERSION "/s/.*"\(.*\)".*/\1/p'<$(prefix)/include/zlib.h`;\ 99 if test -f zlib.h; then \
94 rm -f $(SHAREDLIB).$$v $(SHAREDLIB); \ 100 v=`sed -n '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`; \
101 rm -f zlib.h zconf.h; \
102 fi; \
103 cd $(exec_prefix)/lib; rm -f libz.a; \
104 if test -f $(SHAREDLIB).$$v; then \
105 rm -f $(SHAREDLIB).$$v $(SHAREDLIB) $(SHAREDLIB).1; \
95 fi 106 fi
96 cdz $(prefix)/include; rm -f zlib.h zconf.h
97 107
98clean: 108clean:
99 rm -f *.o *~ example minigzip libz.a libz.so* foo.gz 109 rm -f *.o *~ example minigzip libz.a libz.so* foo.gz
@@ -141,6 +151,6 @@ inflate.o: zutil.h zlib.h zconf.h infblock.h
141inftrees.o: zutil.h zlib.h zconf.h inftrees.h 151inftrees.o: zutil.h zlib.h zconf.h inftrees.h
142infutil.o: zutil.h zlib.h zconf.h infblock.h inftrees.h infcodes.h infutil.h 152infutil.o: zutil.h zlib.h zconf.h infblock.h inftrees.h infcodes.h infutil.h
143minigzip.o: zlib.h zconf.h 153minigzip.o: zlib.h zconf.h
144trees.o: deflate.h zutil.h zlib.h zconf.h 154trees.o: deflate.h zutil.h zlib.h zconf.h trees.h
145uncompr.o: zlib.h zconf.h 155uncompr.o: zlib.h zconf.h
146zutil.o: zutil.h zlib.h zconf.h 156zutil.o: zutil.h zlib.h zconf.h