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.

180 lines
5.4 KiB

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