summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile63
1 files changed, 12 insertions, 51 deletions
diff --git a/Makefile b/Makefile
index ccf0a56..039280d 100644
--- a/Makefile
+++ b/Makefile
@@ -28,9 +28,10 @@ LDFLAGS=libz.a
28LDSHARED=$(CC) 28LDSHARED=$(CC)
29CPP=$(CC) -E 29CPP=$(CC) -E
30 30
31VER=1.2.0.6
32LIBS=libz.a 31LIBS=libz.a
33SHAREDLIB=libz.so 32SHAREDLIB=libz.so
33SHAREDLIBV=libz.so.1.2.0.7
34SHAREDLIBM=libz.so.1
34 35
35AR=ar rc 36AR=ar rc
36RANLIB=ranlib 37RANLIB=ranlib
@@ -52,19 +53,6 @@ OBJA =
52 53
53TEST_OBJS = example.o minigzip.o 54TEST_OBJS = example.o minigzip.o
54 55
55# Note: this has not been updated for zlib 1.2.0
56DISTFILES = README FAQ INDEX ChangeLog configure Make*[a-z0-9] *.[ch] *.mms \
57 algorithm.txt zlib.3 zlib.html \
58 msdos/Make*[a-z0-9] msdos/zlib.def msdos/zlib.rc \
59 nt/Make*[a-z0-9] nt/zlib.dnt amiga/Make*.??? os2/M*.os2 os2/zlib.def \
60 contrib/RE*.contrib contrib/*.txt contrib/asm386/*.asm contrib/asm386/*.c \
61 contrib/asm386/*.bat contrib/asm386/zlibvc.d?? contrib/asm[56]86/*.?86 \
62 contrib/asm[56]86/*.S contrib/iostream/*.cpp \
63 contrib/iostream/*.h contrib/iostream2/*.h contrib/iostream2/*.cpp \
64 contrib/untgz/Makefile contrib/untgz/*.c contrib/untgz/*.w32 \
65 contrib/minizip/[CM]*[pe] contrib/minizip/*.[ch] contrib/minizip/*.[td]?? \
66 contrib/delphi*/*.???
67
68all: example minigzip 56all: example minigzip
69 57
70check: test 58check: test
@@ -88,11 +76,11 @@ match.o: match.S
88 mv _match.o match.o 76 mv _match.o match.o
89 rm -f _match.s 77 rm -f _match.s
90 78
91$(SHAREDLIB).$(VER): $(OBJS) 79$(SHAREDLIBV): $(OBJS)
92 $(LDSHARED) -o $@ $(OBJS) 80 $(LDSHARED) -o $@ $(OBJS)
93 rm -f $(SHAREDLIB) $(SHAREDLIB).1 81 rm -f $(SHAREDLIB) $(SHAREDLIBM)
94 ln -s $@ $(SHAREDLIB) 82 ln -s $@ $(SHAREDLIB)
95 ln -s $@ $(SHAREDLIB).1 83 ln -s $@ $(SHAREDLIBM)
96 84
97example: example.o $(LIBS) 85example: example.o $(LIBS)
98 $(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS) 86 $(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS)
@@ -110,10 +98,10 @@ install: $(LIBS)
110 cp $(LIBS) $(libdir) 98 cp $(LIBS) $(libdir)
111 cd $(libdir); chmod 755 $(LIBS) 99 cd $(libdir); chmod 755 $(LIBS)
112 -@(cd $(libdir); $(RANLIB) libz.a || true) >/dev/null 2>&1 100 -@(cd $(libdir); $(RANLIB) libz.a || true) >/dev/null 2>&1
113 cd $(libdir); if test -f $(SHAREDLIB).$(VER); then \ 101 cd $(libdir); if test -f $(SHAREDLIBV); then \
114 rm -f $(SHAREDLIB) $(SHAREDLIB).1; \ 102 rm -f $(SHAREDLIB) $(SHAREDLIBM); \
115 ln -s $(SHAREDLIB).$(VER) $(SHAREDLIB); \ 103 ln -s $(SHAREDLIBV) $(SHAREDLIB); \
116 ln -s $(SHAREDLIB).$(VER) $(SHAREDLIB).1; \ 104 ln -s $(SHAREDLIBV) $(SHAREDLIBM); \
117 (ldconfig || true) >/dev/null 2>&1; \ 105 (ldconfig || true) >/dev/null 2>&1; \
118 fi 106 fi
119 cp zlib.3 $(man3dir) 107 cp zlib.3 $(man3dir)
@@ -123,20 +111,15 @@ install: $(LIBS)
123 111
124uninstall: 112uninstall:
125 cd $(includedir); \ 113 cd $(includedir); \
126 v=$(VER); \
127 if test -f zlib.h; then \
128 v=`sed -n '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`; \
129 rm -f zlib.h zconf.h; \
130 fi; \
131 cd $(libdir); rm -f libz.a; \ 114 cd $(libdir); rm -f libz.a; \
132 if test -f $(SHAREDLIB).$$v; then \ 115 if test -f $(SHAREDLIBV); then \
133 rm -f $(SHAREDLIB).$$v $(SHAREDLIB) $(SHAREDLIB).1; \ 116 rm -f $(SHAREDLIBV) $(SHAREDLIB) $(SHAREDLIBM); \
134 fi 117 fi
135 cd $(man3dir); rm -f zlib.3 118 cd $(man3dir); rm -f zlib.3
136 119
137mostlyclean: clean 120mostlyclean: clean
138clean: 121clean:
139 rm -f *.o *~ example minigzip libz.a libz.so* foo.gz so_locations \ 122 rm -f *.o *~ example minigzip libz.* foo.gz so_locations \
140 _match.s maketree contrib/infback9/*.o 123 _match.s maketree contrib/infback9/*.o
141 124
142maintainer-clean: distclean 125maintainer-clean: distclean
@@ -145,28 +128,6 @@ distclean: clean
145 cp -p zconf.in.h zconf.h 128 cp -p zconf.in.h zconf.h
146 rm -f .DS_Store 129 rm -f .DS_Store
147 130
148zip:
149 echo Warning: this has not been updated for zlib 1.2.0 -- do not use
150 mv Makefile Makefile~; cp -p Makefile.in Makefile
151 rm -f test.c ztest*.c contrib/minizip/test.zip
152 v=`sed -n -e 's/\.//g' -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\
153 zip -ul9 zlib$$v $(DISTFILES)
154 mv Makefile~ Makefile
155
156dist:
157 echo Warning: this has not been updated for zlib 1.2.0 -- do not use
158 mv Makefile Makefile~; cp -p Makefile.in Makefile
159 rm -f test.c ztest*.c contrib/minizip/test.zip
160 d=zlib-`sed -n '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\
161 rm -f $$d.tar.gz; \
162 if test ! -d ../$$d; then rm -f ../$$d; ln -s `pwd` ../$$d; fi; \
163 files=""; \
164 for f in $(DISTFILES); do files="$$files $$d/$$f"; done; \
165 cd ..; \
166 GZIP=-9 $(TAR) chofz $$d/$$d.tar.gz $$files; \
167 if test ! -d $$d; then rm -f $$d; fi
168 mv Makefile~ Makefile
169
170tags: 131tags:
171 etags *.[ch] 132 etags *.[ch]
172 133