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.

179 lines
5.4 KiB

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