Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

175 lines
5.3 KiB

  1. # Makefile for zlib
  2. # Copyright (C) 1995-2002 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. # The call of configure is optional if you don't have special requirements
  7. # If you wish to build zlib as a shared library, use: ./configure -s
  8. # To install /usr/local/lib/libz.* and /usr/local/include/zlib.h, type:
  9. # make install
  10. # To install in $HOME instead of /usr/local, use:
  11. # make install prefix=$HOME
  12. CC=cc
  13. CFLAGS=-O
  14. #CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7
  15. #CFLAGS=-g -DDEBUG
  16. #CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \
  17. # -Wstrict-prototypes -Wmissing-prototypes
  18. LDFLAGS=-L. -lz
  19. LDSHARED=$(CC)
  20. CPP=$(CC) -E
  21. VER=1.1.4
  22. LIBS=libz.a
  23. SHAREDLIB=libz.so
  24. AR=ar rc
  25. RANLIB=ranlib
  26. TAR=tar
  27. SHELL=/bin/sh
  28. prefix = /usr/local
  29. exec_prefix = ${prefix}
  30. libdir = ${exec_prefix}/lib
  31. includedir = ${prefix}/include
  32. OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \
  33. zutil.o inflate.o infblock.o inftrees.o infcodes.o infutil.o inffast.o
  34. OBJA =
  35. # to use the asm code: make OBJA=match.o
  36. TEST_OBJS = example.o minigzip.o
  37. DISTFILES = README FAQ INDEX ChangeLog configure Make*[a-z0-9] *.[ch] *.mms \
  38. algorithm.txt zlib.3 zlib.html \
  39. msdos/Make*[a-z0-9] msdos/zlib.def msdos/zlib.rc \
  40. nt/Make*[a-z0-9] nt/zlib.dnt amiga/Make*.??? os2/M*.os2 os2/zlib.def \
  41. contrib/RE*.contrib contrib/*.txt contrib/asm386/*.asm contrib/asm386/*.c \
  42. contrib/asm386/*.bat contrib/asm386/zlibvc.d?? contrib/asm[56]86/*.?86 \
  43. contrib/asm[56]86/*.S contrib/iostream/*.cpp \
  44. contrib/iostream/*.h contrib/iostream2/*.h contrib/iostream2/*.cpp \
  45. contrib/untgz/Makefile contrib/untgz/*.c contrib/untgz/*.w32 \
  46. contrib/minizip/[CM]*[pe] contrib/minizip/*.[ch] contrib/minizip/*.[td]?? \
  47. contrib/delphi*/*.???
  48. all: example minigzip
  49. test: all
  50. @LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \
  51. echo hello world | ./minigzip | ./minigzip -d || \
  52. echo ' *** minigzip test FAILED ***' ; \
  53. if ./example; then \
  54. echo ' *** zlib test OK ***'; \
  55. else \
  56. echo ' *** zlib test FAILED ***'; \
  57. fi
  58. libz.a: $(OBJS) $(OBJA)
  59. $(AR) $@ $(OBJS) $(OBJA)
  60. -@ ($(RANLIB) $@ || true) >/dev/null 2>&1
  61. match.o: match.S
  62. $(CPP) match.S > _match.s
  63. $(CC) -c _match.s
  64. mv _match.o match.o
  65. rm -f _match.s
  66. $(SHAREDLIB).$(VER): $(OBJS)
  67. $(LDSHARED) -o $@ $(OBJS)
  68. rm -f $(SHAREDLIB) $(SHAREDLIB).1
  69. ln -s $@ $(SHAREDLIB)
  70. ln -s $@ $(SHAREDLIB).1
  71. example: example.o $(LIBS)
  72. $(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS)
  73. minigzip: minigzip.o $(LIBS)
  74. $(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS)
  75. install: $(LIBS)
  76. -@if [ ! -d $(includedir) ]; then mkdir $(includedir); fi
  77. -@if [ ! -d $(libdir) ]; then mkdir $(libdir); fi
  78. cp zlib.h zconf.h $(includedir)
  79. chmod 644 $(includedir)/zlib.h $(includedir)/zconf.h
  80. cp $(LIBS) $(libdir)
  81. cd $(libdir); chmod 755 $(LIBS)
  82. -@(cd $(libdir); $(RANLIB) libz.a || true) >/dev/null 2>&1
  83. cd $(libdir); if test -f $(SHAREDLIB).$(VER); then \
  84. rm -f $(SHAREDLIB) $(SHAREDLIB).1; \
  85. ln -s $(SHAREDLIB).$(VER) $(SHAREDLIB); \
  86. ln -s $(SHAREDLIB).$(VER) $(SHAREDLIB).1; \
  87. (ldconfig || true) >/dev/null 2>&1; \
  88. fi
  89. # The ranlib in install is needed on NeXTSTEP which checks file times
  90. # ldconfig is for Linux
  91. uninstall:
  92. cd $(includedir); \
  93. v=$(VER); \
  94. if test -f zlib.h; then \
  95. v=`sed -n '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`; \
  96. rm -f zlib.h zconf.h; \
  97. fi; \
  98. cd $(libdir); rm -f libz.a; \
  99. if test -f $(SHAREDLIB).$$v; then \
  100. rm -f $(SHAREDLIB).$$v $(SHAREDLIB) $(SHAREDLIB).1; \
  101. fi
  102. clean:
  103. rm -f *.o *~ example minigzip libz.a libz.so* foo.gz so_locations \
  104. _match.s maketree
  105. distclean: clean
  106. zip:
  107. mv Makefile Makefile~; cp -p Makefile.in Makefile
  108. rm -f test.c ztest*.c contrib/minizip/test.zip
  109. v=`sed -n -e 's/\.//g' -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\
  110. zip -ul9 zlib$$v $(DISTFILES)
  111. mv Makefile~ Makefile
  112. dist:
  113. mv Makefile Makefile~; cp -p Makefile.in Makefile
  114. rm -f test.c ztest*.c contrib/minizip/test.zip
  115. d=zlib-`sed -n '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`;\
  116. rm -f $$d.tar.gz; \
  117. if test ! -d ../$$d; then rm -f ../$$d; ln -s `pwd` ../$$d; fi; \
  118. files=""; \
  119. for f in $(DISTFILES); do files="$$files $$d/$$f"; done; \
  120. cd ..; \
  121. GZIP=-9 $(TAR) chofz $$d/$$d.tar.gz $$files; \
  122. if test ! -d $$d; then rm -f $$d; fi
  123. mv Makefile~ Makefile
  124. tags:
  125. etags *.[ch]
  126. depend:
  127. makedepend -- $(CFLAGS) -- *.[ch]
  128. # DO NOT DELETE THIS LINE -- make depend depends on it.
  129. adler32.o: zlib.h zconf.h
  130. compress.o: zlib.h zconf.h
  131. crc32.o: zlib.h zconf.h
  132. deflate.o: deflate.h zutil.h zlib.h zconf.h
  133. example.o: zlib.h zconf.h
  134. gzio.o: zutil.h zlib.h zconf.h
  135. infblock.o: infblock.h inftrees.h infcodes.h infutil.h zutil.h zlib.h zconf.h
  136. infcodes.o: zutil.h zlib.h zconf.h
  137. infcodes.o: inftrees.h infblock.h infcodes.h infutil.h inffast.h
  138. inffast.o: zutil.h zlib.h zconf.h inftrees.h
  139. inffast.o: infblock.h infcodes.h infutil.h inffast.h
  140. inflate.o: zutil.h zlib.h zconf.h infblock.h
  141. inftrees.o: zutil.h zlib.h zconf.h inftrees.h
  142. infutil.o: zutil.h zlib.h zconf.h infblock.h inftrees.h infcodes.h infutil.h
  143. minigzip.o: zlib.h zconf.h
  144. trees.o: deflate.h zutil.h zlib.h zconf.h trees.h
  145. uncompr.o: zlib.h zconf.h
  146. zutil.o: zutil.h zlib.h zconf.h