annotate src/zlib-1.2.7/Makefile @ 169:223a55898ab9 tip default

Add null config files
author Chris Cannam <cannam@all-day-breakfast.com>
date Mon, 02 Mar 2020 14:03:47 +0000
parents 9fe94270bdf5
children
rev   line source
cannam@91 1 # Makefile for zlib
cannam@91 2 # Copyright (C) 1995-2011 Jean-loup Gailly.
cannam@91 3 # For conditions of distribution and use, see copyright notice in zlib.h
cannam@89 4
cannam@91 5 # To compile and test, type:
cannam@91 6 # ./configure; make test
cannam@91 7 # Normally configure builds both a static and a shared library.
cannam@91 8 # If you want to build just a static library, use: ./configure --static
cannam@91 9
cannam@91 10 # To use the asm code, type:
cannam@91 11 # cp contrib/asm?86/match.S ./match.S
cannam@91 12 # make LOC=-DASMV OBJA=match.o
cannam@91 13
cannam@91 14 # To install /usr/local/lib/libz.* and /usr/local/include/zlib.h, type:
cannam@91 15 # make install
cannam@91 16 # To install in $HOME instead of /usr/local, use:
cannam@91 17 # make install prefix=$HOME
cannam@91 18
cannam@91 19 CC=i486-mingw32-gcc -I/work/sonic-visualiser/sv-dependency-builds/src/zlib-1.2.7/../../script/win32/../..//win32-mingw/include -L/work/sonic-visualiser/sv-dependency-builds/src/zlib-1.2.7/../../script/win32/../..//win32-mingw/lib/win32
cannam@91 20
cannam@91 21 CFLAGS=-O3 -D_LARGEFILE64_SOURCE=1
cannam@91 22 #CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
cannam@91 23 #CFLAGS=-g -DDEBUG
cannam@91 24 #CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
cannam@91 25 # -Wstrict-prototypes -Wmissing-prototypes
cannam@91 26
cannam@91 27 SFLAGS=-O3 -fPIC -D_LARGEFILE64_SOURCE=1
cannam@91 28 LDFLAGS=
cannam@91 29 TEST_LDFLAGS=-L. libz.a
cannam@91 30 LDSHARED=i486-mingw32-gcc -I/work/sonic-visualiser/sv-dependency-builds/src/zlib-1.2.7/../../script/win32/../..//win32-mingw/include -L/work/sonic-visualiser/sv-dependency-builds/src/zlib-1.2.7/../../script/win32/../..//win32-mingw/lib/win32 -shared -Wl,-soname,libz.so.1,--version-script,zlib.map
cannam@91 31 CPP=i486-mingw32-gcc -I/work/sonic-visualiser/sv-dependency-builds/src/zlib-1.2.7/../../script/win32/../..//win32-mingw/include -L/work/sonic-visualiser/sv-dependency-builds/src/zlib-1.2.7/../../script/win32/../..//win32-mingw/lib/win32 -E
cannam@91 32
cannam@91 33 STATICLIB=libz.a
cannam@91 34 SHAREDLIB=libz.so
cannam@91 35 SHAREDLIBV=libz.so.1.2.7
cannam@91 36 SHAREDLIBM=libz.so.1
cannam@91 37 LIBS=$(STATICLIB) $(SHAREDLIBV)
cannam@91 38
cannam@91 39 AR=ar
cannam@91 40 ARFLAGS=rc
cannam@91 41 RANLIB=ranlib
cannam@91 42 LDCONFIG=ldconfig
cannam@91 43 LDSHAREDLIBC=-lc
cannam@91 44 TAR=tar
cannam@91 45 SHELL=/bin/sh
cannam@91 46 EXE=
cannam@91 47
cannam@91 48 prefix =/work/sonic-visualiser/sv-dependency-builds/src/zlib-1.2.7/../../script/win32/../..//win32-mingw/
cannam@91 49 exec_prefix =${prefix}
cannam@91 50 libdir =${exec_prefix}/lib
cannam@91 51 sharedlibdir =${libdir}
cannam@91 52 includedir =${prefix}/include
cannam@91 53 mandir =${prefix}/share/man
cannam@91 54 man3dir = ${mandir}/man3
cannam@91 55 pkgconfigdir = ${libdir}/pkgconfig
cannam@91 56
cannam@91 57 OBJZ = adler32.o crc32.o deflate.o infback.o inffast.o inflate.o inftrees.o trees.o zutil.o
cannam@91 58 OBJG = compress.o uncompr.o gzclose.o gzlib.o gzread.o gzwrite.o
cannam@91 59 OBJC = $(OBJZ) $(OBJG)
cannam@91 60
cannam@91 61 PIC_OBJZ = adler32.lo crc32.lo deflate.lo infback.lo inffast.lo inflate.lo inftrees.lo trees.lo zutil.lo
cannam@91 62 PIC_OBJG = compress.lo uncompr.lo gzclose.lo gzlib.lo gzread.lo gzwrite.lo
cannam@91 63 PIC_OBJC = $(PIC_OBJZ) $(PIC_OBJG)
cannam@91 64
cannam@91 65 # to use the asm code: make OBJA=match.o, PIC_OBJA=match.lo
cannam@91 66 OBJA =
cannam@91 67 PIC_OBJA =
cannam@91 68
cannam@91 69 OBJS = $(OBJC) $(OBJA)
cannam@91 70
cannam@91 71 PIC_OBJS = $(PIC_OBJC) $(PIC_OBJA)
cannam@91 72
cannam@91 73 all: static shared all64
cannam@91 74
cannam@91 75 static: example$(EXE) minigzip$(EXE)
cannam@91 76
cannam@91 77 shared: examplesh$(EXE) minigzipsh$(EXE)
cannam@91 78
cannam@91 79 all64: example64$(EXE) minigzip64$(EXE)
cannam@91 80
cannam@91 81 check: test
cannam@91 82
cannam@91 83 test: all teststatic testshared test64
cannam@91 84
cannam@91 85 teststatic: static
cannam@91 86 @TMPST=`mktemp fooXXXXXX`; \
cannam@91 87 if echo hello world | ./minigzip | ./minigzip -d && ./example $$TMPST ; then \
cannam@91 88 echo ' *** zlib test OK ***'; \
cannam@91 89 else \
cannam@91 90 echo ' *** zlib test FAILED ***'; false; \
cannam@91 91 fi; \
cannam@91 92 rm -f $$TMPST
cannam@91 93
cannam@91 94 testshared: shared
cannam@91 95 @LD_LIBRARY_PATH=`pwd`:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \
cannam@91 96 LD_LIBRARYN32_PATH=`pwd`:$(LD_LIBRARYN32_PATH) ; export LD_LIBRARYN32_PATH; \
cannam@91 97 DYLD_LIBRARY_PATH=`pwd`:$(DYLD_LIBRARY_PATH) ; export DYLD_LIBRARY_PATH; \
cannam@91 98 SHLIB_PATH=`pwd`:$(SHLIB_PATH) ; export SHLIB_PATH; \
cannam@91 99 TMPSH=`mktemp fooXXXXXX`; \
cannam@91 100 if echo hello world | ./minigzipsh | ./minigzipsh -d && ./examplesh $$TMPSH; then \
cannam@91 101 echo ' *** zlib shared test OK ***'; \
cannam@91 102 else \
cannam@91 103 echo ' *** zlib shared test FAILED ***'; false; \
cannam@91 104 fi; \
cannam@91 105 rm -f $$TMPSH
cannam@91 106
cannam@91 107 test64: all64
cannam@91 108 @TMP64=`mktemp fooXXXXXX`; \
cannam@91 109 if echo hello world | ./minigzip64 | ./minigzip64 -d && ./example64 $$TMP64; then \
cannam@91 110 echo ' *** zlib 64-bit test OK ***'; \
cannam@91 111 else \
cannam@91 112 echo ' *** zlib 64-bit test FAILED ***'; false; \
cannam@91 113 fi; \
cannam@91 114 rm -f $$TMP64
cannam@91 115
cannam@91 116 infcover.o: test/infcover.c zlib.h zconf.h
cannam@91 117 $(CC) $(CFLAGS) -I. -c -o $@ test/infcover.c
cannam@91 118
cannam@91 119 infcover: infcover.o libz.a
cannam@91 120 $(CC) $(CFLAGS) -o $@ infcover.o libz.a
cannam@91 121
cannam@91 122 cover: infcover
cannam@91 123 rm -f *.gcda
cannam@91 124 ./infcover
cannam@91 125 gcov inf*.c
cannam@91 126
cannam@91 127 libz.a: $(OBJS)
cannam@91 128 $(AR) $(ARFLAGS) $@ $(OBJS)
cannam@91 129 -@ ($(RANLIB) $@ || true) >/dev/null 2>&1
cannam@91 130
cannam@91 131 match.o: match.S
cannam@91 132 $(CPP) match.S > _match.s
cannam@91 133 $(CC) -c _match.s
cannam@91 134 mv _match.o match.o
cannam@91 135 rm -f _match.s
cannam@91 136
cannam@91 137 match.lo: match.S
cannam@91 138 $(CPP) match.S > _match.s
cannam@91 139 $(CC) -c -fPIC _match.s
cannam@91 140 mv _match.o match.lo
cannam@91 141 rm -f _match.s
cannam@91 142
cannam@91 143 example.o: test/example.c zlib.h zconf.h
cannam@91 144 $(CC) $(CFLAGS) -I. -c -o $@ test/example.c
cannam@91 145
cannam@91 146 minigzip.o: test/minigzip.c zlib.h zconf.h
cannam@91 147 $(CC) $(CFLAGS) -I. -c -o $@ test/minigzip.c
cannam@91 148
cannam@91 149 example64.o: test/example.c zlib.h zconf.h
cannam@91 150 $(CC) $(CFLAGS) -I. -D_FILE_OFFSET_BITS=64 -c -o $@ test/example.c
cannam@91 151
cannam@91 152 minigzip64.o: test/minigzip.c zlib.h zconf.h
cannam@91 153 $(CC) $(CFLAGS) -I. -D_FILE_OFFSET_BITS=64 -c -o $@ test/minigzip.c
cannam@91 154
cannam@91 155 .SUFFIXES: .lo
cannam@91 156
cannam@91 157 .c.lo:
cannam@91 158 -@mkdir objs 2>/dev/null || test -d objs
cannam@91 159 $(CC) $(SFLAGS) -DPIC -c -o objs/$*.o $<
cannam@91 160 -@mv objs/$*.o $@
cannam@91 161
cannam@91 162 placebo $(SHAREDLIBV): $(PIC_OBJS) libz.a
cannam@91 163 $(LDSHARED) $(SFLAGS) -o $@ $(PIC_OBJS) $(LDSHAREDLIBC) $(LDFLAGS)
cannam@91 164 rm -f $(SHAREDLIB) $(SHAREDLIBM)
cannam@91 165 ln -s $@ $(SHAREDLIB)
cannam@91 166 ln -s $@ $(SHAREDLIBM)
cannam@91 167 -@rmdir objs
cannam@91 168
cannam@91 169 example$(EXE): example.o $(STATICLIB)
cannam@91 170 $(CC) $(CFLAGS) -o $@ example.o $(TEST_LDFLAGS)
cannam@91 171
cannam@91 172 minigzip$(EXE): minigzip.o $(STATICLIB)
cannam@91 173 $(CC) $(CFLAGS) -o $@ minigzip.o $(TEST_LDFLAGS)
cannam@91 174
cannam@91 175 examplesh$(EXE): example.o $(SHAREDLIBV)
cannam@91 176 $(CC) $(CFLAGS) -o $@ example.o -L. $(SHAREDLIBV)
cannam@91 177
cannam@91 178 minigzipsh$(EXE): minigzip.o $(SHAREDLIBV)
cannam@91 179 $(CC) $(CFLAGS) -o $@ minigzip.o -L. $(SHAREDLIBV)
cannam@91 180
cannam@91 181 example64$(EXE): example64.o $(STATICLIB)
cannam@91 182 $(CC) $(CFLAGS) -o $@ example64.o $(TEST_LDFLAGS)
cannam@91 183
cannam@91 184 minigzip64$(EXE): minigzip64.o $(STATICLIB)
cannam@91 185 $(CC) $(CFLAGS) -o $@ minigzip64.o $(TEST_LDFLAGS)
cannam@91 186
cannam@91 187 install-libs: $(LIBS)
cannam@91 188 -@if [ ! -d $(DESTDIR)$(exec_prefix) ]; then mkdir -p $(DESTDIR)$(exec_prefix); fi
cannam@91 189 -@if [ ! -d $(DESTDIR)$(libdir) ]; then mkdir -p $(DESTDIR)$(libdir); fi
cannam@91 190 -@if [ ! -d $(DESTDIR)$(sharedlibdir) ]; then mkdir -p $(DESTDIR)$(sharedlibdir); fi
cannam@91 191 -@if [ ! -d $(DESTDIR)$(man3dir) ]; then mkdir -p $(DESTDIR)$(man3dir); fi
cannam@91 192 -@if [ ! -d $(DESTDIR)$(pkgconfigdir) ]; then mkdir -p $(DESTDIR)$(pkgconfigdir); fi
cannam@91 193 cp $(STATICLIB) $(DESTDIR)$(libdir)
cannam@91 194 chmod 644 $(DESTDIR)$(libdir)/$(STATICLIB)
cannam@91 195 -@($(RANLIB) $(DESTDIR)$(libdir)/libz.a || true) >/dev/null 2>&1
cannam@91 196 -@if test -n "$(SHAREDLIBV)"; then \
cannam@91 197 cp $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir); \
cannam@91 198 echo "cp $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)"; \
cannam@91 199 chmod 755 $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBV); \
cannam@91 200 echo "chmod 755 $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBV)"; \
cannam@91 201 rm -f $(DESTDIR)$(sharedlibdir)/$(SHAREDLIB) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBM); \
cannam@91 202 ln -s $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIB); \
cannam@91 203 ln -s $(SHAREDLIBV) $(DESTDIR)$(sharedlibdir)/$(SHAREDLIBM); \
cannam@91 204 ($(LDCONFIG) || true) >/dev/null 2>&1; \
cannam@91 205 fi
cannam@91 206 cp zlib.3 $(DESTDIR)$(man3dir)
cannam@91 207 chmod 644 $(DESTDIR)$(man3dir)/zlib.3
cannam@91 208 cp zlib.pc $(DESTDIR)$(pkgconfigdir)
cannam@91 209 chmod 644 $(DESTDIR)$(pkgconfigdir)/zlib.pc
cannam@91 210 # The ranlib in install is needed on NeXTSTEP which checks file times
cannam@91 211 # ldconfig is for Linux
cannam@91 212
cannam@91 213 install: install-libs
cannam@91 214 -@if [ ! -d $(DESTDIR)$(includedir) ]; then mkdir -p $(DESTDIR)$(includedir); fi
cannam@91 215 cp zlib.h zconf.h $(DESTDIR)$(includedir)
cannam@91 216 chmod 644 $(DESTDIR)$(includedir)/zlib.h $(DESTDIR)$(includedir)/zconf.h
cannam@91 217
cannam@91 218 uninstall:
cannam@91 219 cd $(DESTDIR)$(includedir); rm -f zlib.h zconf.h
cannam@91 220 cd $(DESTDIR)$(libdir); rm -f libz.a; \
cannam@91 221 if test -n "$(SHAREDLIBV)" -a -f $(SHAREDLIBV); then \
cannam@91 222 rm -f $(SHAREDLIBV) $(SHAREDLIB) $(SHAREDLIBM); \
cannam@91 223 fi
cannam@91 224 cd $(DESTDIR)$(man3dir); rm -f zlib.3
cannam@91 225 cd $(DESTDIR)$(pkgconfigdir); rm -f zlib.pc
cannam@91 226
cannam@91 227 docs: zlib.3.pdf
cannam@91 228
cannam@91 229 zlib.3.pdf: zlib.3
cannam@91 230 groff -mandoc -f H -T ps zlib.3 | ps2pdf - zlib.3.pdf
cannam@91 231
cannam@91 232 zconf.h.cmakein: zconf.h.in
cannam@91 233 -@ TEMPFILE=`mktemp __XXXXXX`; \
cannam@91 234 echo "/#define ZCONF_H/ a\\\\\n#cmakedefine Z_PREFIX\\\\\n#cmakedefine Z_HAVE_UNISTD_H\n" >> $$TEMPFILE &&\
cannam@91 235 sed -f $$TEMPFILE zconf.h.in > zconf.h.cmakein &&\
cannam@91 236 touch -r zconf.h.in zconf.h.cmakein &&\
cannam@91 237 rm $$TEMPFILE
cannam@91 238
cannam@91 239 zconf: zconf.h.in
cannam@91 240 cp -p zconf.h.in zconf.h
cannam@91 241
cannam@91 242 mostlyclean: clean
cannam@91 243 clean:
cannam@91 244 rm -f *.o *.lo *~ \
cannam@91 245 example$(EXE) minigzip$(EXE) examplesh$(EXE) minigzipsh$(EXE) \
cannam@91 246 example64$(EXE) minigzip64$(EXE) \
cannam@91 247 infcover \
cannam@91 248 libz.* foo.gz so_locations \
cannam@91 249 _match.s maketree contrib/infback9/*.o
cannam@91 250 rm -rf objs
cannam@91 251 rm -f *.gcda *.gcno *.gcov
cannam@91 252 rm -f contrib/infback9/*.gcda contrib/infback9/*.gcno contrib/infback9/*.gcov
cannam@91 253
cannam@91 254 maintainer-clean: distclean
cannam@91 255 distclean: clean zconf zconf.h.cmakein docs
cannam@91 256 rm -f Makefile zlib.pc configure.log
cannam@91 257 -@rm -f .DS_Store
cannam@91 258 -@printf 'all:\n\t-@echo "Please use ./configure first. Thank you."\n' > Makefile
cannam@91 259 -@printf '\ndistclean:\n\tmake -f Makefile.in distclean\n' >> Makefile
cannam@91 260 -@touch -r Makefile.in Makefile
cannam@91 261
cannam@91 262 tags:
cannam@91 263 etags *.[ch]
cannam@91 264
cannam@91 265 depend:
cannam@91 266 makedepend -- $(CFLAGS) -- *.[ch]
cannam@91 267
cannam@91 268 # DO NOT DELETE THIS LINE -- make depend depends on it.
cannam@91 269
cannam@91 270 adler32.o zutil.o: zutil.h zlib.h zconf.h
cannam@91 271 gzclose.o gzlib.o gzread.o gzwrite.o: zlib.h zconf.h gzguts.h
cannam@91 272 compress.o example.o minigzip.o uncompr.o: zlib.h zconf.h
cannam@91 273 crc32.o: zutil.h zlib.h zconf.h crc32.h
cannam@91 274 deflate.o: deflate.h zutil.h zlib.h zconf.h
cannam@91 275 infback.o inflate.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h inffixed.h
cannam@91 276 inffast.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
cannam@91 277 inftrees.o: zutil.h zlib.h zconf.h inftrees.h
cannam@91 278 trees.o: deflate.h zutil.h zlib.h zconf.h trees.h
cannam@91 279
cannam@91 280 adler32.lo zutil.lo: zutil.h zlib.h zconf.h
cannam@91 281 gzclose.lo gzlib.lo gzread.lo gzwrite.lo: zlib.h zconf.h gzguts.h
cannam@91 282 compress.lo example.lo minigzip.lo uncompr.lo: zlib.h zconf.h
cannam@91 283 crc32.lo: zutil.h zlib.h zconf.h crc32.h
cannam@91 284 deflate.lo: deflate.h zutil.h zlib.h zconf.h
cannam@91 285 infback.lo inflate.lo: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h inffixed.h
cannam@91 286 inffast.lo: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
cannam@91 287 inftrees.lo: zutil.h zlib.h zconf.h inftrees.h
cannam@91 288 trees.lo: deflate.h zutil.h zlib.h zconf.h trees.h