2 # Microsoft C 5.1 or later
4 # To use, do "make makefile.msc"
5 # To compile in small model, set below: MODEL=S
7 # If you wish to reduce the memory requirements (default 256K for big
8 # objects plus a few K), you can add to the LOC macro below:
9 # -DMAX_MEM_LEVEL=7 -DMAX_WBITS=14
10 # See zconf.h for details about the memory requirements.
12 # ------------- Microsoft C 5.1 and later -------------
14 # Optional nonstandard preprocessor flags (e.g. -DMAX_MEM_LEVEL=7)
15 # should be added to the environment via "set LOCAL_ZLIB=-DFOO" or added
16 # to the declaration of LOC here:
19 # Type for CPU required: 0: 8086, 1: 80186, 2: 80286, 3: 80386, etc.
22 # Memory model: one of S, M, C, L (small, medium, compact, large)
26 CFLAGS=-nologo -A$(MODEL) -G$(CPU_TYP) -W3 -Oait -Gs $(LOC)
27 #-Ox generates bad code with MSC 5.1
28 LIB_CFLAGS=-Zl $(CFLAGS)
31 LDFLAGS=/noi/e/st:0x1500/noe/farcall/packcode
32 # "/farcall/packcode" are only useful for `large code' memory models
33 # but should be a "no-op" for small code models.
38 OBJ1 = adler32$(O) compress$(O) crc32$(O) gzio$(O) uncompr$(O) deflate$(O) \
40 OBJP1 = adler32$(O)+compress$(O)+crc32$(O)+gzio$(O)+uncompr$(O)+deflate$(O)+\
42 OBJ2 = zutil$(O) inflate$(O) infblock$(O) inftrees$(O) infcodes$(O) \
43 infutil$(O) inffast$(O)
44 OBJP2 = zutil$(O)+inflate$(O)+infblock$(O)+inftrees$(O)+infcodes$(O)+\
45 infutil$(O)+inffast$(O)
47 ZLIB_H = zlib.h zconf.h
48 ZUTIL_H = zutil.h $(ZLIB_H)
50 ZLIB_LIB = zlib_$(MODEL).lib
52 all: $(ZLIB_LIB) example.exe minigzip.exe
54 # individual dependencies and action rules:
55 adler32.obj: adler32.c $(ZLIB_H)
56 $(CC) -c $(LIB_CFLAGS) $*.c
58 compress.obj: compress.c $(ZLIB_H)
59 $(CC) -c $(LIB_CFLAGS) $*.c
61 crc32.obj: crc32.c $(ZLIB_H)
62 $(CC) -c $(LIB_CFLAGS) $*.c
64 deflate.obj: deflate.c deflate.h $(ZUTIL_H)
65 $(CC) -c $(LIB_CFLAGS) $*.c
67 gzio.obj: gzio.c $(ZUTIL_H)
68 $(CC) -c $(LIB_CFLAGS) $*.c
70 infblock.obj: infblock.c $(ZUTIL_H) infblock.h inftrees.h infcodes.h infutil.h
71 $(CC) -c $(LIB_CFLAGS) $*.c
73 infcodes.obj: infcodes.c $(ZUTIL_H) inftrees.h infutil.h infcodes.h inffast.h
74 $(CC) -c $(LIB_CFLAGS) $*.c
76 inflate.obj: inflate.c $(ZUTIL_H) infblock.h
77 $(CC) -c $(LIB_CFLAGS) $*.c
79 inftrees.obj: inftrees.c $(ZUTIL_H) inftrees.h
80 $(CC) -c $(LIB_CFLAGS) $*.c
82 infutil.obj: infutil.c $(ZUTIL_H) inftrees.h infutil.h
83 $(CC) -c $(LIB_CFLAGS) $*.c
85 inffast.obj: inffast.c $(ZUTIL_H) inftrees.h infutil.h inffast.h
86 $(CC) -c $(LIB_CFLAGS) $*.c
88 trees.obj: trees.c deflate.h $(ZUTIL_H)
89 $(CC) -c $(LIB_CFLAGS) $*.c
91 uncompr.obj: uncompr.c $(ZLIB_H)
92 $(CC) -c $(LIB_CFLAGS) $*.c
94 zutil.obj: zutil.c $(ZUTIL_H)
95 $(CC) -c $(LIB_CFLAGS) $*.c
97 example.obj: example.c $(ZLIB_H)
98 $(CC) -c $(CFLAGS) $*.c
100 minigzip.obj: minigzip.c $(ZLIB_H)
101 $(CC) -c $(CFLAGS) $*.c
103 # we must cut the command line to fit in the MS/DOS 128 byte limit:
104 $(ZLIB_LIB): $(OBJ1) $(OBJ2)
105 if exist $(ZLIB_LIB) del $(ZLIB_LIB)
106 lib $(ZLIB_LIB) $(OBJ1);
107 lib $(ZLIB_LIB) $(OBJ2);
109 example.exe: example.obj $(ZLIB_LIB)
110 $(LD) $(LDFLAGS) example.obj,,,$(ZLIB_LIB);
112 minigzip.exe: minigzip.obj $(ZLIB_LIB)
113 $(LD) $(LDFLAGS) minigzip.obj,,,$(ZLIB_LIB);
115 test: example.exe minigzip.exe
117 echo hello world | minigzip | minigzip -d