Makefile.in
Upload User: shengde
Upload Date: 2021-02-21
Package Size: 638k
Code Size: 7k
Development Platform:

Visual C++

  1. # Makefile for zlib
  2. # Copyright (C) 1995-2010 Jean-loup Gailly.
  3. # For conditions of distribution and use, see copyright notice in zlib.h
  4. # To compile and test, type:
  5. #    ./configure; make test
  6. # Normally configure builds both a static and a shared library.
  7. # If you want to build just a static library, use: ./configure --static
  8. # To use the asm code, type:
  9. #    cp contrib/asm?86/match.S ./match.S
  10. #    make LOC=-DASMV OBJA=match.o
  11. # To install /usr/local/lib/libz.* and /usr/local/include/zlib.h, type:
  12. #    make install
  13. # To install in $HOME instead of /usr/local, use:
  14. #    make install prefix=$HOME
  15. CC=cc
  16. CFLAGS=-O
  17. #CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
  18. #CFLAGS=-g -DDEBUG
  19. #CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion 
  20. #           -Wstrict-prototypes -Wmissing-prototypes
  21. SFLAGS=-O
  22. LDFLAGS=-L. libz.a
  23. LDSHARED=$(CC)
  24. CPP=$(CC) -E
  25. STATICLIB=libz.a
  26. SHAREDLIB=libz.so
  27. SHAREDLIBV=libz.so.1.2.4
  28. SHAREDLIBM=libz.so.1
  29. LIBS=$(STATICLIB) $(SHAREDLIB) $(SHAREDLIBV)
  30. AR=ar rc
  31. RANLIB=ranlib
  32. TAR=tar
  33. SHELL=/bin/sh
  34. EXE=
  35. prefix = /usr/local
  36. exec_prefix = ${prefix}
  37. libdir = ${exec_prefix}/lib
  38. includedir = ${prefix}/include
  39. mandir = ${prefix}/share/man
  40. man3dir = ${mandir}/man3
  41. pkgconfigdir = ${libdir}/pkgconfig
  42. OBJC = adler32.o compress.o crc32.o deflate.o gzclose.o gzlib.o gzread.o 
  43. gzwrite.o infback.o inffast.o inflate.o inftrees.o trees.o uncompr.o zutil.o
  44. PIC_OBJC = adler32.lo compress.lo crc32.lo deflate.lo gzclose.lo gzlib.lo gzread.lo 
  45. gzwrite.lo infback.lo inffast.lo inflate.lo inftrees.lo trees.lo uncompr.lo zutil.lo
  46. # to use the asm code: make OBJA=match.o, PIC_OBJA=match.lo
  47. OBJA =
  48. PIC_OBJA =
  49. OBJS = $(OBJC) $(OBJA)
  50. PIC_OBJS = $(PIC_OBJC) $(PIC_OBJA)
  51. all: static shared
  52. static: example$(EXE) minigzip$(EXE)
  53. shared: examplesh$(EXE) minigzipsh$(EXE)
  54. all64: example64$(EXE) minigzip64$(EXE)
  55. check: test
  56. test: all teststatic testshared
  57. teststatic: static
  58. @if echo hello world | ./minigzip | ./minigzip -d && ./example; then 
  59.   echo ' *** zlib test OK ***'; 
  60. else 
  61.   echo ' *** zlib test FAILED ***'; false; 
  62. fi
  63. -@rm -f foo.gz
  64. testshared: shared
  65. @LD_LIBRARY_PATH=`pwd`:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; 
  66. LD_LIBRARYN32_PATH=`pwd`:$(LD_LIBRARYN32_PATH) ; export LD_LIBRARYN32_PATH; 
  67. DYLD_LIBRARY_PATH=`pwd`:$(DYLD_LIBRARY_PATH) ; export DYLD_LIBRARY_PATH; 
  68. SHLIB_PATH=`pwd`:$(SHLIB_PATH) ; export SHLIB_PATH; 
  69. if echo hello world | ./minigzipsh | ./minigzipsh -d && ./examplesh; then 
  70.   echo ' *** zlib shared test OK ***'; 
  71. else 
  72.   echo ' *** zlib shared test FAILED ***'; false; 
  73. fi
  74. -@rm -f foo.gz
  75. test64: all64
  76. @if echo hello world | ./minigzip64 | ./minigzip64 -d && ./example64; then 
  77.   echo ' *** zlib 64-bit test OK ***'; 
  78. else 
  79.   echo ' *** zlib 64-bit test FAILED ***'; false; 
  80. fi
  81. -@rm -f foo.gz
  82. libz.a: $(OBJS)
  83. $(AR) $@ $(OBJS)
  84. -@ ($(RANLIB) $@ || true) >/dev/null 2>&1
  85. match.o: match.S
  86. $(CPP) match.S > _match.s
  87. $(CC) -c _match.s
  88. mv _match.o match.o
  89. rm -f _match.s
  90. match.lo: match.S
  91. $(CPP) match.S > _match.s
  92. $(CC) -c -fPIC _match.s
  93. mv _match.o match.lo
  94. rm -f _match.s
  95. example64.o: example.c zlib.h zconf.h
  96. $(CC) $(CFLAGS) -D_FILE_OFFSET_BITS=64 -c -o $@ example.c
  97. minigzip64.o: minigzip.c zlib.h zconf.h
  98. $(CC) $(CFLAGS) -D_FILE_OFFSET_BITS=64 -c -o $@ minigzip.c
  99. .SUFFIXES: .lo
  100. .c.lo:
  101. -@if [ ! -d objs ]; then mkdir objs; fi
  102. $(CC) $(SFLAGS) -DPIC -c -o objs/$*.o $<
  103. -@mv objs/$*.o $@
  104. $(SHAREDLIBV): $(PIC_OBJS)
  105. $(LDSHARED) $(SFLAGS) -o $@ $(PIC_OBJS) -lc
  106. rm -f $(SHAREDLIB) $(SHAREDLIBM)
  107. ln -s $@ $(SHAREDLIB)
  108. ln -s $@ $(SHAREDLIBM)
  109. -@rmdir objs
  110. example$(EXE): example.o $(STATICLIB)
  111. $(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS)
  112. minigzip$(EXE): minigzip.o $(STATICLIB)
  113. $(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS)
  114. examplesh$(EXE): example.o $(SHAREDLIBV)
  115. $(CC) $(CFLAGS) -o $@ example.o -L. $(SHAREDLIBV)
  116. minigzipsh$(EXE): minigzip.o $(SHAREDLIBV)
  117. $(CC) $(CFLAGS) -o $@ minigzip.o -L. $(SHAREDLIBV)
  118. example64$(EXE): example64.o $(STATICLIB)
  119. $(CC) $(CFLAGS) -o $@ example64.o $(LDFLAGS)
  120. minigzip64$(EXE): minigzip64.o $(STATICLIB)
  121. $(CC) $(CFLAGS) -o $@ minigzip64.o $(LDFLAGS)
  122. install-libs: $(LIBS)
  123. -@if [ ! -d $(DESTDIR)$(exec_prefix)  ]; then mkdir -p $(DESTDIR)$(exec_prefix); fi
  124. -@if [ ! -d $(DESTDIR)$(libdir)       ]; then mkdir -p $(DESTDIR)$(libdir); fi
  125. -@if [ ! -d $(DESTDIR)$(man3dir)      ]; then mkdir -p $(DESTDIR)$(man3dir); fi
  126. -@if [ ! -d $(DESTDIR)$(pkgconfigdir) ]; then mkdir -p $(DESTDIR)$(pkgconfigdir); fi
  127. cp $(LIBS) $(DESTDIR)$(libdir)
  128. cd $(DESTDIR)$(libdir); chmod u=rw,go=r $(STATICLIB)
  129. -@(cd $(DESTDIR)$(libdir); $(RANLIB) libz.a || true) >/dev/null 2>&1
  130. -@cd $(DESTDIR)$(libdir); if test "$(SHAREDLIBV)" -a -f $(SHAREDLIBV); then 
  131.   chmod 755 $(SHAREDLIBV); 
  132.   rm -f $(SHAREDLIB) $(SHAREDLIBM); 
  133.   ln -s $(SHAREDLIBV) $(SHAREDLIB); 
  134.   ln -s $(SHAREDLIBV) $(SHAREDLIBM); 
  135.   (ldconfig || true)  >/dev/null 2>&1; 
  136. fi
  137. cp zlib.3 $(DESTDIR)$(man3dir)
  138. chmod 644 $(DESTDIR)$(man3dir)/zlib.3
  139. cp zlib.pc $(DESTDIR)$(pkgconfigdir)
  140. chmod 644 $(DESTDIR)$(pkgconfigdir)/zlib.pc
  141. # The ranlib in install is needed on NeXTSTEP which checks file times
  142. # ldconfig is for Linux
  143. install: install-libs
  144. -@if [ ! -d $(DESTDIR)$(includedir)   ]; then mkdir -p $(DESTDIR)$(includedir); fi
  145. cp zlib.h zconf.h $(DESTDIR)$(includedir)
  146. chmod 644 $(DESTDIR)$(includedir)/zlib.h $(DESTDIR)$(includedir)/zconf.h
  147. uninstall:
  148. cd $(DESTDIR)$(includedir); rm -f zlib.h zconf.h
  149. cd $(DESTDIR)$(libdir); rm -f libz.a; 
  150. if test "$(SHAREDLIBV)" -a -f $(SHAREDLIBV); then 
  151.   rm -f $(SHAREDLIBV) $(SHAREDLIB) $(SHAREDLIBM); 
  152. fi
  153. cd $(DESTDIR)$(man3dir); rm -f zlib.3
  154. cd $(DESTDIR)$(pkgconfigdir); rm -f zlib.pc
  155. docs: zlib.3.pdf
  156. zlib.3.pdf: zlib.3
  157. groff -mandoc -f H -T ps zlib.3 | ps2pdf - zlib.3.pdf
  158. zconf.h.in: zconf.h.cmakein
  159. sed "/^#cmakedefine/D" < zconf.h.cmakein > zconf.h.in
  160. touch -r zconf.h.cmakein zconf.h.in
  161. zconf: zconf.h.in
  162. cp -p zconf.h.in zconf.h
  163. mostlyclean: clean
  164. clean:
  165. rm -f *.o *.lo *~ 
  166.    example$(EXE) minigzip$(EXE) examplesh$(EXE) minigzipsh$(EXE) 
  167.    example64$(EXE) minigzip64$(EXE) 
  168.    libz.* foo.gz so_locations 
  169.    _match.s maketree contrib/infback9/*.o
  170. rm -rf objs
  171. maintainer-clean: distclean
  172. distclean: clean zconf docs
  173. rm -f Makefile zlib.pc
  174. -@rm -f .DS_Store
  175. -@printf 'all:nt-@echo "Please use ./configure first.  Thank you."n' > Makefile
  176. -@printf 'ndistclean:ntmake -f Makefile.in distcleann' >> Makefile
  177. -@touch -r Makefile.in Makefile
  178. tags:
  179. etags *.[ch]
  180. depend:
  181. makedepend -- $(CFLAGS) -- *.[ch]
  182. # DO NOT DELETE THIS LINE -- make depend depends on it.
  183. adler32.o zutil.o: zutil.h zlib.h zconf.h
  184. gzclose.o gzlib.o gzread.o gzwrite.o: zlib.h zconf.h gzguts.h
  185. compress.o example.o minigzip.o uncompr.o: zlib.h zconf.h
  186. crc32.o: zutil.h zlib.h zconf.h crc32.h
  187. deflate.o: deflate.h zutil.h zlib.h zconf.h
  188. infback.o inflate.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h inffixed.h
  189. inffast.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
  190. inftrees.o: zutil.h zlib.h zconf.h inftrees.h
  191. trees.o: deflate.h zutil.h zlib.h zconf.h trees.h
  192. adler32.lo zutil.lo: zutil.h zlib.h zconf.h
  193. gzclose.lo gzlib.lo gzread.lo gzwrite.lo: zlib.h zconf.h gzguts.h
  194. compress.lo example.lo minigzip.lo uncompr.lo: zlib.h zconf.h
  195. crc32.lo: zutil.h zlib.h zconf.h crc32.h
  196. deflate.lo: deflate.h zutil.h zlib.h zconf.h
  197. infback.lo inflate.lo: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h inffixed.h
  198. inffast.lo: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h
  199. inftrees.lo: zutil.h zlib.h zconf.h inftrees.h
  200. trees.lo: deflate.h zutil.h zlib.h zconf.h trees.h