Makefile.msc 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. # Makefile for zlib
  2. # Microsoft C 5.1 or later
  3. # Last updated: 19-Mar-2003
  4. # To use, do "make makefile.msc"
  5. # To compile in small model, set below: MODEL=S
  6. # If you wish to reduce the memory requirements (default 256K for big
  7. # objects plus a few K), you can add to the LOC macro below:
  8. # -DMAX_MEM_LEVEL=7 -DMAX_WBITS=14
  9. # See zconf.h for details about the memory requirements.
  10. # ------------- Microsoft C 5.1 and later -------------
  11. # Optional nonstandard preprocessor flags (e.g. -DMAX_MEM_LEVEL=7)
  12. # should be added to the environment via "set LOCAL_ZLIB=-DFOO" or added
  13. # to the declaration of LOC here:
  14. LOC = $(LOCAL_ZLIB)
  15. # Type for CPU required: 0: 8086, 1: 80186, 2: 80286, 3: 80386, etc.
  16. CPU_TYP = 0
  17. # Memory model: one of S, M, C, L (small, medium, compact, large)
  18. MODEL=L
  19. CC=cl
  20. CFLAGS=-nologo -A$(MODEL) -G$(CPU_TYP) -W3 -Oait -Gs $(LOC)
  21. #-Ox generates bad code with MSC 5.1
  22. LIB_CFLAGS=-Zl $(CFLAGS)
  23. LD=link
  24. LDFLAGS=/noi/e/st:0x1500/noe/farcall/packcode
  25. # "/farcall/packcode" are only useful for `large code' memory models
  26. # but should be a "no-op" for small code models.
  27. # variables
  28. ZLIB_LIB = zlib_$(MODEL).lib
  29. OBJ1 = adler32.obj compress.obj crc32.obj deflate.obj gzclose.obj gzlib.obj gzread.obj
  30. OBJ2 = gzwrite.obj infback.obj inffast.obj inflate.obj inftrees.obj trees.obj uncompr.obj zutil.obj
  31. # targets
  32. all: $(ZLIB_LIB) example.exe minigzip.exe
  33. .c.obj:
  34. $(CC) -c $(LIB_CFLAGS) $*.c
  35. adler32.obj: adler32.c zlib.h zconf.h
  36. compress.obj: compress.c zlib.h zconf.h
  37. crc32.obj: crc32.c zlib.h zconf.h crc32.h
  38. deflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h
  39. gzclose.obj: gzclose.c zlib.h zconf.h gzguts.h
  40. gzlib.obj: gzlib.c zlib.h zconf.h gzguts.h
  41. gzread.obj: gzread.c zlib.h zconf.h gzguts.h
  42. gzwrite.obj: gzwrite.c zlib.h zconf.h gzguts.h
  43. infback.obj: infback.c zutil.h zlib.h zconf.h inftrees.h inflate.h \
  44. inffast.h inffixed.h
  45. inffast.obj: inffast.c zutil.h zlib.h zconf.h inftrees.h inflate.h \
  46. inffast.h
  47. inflate.obj: inflate.c zutil.h zlib.h zconf.h inftrees.h inflate.h \
  48. inffast.h inffixed.h
  49. inftrees.obj: inftrees.c zutil.h zlib.h zconf.h inftrees.h
  50. trees.obj: trees.c zutil.h zlib.h zconf.h deflate.h trees.h
  51. uncompr.obj: uncompr.c zlib.h zconf.h
  52. zutil.obj: zutil.c zutil.h zlib.h zconf.h
  53. example.obj: test/example.c zlib.h zconf.h
  54. $(CC) -c $(CFLAGS) $*.c
  55. minigzip.obj: test/minigzip.c zlib.h zconf.h
  56. $(CC) -c $(CFLAGS) $*.c
  57. # the command line is cut to fit in the MS-DOS 128 byte limit:
  58. $(ZLIB_LIB): $(OBJ1) $(OBJ2)
  59. if exist $(ZLIB_LIB) del $(ZLIB_LIB)
  60. lib $(ZLIB_LIB) $(OBJ1);
  61. lib $(ZLIB_LIB) $(OBJ2);
  62. example.exe: example.obj $(ZLIB_LIB)
  63. $(LD) $(LDFLAGS) example.obj,,,$(ZLIB_LIB);
  64. minigzip.exe: minigzip.obj $(ZLIB_LIB)
  65. $(LD) $(LDFLAGS) minigzip.obj,,,$(ZLIB_LIB);
  66. test: example.exe minigzip.exe
  67. example
  68. echo hello world | minigzip | minigzip -d
  69. clean:
  70. -del *.obj
  71. -del *.lib
  72. -del *.exe
  73. -del *.map
  74. -del zlib_*.bak
  75. -del foo.gz