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