3 # Last updated: 15-Mar-2003
5 # To use, do "make -fmakefile.bor"
6 # To compile in small model, set below: MODEL=s
8 # WARNING: the small model is supported but only for small values of
9 # MAX_WBITS and MAX_MEM_LEVEL. For example:
10 # -DMAX_WBITS=11 -DDEF_WBITS=11 -DMAX_MEM_LEVEL=3
11 # If you wish to reduce the memory requirements (default 256K for big
12 # objects plus a few K), you can add to the LOC macro below:
13 # -DMAX_MEM_LEVEL=7 -DMAX_WBITS=14
14 # See zconf.h for details about the memory requirements.
16 # ------------ Turbo C++, Borland C++ ------------
18 # Optional nonstandard preprocessor flags (e.g. -DMAX_MEM_LEVEL=7)
19 # should be added to the environment via "set LOCAL_ZLIB=-DFOO" or added
20 # to the declaration of LOC here:
23 # type for CPU required: 0: 8086, 1: 80186, 2: 80286, 3: 80386, etc.
26 # memory model: one of s, m, c, l (small, medium, compact, large)
29 # replace bcc with tcc for Turbo C++ 1.0, with bcc32 for the 32 bit version
35 # replace "-O2" by "-O -G -a -d" for Turbo C++ 1.0
36 CFLAGS=-O2 -Z -m$(MODEL) $(LOC)
38 LDFLAGS=-m$(MODEL) -f-
42 ZLIB_LIB = zlib_$(MODEL).lib
44 OBJ1 = adler32.obj compress.obj crc32.obj deflate.obj gzclose.obj gzlib.obj gzread.obj
45 OBJ2 = gzwrite.obj infback.obj inffast.obj inflate.obj inftrees.obj trees.obj uncompr.obj zutil.obj
46 OBJP1 = +adler32.obj+compress.obj+crc32.obj+deflate.obj+gzclose.obj+gzlib.obj+gzread.obj
47 OBJP2 = +gzwrite.obj+infback.obj+inffast.obj+inflate.obj+inftrees.obj+trees.obj+uncompr.obj+zutil.obj
51 all: $(ZLIB_LIB) example.exe minigzip.exe
54 $(CC) -c $(CFLAGS) $*.c
56 adler32.obj: adler32.c zlib.h zconf.h
58 compress.obj: compress.c zlib.h zconf.h
60 crc32.obj: crc32.c zlib.h zconf.h crc32.h
62 deflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h
64 gzclose.obj: gzclose.c zlib.h zconf.h gzguts.h
66 gzlib.obj: gzlib.c zlib.h zconf.h gzguts.h
68 gzread.obj: gzread.c zlib.h zconf.h gzguts.h
70 gzwrite.obj: gzwrite.c zlib.h zconf.h gzguts.h
72 infback.obj: infback.c zutil.h zlib.h zconf.h inftrees.h inflate.h \
75 inffast.obj: inffast.c zutil.h zlib.h zconf.h inftrees.h inflate.h \
78 inflate.obj: inflate.c zutil.h zlib.h zconf.h inftrees.h inflate.h \
81 inftrees.obj: inftrees.c zutil.h zlib.h zconf.h inftrees.h
83 trees.obj: trees.c zutil.h zlib.h zconf.h deflate.h trees.h
85 uncompr.obj: uncompr.c zlib.h zconf.h
87 zutil.obj: zutil.c zutil.h zlib.h zconf.h
89 example.obj: test/example.c zlib.h zconf.h
91 minigzip.obj: test/minigzip.c zlib.h zconf.h
94 # the command line is cut to fit in the MS-DOS 128 byte limit:
95 $(ZLIB_LIB): $(OBJ1) $(OBJ2)
97 $(AR) $(ZLIB_LIB) $(OBJP1)
98 $(AR) $(ZLIB_LIB) $(OBJP2)
100 example.exe: example.obj $(ZLIB_LIB)
101 $(LD) $(LDFLAGS) example.obj $(ZLIB_LIB)
103 minigzip.exe: minigzip.obj $(ZLIB_LIB)
104 $(LD) $(LDFLAGS) minigzip.obj $(ZLIB_LIB)
106 test: example.exe minigzip.exe
108 echo hello world | minigzip | minigzip -d