2
# Borland C++ ************ UNTESTED ***********
4
# To use, do "make -fmakefile.bor"
5
# To compile in small model, set below: MODEL=s
7
# WARNING: the small model is supported but only for small values of
8
# MAX_WBITS and MAX_MEM_LEVEL. For example:
9
# -DMAX_WBITS=11 -DDEF_WBITS=11 -DMAX_MEM_LEVEL=3
10
# If you wish to reduce the memory requirements (default 256K for big
11
# objects plus a few K), you can add to the LOC macro below:
12
# -DMAX_MEM_LEVEL=7 -DMAX_WBITS=14
13
# See zconf.h for details about the memory requirements.
15
# ------------- Turbo C++, Borland C++ -------------
17
# Optional nonstandard preprocessor flags (e.g. -DMAX_MEM_LEVEL=7)
18
# should be added to the environment via "set LOCAL_ZLIB=-DFOO" or added
19
# to the declaration of LOC here:
22
# Type for CPU required: 0: 8086, 1: 80186, 2: 80286, 3: 80386, etc.
25
# 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
34
CFLAGS=-O2 -Z -m$(MODEL) $(LOC)
35
# replace "-O2" by "-O -G -a -d" for Turbo C++ 1.0
42
OBJ1 = adler32$(O) compress$(O) crc32$(O) gzio$(O) uncompr$(O) deflate$(O) \
44
OBJP1 = adler32$(O)+compress$(O)+crc32$(O)+gzio$(O)+uncompr$(O)+deflate$(O)+\
46
OBJ2 = zutil$(O) inflate$(O) infblock$(O) inftrees$(O) infcodes$(O) \
47
infutil$(O) inffast$(O)
48
OBJP2 = zutil$(O)+inflate$(O)+infblock$(O)+inftrees$(O)+infcodes$(O)+\
49
infutil$(O)+inffast$(O)
51
ZLIB_H = zlib.h zconf.h
52
ZUTIL_H = zutil.h $(ZLIB_H)
54
ZLIB_LIB = zlib_$(MODEL).lib
58
# individual dependencies and action rules:
59
adler32.obj: adler32.c $(ZLIB_H)
60
$(CC) -c $(CFLAGS) $*.c
62
compress.obj: compress.c $(ZLIB_H)
63
$(CC) -c $(CFLAGS) $*.c
65
crc32.obj: crc32.c $(ZLIB_H)
66
$(CC) -c $(CFLAGS) $*.c
68
deflate.obj: deflate.c deflate.h $(ZUTIL_H)
69
$(CC) -c $(CFLAGS) $*.c
71
gzio.obj: gzio.c $(ZUTIL_H)
72
$(CC) -c $(CFLAGS) $*.c
74
infblock.obj: infblock.c $(ZUTIL_H) infblock.h inftrees.h infcodes.h infutil.h
75
$(CC) -c $(CFLAGS) $*.c
77
infcodes.obj: infcodes.c $(ZUTIL_H) inftrees.h infutil.h infcodes.h inffast.h
78
$(CC) -c $(CFLAGS) $*.c
80
inflate.obj: inflate.c $(ZUTIL_H) infblock.h
81
$(CC) -c $(CFLAGS) $*.c
83
inftrees.obj: inftrees.c $(ZUTIL_H) inftrees.h
84
$(CC) -c $(CFLAGS) $*.c
86
infutil.obj: infutil.c $(ZUTIL_H) inftrees.h infutil.h
87
$(CC) -c $(CFLAGS) $*.c
89
inffast.obj: inffast.c $(ZUTIL_H) inftrees.h infutil.h inffast.h
90
$(CC) -c $(CFLAGS) $*.c
92
trees.obj: trees.c deflate.h $(ZUTIL_H)
93
$(CC) -c $(CFLAGS) $*.c
95
uncompr.obj: uncompr.c $(ZLIB_H)
96
$(CC) -c $(CFLAGS) $*.c
98
zutil.obj: zutil.c $(ZUTIL_H)
99
$(CC) -c $(CFLAGS) $*.c
101
example.obj: example.c $(ZLIB_H)
102
$(CC) -c $(CFLAGS) $*.c
104
minigzip.obj: minigzip.c $(ZLIB_H)
105
$(CC) -c $(CFLAGS) $*.c
107
# we must cut the command line to fit in the MS/DOS 128 byte limit:
108
$(ZLIB_LIB): $(OBJ1) $(OBJ2)
110
$(AR) $(ZLIB_LIB) +$(OBJP1)
111
$(AR) $(ZLIB_LIB) +$(OBJP2)
113
example.exe: example.obj $(ZLIB_LIB)
114
$(LD) $(LDFLAGS) example.obj $(ZLIB_LIB)
116
minigzip.exe: minigzip.obj $(ZLIB_LIB)
117
$(LD) $(LDFLAGS) minigzip.obj $(ZLIB_LIB)
119
test: example.exe minigzip.exe
121
echo hello world | minigzip | minigzip -d