diff options
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 43 |
1 files changed, 24 insertions, 19 deletions
| @@ -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 | ||
| 31 | LIBS=libz.a | 31 | LIBS=libz.a |
| 32 | SHAREDLIB=libz.so | 32 | SHAREDLIB=libz.so |
| 33 | SHAREDLIBV=libz.so.1.2.3 | 33 | SHAREDLIBV=libz.so.1.2.3.1 |
| 34 | SHAREDLIBM=libz.so.1 | 34 | SHAREDLIBM=libz.so.1 |
| 35 | 35 | ||
| 36 | AR=ar rc | 36 | AR=ar |
| 37 | RANLIB=ranlib | 37 | RANLIB=ranlib |
| 38 | TAR=tar | 38 | TAR=tar |
| 39 | SHELL=/bin/sh | 39 | SHELL=/bin/sh |
| @@ -45,6 +45,7 @@ libdir = ${exec_prefix}/lib | |||
| 45 | includedir = ${prefix}/include | 45 | includedir = ${prefix}/include |
| 46 | mandir = ${prefix}/share/man | 46 | mandir = ${prefix}/share/man |
| 47 | man3dir = ${mandir}/man3 | 47 | man3dir = ${mandir}/man3 |
| 48 | pkgconfigdir = ${libdir}/pkgconfig | ||
| 48 | 49 | ||
| 49 | OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \ | 50 | OBJS = 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 | ||
| 92 | install: $(LIBS) | 93 | install: $(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 | ||
| 113 | uninstall: | 117 | uninstall: |
| 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 | ||
| 121 | mostlyclean: clean | 126 | mostlyclean: clean |
| 122 | clean: | 127 | clean: |
| @@ -128,7 +133,7 @@ maintainer-clean: distclean | |||
| 128 | distclean: clean | 133 | distclean: 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 | ||
| 133 | tags: | 138 | tags: |
| 134 | etags *.[ch] | 139 | etags *.[ch] |
