Chris@4
|
1 # Makefile for zlib
|
Chris@4
|
2 # Borland C++
|
Chris@4
|
3 # Last updated: 15-Mar-2003
|
Chris@4
|
4
|
Chris@4
|
5 # To use, do "make -fmakefile.bor"
|
Chris@4
|
6 # To compile in small model, set below: MODEL=s
|
Chris@4
|
7
|
Chris@4
|
8 # WARNING: the small model is supported but only for small values of
|
Chris@4
|
9 # MAX_WBITS and MAX_MEM_LEVEL. For example:
|
Chris@4
|
10 # -DMAX_WBITS=11 -DDEF_WBITS=11 -DMAX_MEM_LEVEL=3
|
Chris@4
|
11 # If you wish to reduce the memory requirements (default 256K for big
|
Chris@4
|
12 # objects plus a few K), you can add to the LOC macro below:
|
Chris@4
|
13 # -DMAX_MEM_LEVEL=7 -DMAX_WBITS=14
|
Chris@4
|
14 # See zconf.h for details about the memory requirements.
|
Chris@4
|
15
|
Chris@4
|
16 # ------------ Turbo C++, Borland C++ ------------
|
Chris@4
|
17
|
Chris@4
|
18 # Optional nonstandard preprocessor flags (e.g. -DMAX_MEM_LEVEL=7)
|
Chris@4
|
19 # should be added to the environment via "set LOCAL_ZLIB=-DFOO" or added
|
Chris@4
|
20 # to the declaration of LOC here:
|
Chris@4
|
21 LOC = $(LOCAL_ZLIB)
|
Chris@4
|
22
|
Chris@4
|
23 # type for CPU required: 0: 8086, 1: 80186, 2: 80286, 3: 80386, etc.
|
Chris@4
|
24 CPU_TYP = 0
|
Chris@4
|
25
|
Chris@4
|
26 # memory model: one of s, m, c, l (small, medium, compact, large)
|
Chris@4
|
27 MODEL=l
|
Chris@4
|
28
|
Chris@4
|
29 # replace bcc with tcc for Turbo C++ 1.0, with bcc32 for the 32 bit version
|
Chris@4
|
30 CC=bcc
|
Chris@4
|
31 LD=bcc
|
Chris@4
|
32 AR=tlib
|
Chris@4
|
33
|
Chris@4
|
34 # compiler flags
|
Chris@4
|
35 # replace "-O2" by "-O -G -a -d" for Turbo C++ 1.0
|
Chris@4
|
36 CFLAGS=-O2 -Z -m$(MODEL) $(LOC)
|
Chris@4
|
37
|
Chris@4
|
38 LDFLAGS=-m$(MODEL) -f-
|
Chris@4
|
39
|
Chris@4
|
40
|
Chris@4
|
41 # variables
|
Chris@4
|
42 ZLIB_LIB = zlib_$(MODEL).lib
|
Chris@4
|
43
|
Chris@4
|
44 OBJ1 = adler32.obj compress.obj crc32.obj deflate.obj gzclose.obj gzlib.obj gzread.obj
|
Chris@4
|
45 OBJ2 = gzwrite.obj infback.obj inffast.obj inflate.obj inftrees.obj trees.obj uncompr.obj zutil.obj
|
Chris@4
|
46 OBJP1 = +adler32.obj+compress.obj+crc32.obj+deflate.obj+gzclose.obj+gzlib.obj+gzread.obj
|
Chris@4
|
47 OBJP2 = +gzwrite.obj+infback.obj+inffast.obj+inflate.obj+inftrees.obj+trees.obj+uncompr.obj+zutil.obj
|
Chris@4
|
48
|
Chris@4
|
49
|
Chris@4
|
50 # targets
|
Chris@4
|
51 all: $(ZLIB_LIB) example.exe minigzip.exe
|
Chris@4
|
52
|
Chris@4
|
53 .c.obj:
|
Chris@4
|
54 $(CC) -c $(CFLAGS) $*.c
|
Chris@4
|
55
|
Chris@4
|
56 adler32.obj: adler32.c zlib.h zconf.h
|
Chris@4
|
57
|
Chris@4
|
58 compress.obj: compress.c zlib.h zconf.h
|
Chris@4
|
59
|
Chris@4
|
60 crc32.obj: crc32.c zlib.h zconf.h crc32.h
|
Chris@4
|
61
|
Chris@4
|
62 deflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h
|
Chris@4
|
63
|
Chris@4
|
64 gzclose.obj: gzclose.c zlib.h zconf.h gzguts.h
|
Chris@4
|
65
|
Chris@4
|
66 gzlib.obj: gzlib.c zlib.h zconf.h gzguts.h
|
Chris@4
|
67
|
Chris@4
|
68 gzread.obj: gzread.c zlib.h zconf.h gzguts.h
|
Chris@4
|
69
|
Chris@4
|
70 gzwrite.obj: gzwrite.c zlib.h zconf.h gzguts.h
|
Chris@4
|
71
|
Chris@4
|
72 infback.obj: infback.c zutil.h zlib.h zconf.h inftrees.h inflate.h \
|
Chris@4
|
73 inffast.h inffixed.h
|
Chris@4
|
74
|
Chris@4
|
75 inffast.obj: inffast.c zutil.h zlib.h zconf.h inftrees.h inflate.h \
|
Chris@4
|
76 inffast.h
|
Chris@4
|
77
|
Chris@4
|
78 inflate.obj: inflate.c zutil.h zlib.h zconf.h inftrees.h inflate.h \
|
Chris@4
|
79 inffast.h inffixed.h
|
Chris@4
|
80
|
Chris@4
|
81 inftrees.obj: inftrees.c zutil.h zlib.h zconf.h inftrees.h
|
Chris@4
|
82
|
Chris@4
|
83 trees.obj: trees.c zutil.h zlib.h zconf.h deflate.h trees.h
|
Chris@4
|
84
|
Chris@4
|
85 uncompr.obj: uncompr.c zlib.h zconf.h
|
Chris@4
|
86
|
Chris@4
|
87 zutil.obj: zutil.c zutil.h zlib.h zconf.h
|
Chris@4
|
88
|
Chris@4
|
89 example.obj: test/example.c zlib.h zconf.h
|
Chris@4
|
90
|
Chris@4
|
91 minigzip.obj: test/minigzip.c zlib.h zconf.h
|
Chris@4
|
92
|
Chris@4
|
93
|
Chris@4
|
94 # the command line is cut to fit in the MS-DOS 128 byte limit:
|
Chris@4
|
95 $(ZLIB_LIB): $(OBJ1) $(OBJ2)
|
Chris@4
|
96 -del $(ZLIB_LIB)
|
Chris@4
|
97 $(AR) $(ZLIB_LIB) $(OBJP1)
|
Chris@4
|
98 $(AR) $(ZLIB_LIB) $(OBJP2)
|
Chris@4
|
99
|
Chris@4
|
100 example.exe: example.obj $(ZLIB_LIB)
|
Chris@4
|
101 $(LD) $(LDFLAGS) example.obj $(ZLIB_LIB)
|
Chris@4
|
102
|
Chris@4
|
103 minigzip.exe: minigzip.obj $(ZLIB_LIB)
|
Chris@4
|
104 $(LD) $(LDFLAGS) minigzip.obj $(ZLIB_LIB)
|
Chris@4
|
105
|
Chris@4
|
106 test: example.exe minigzip.exe
|
Chris@4
|
107 example
|
Chris@4
|
108 echo hello world | minigzip | minigzip -d
|
Chris@4
|
109
|
Chris@4
|
110 clean:
|
Chris@4
|
111 -del *.obj
|
Chris@4
|
112 -del *.lib
|
Chris@4
|
113 -del *.exe
|
Chris@4
|
114 -del zlib_*.bak
|
Chris@4
|
115 -del foo.gz
|