summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile43
1 files changed, 24 insertions, 19 deletions
diff --git a/Makefile b/Makefile
index 2fd6e45..460471b 100644
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,5 @@
1# Makefile for zlib 1# Makefile for zlib
2# Copyright (C) 1995-2005 Jean-loup Gailly. 2# Copyright (C) 1995-2006 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: 5# To compile and test, type:
@@ -30,10 +30,10 @@ CPP=$(CC) -E
30 30
31LIBS=libz.a 31LIBS=libz.a
32SHAREDLIB=libz.so 32SHAREDLIB=libz.so
33SHAREDLIBV=libz.so.1.2.3 33SHAREDLIBV=libz.so.1.2.3.1
34SHAREDLIBM=libz.so.1 34SHAREDLIBM=libz.so.1
35 35
36AR=ar rc 36AR=ar
37RANLIB=ranlib 37RANLIB=ranlib
38TAR=tar 38TAR=tar
39SHELL=/bin/sh 39SHELL=/bin/sh
@@ -45,6 +45,7 @@ libdir = ${exec_prefix}/lib
45includedir = ${prefix}/include 45includedir = ${prefix}/include
46mandir = ${prefix}/share/man 46mandir = ${prefix}/share/man
47man3dir = ${mandir}/man3 47man3dir = ${mandir}/man3
48pkgconfigdir = ${libdir}/pkgconfig
48 49
49OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \ 50OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \
50 zutil.o inflate.o infback.o inftrees.o inffast.o 51 zutil.o inflate.o infback.o inftrees.o inffast.o
@@ -90,33 +91,37 @@ minigzip$(EXE): minigzip.o $(LIBS)
90 $(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS) 91 $(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS)
91 92
92install: $(LIBS) 93install: $(LIBS)
93 -@if [ ! -d $(exec_prefix) ]; then mkdir -p $(exec_prefix); fi 94 -@if [ ! -d $(DESTDIR)$(exec_prefix) ]; then mkdir -p $(DESTDIR)$(exec_prefix); fi
94 -@if [ ! -d $(includedir) ]; then mkdir -p $(includedir); fi 95 -@if [ ! -d $(DESTDIR)$(includedir) ]; then mkdir -p $(DESTDIR)$(includedir); fi
95 -@if [ ! -d $(libdir) ]; then mkdir -p $(libdir); fi 96 -@if [ ! -d $(DESTDIR)$(libdir) ]; then mkdir -p $(DESTDIR)$(libdir); fi
96 -@if [ ! -d $(man3dir) ]; then mkdir -p $(man3dir); fi 97 -@if [ ! -d $(DESTDIR)$(man3dir) ]; then mkdir -p $(DESTDIR)$(man3dir); fi
97 cp zlib.h zconf.h $(includedir) 98 -@if [ ! -d $(DESTDIR)$(pkgconfigdir) ]; then mkdir -p $(DESTDIR)$(pkgconfigdir); fi
98 chmod 644 $(includedir)/zlib.h $(includedir)/zconf.h 99 cp zlib.h zconf.h $(DESTDIR)$(includedir)
99 cp $(LIBS) $(libdir) 100 chmod 644 $(DESTDIR)$(includedir)/zlib.h $(DESTDIR)$(includedir)/zconf.h
100 cd $(libdir); chmod 755 $(LIBS) 101 cp $(LIBS) $(DESTDIR)$(libdir)
101 -@(cd $(libdir); $(RANLIB) libz.a || true) >/dev/null 2>&1 102 cd $(DESTDIR)$(libdir); chmod 755 $(LIBS)
102 cd $(libdir); if test -f $(SHAREDLIBV); then \ 103 -@(cd $(DESTDIR)$(libdir); $(RANLIB) libz.a || true) >/dev/null 2>&1
104 cd $(DESTDIR)$(libdir); if test -f $(SHAREDLIBV); then \
103 rm -f $(SHAREDLIB) $(SHAREDLIBM); \ 105 rm -f $(SHAREDLIB) $(SHAREDLIBM); \
104 ln -s $(SHAREDLIBV) $(SHAREDLIB); \ 106 ln -s $(SHAREDLIBV) $(SHAREDLIB); \
105 ln -s $(SHAREDLIBV) $(SHAREDLIBM); \ 107 ln -s $(SHAREDLIBV) $(SHAREDLIBM); \
106 (ldconfig || true) >/dev/null 2>&1; \ 108 (ldconfig || true) >/dev/null 2>&1; \
107 fi 109 fi
108 cp zlib.3 $(man3dir) 110 cp zlib.3 $(DESTDIR)$(man3dir)
109 chmod 644 $(man3dir)/zlib.3 111 chmod 644 $(DESTDIR)$(man3dir)/zlib.3
112 cp zlib.pc $(DESTDIR)$(pkgconfigdir)
113 chmod 644 $(DESTDIR)$(pkgconfigdir)/zlib.pc
110# The ranlib in install is needed on NeXTSTEP which checks file times 114# The ranlib in install is needed on NeXTSTEP which checks file times
111# ldconfig is for Linux 115# ldconfig is for Linux
112 116
113uninstall: 117uninstall:
114 cd $(includedir); \ 118 cd $(DESTDIR)$(includedir); rm -f zlib.h zconf.h
115 cd $(libdir); rm -f libz.a; \ 119 cd $(DESTDIR)$(libdir); rm -f libz.a; \
116 if test -f $(SHAREDLIBV); then \ 120 if test -f $(SHAREDLIBV); then \
117 rm -f $(SHAREDLIBV) $(SHAREDLIB) $(SHAREDLIBM); \ 121 rm -f $(SHAREDLIBV) $(SHAREDLIB) $(SHAREDLIBM); \
118 fi 122 fi
119 cd $(man3dir); rm -f zlib.3 123 cd $(DESTDIR)$(man3dir); rm -f zlib.3
124 cd $(DESTDIR)$(pkgconfigdir); rm -f zlib.pc
120 125
121mostlyclean: clean 126mostlyclean: clean
122clean: 127clean:
@@ -128,7 +133,7 @@ maintainer-clean: distclean
128distclean: clean 133distclean: clean
129 cp -p Makefile.in Makefile 134 cp -p Makefile.in Makefile
130 cp -p zconf.in.h zconf.h 135 cp -p zconf.in.h zconf.h
131 rm -f .DS_Store 136 rm -f zlib.pc .DS_Store
132 137
133tags: 138tags:
134 etags *.[ch] 139 etags *.[ch]