10
|
1 # Makefile for zlib
|
|
2 # TurboC 2.0
|
|
3
|
|
4 # To use, do "make -fmakefile.tc"
|
|
5
|
|
6 # WARNING: the small model is supported but only for small values of
|
|
7 # MAX_WBITS and MAX_MEM_LEVEL. If you wish to reduce the memory
|
|
8 # requirements (default 256K for big objects plus a few K), you can add
|
|
9 # to CFLAGS below: -DMAX_MEM_LEVEL=7 -DMAX_WBITS=14
|
|
10 # See zconf.h for details about the memory requirements.
|
|
11
|
|
12 # ------------- Turbo C 2.0 -------------
|
|
13 MODEL=-ml
|
|
14 CFLAGS=-O2 -Z $(MODEL)
|
|
15 CC=tcc
|
|
16 LD=tcc
|
|
17 LIB=tlib
|
|
18 LDFLAGS=$(MODEL)
|
|
19 O=.obj
|
|
20
|
|
21 # variables
|
|
22 OBJ1 = adler32$(O) compress$(O) crc32$(O) gzio$(O) uncompr$(O) deflate$(O) \
|
|
23 trees$(O)
|
|
24 OBJP1 = adler32$(O)+compress$(O)+crc32$(O)+gzio$(O)+uncompr$(O)+deflate$(O)+\
|
|
25 trees$(O)
|
|
26 OBJ2 = zutil$(O) inflate$(O) infblock$(O) inftrees$(O) infcodes$(O) \
|
|
27 infutil$(O) inffast$(O)
|
|
28 OBJP2 = zutil$(O)+inflate$(O)+infblock$(O)+inftrees$(O)+infcodes$(O)+\
|
|
29 infutil$(O)+inffast$(O)
|
|
30
|
|
31 all: test
|
|
32
|
|
33 adler32.obj: adler32.c zutil.h zlib.h zconf.h
|
|
34 $(CC) -c $(CFLAGS) $*.c
|
|
35
|
|
36 compress.obj: compress.c zlib.h zconf.h
|
|
37 $(CC) -c $(CFLAGS) $*.c
|
|
38
|
|
39 crc32.obj: crc32.c zutil.h zlib.h zconf.h
|
|
40 $(CC) -c $(CFLAGS) $*.c
|
|
41
|
|
42 deflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h
|
|
43 $(CC) -c $(CFLAGS) $*.c
|
|
44
|
|
45 gzio.obj: gzio.c zutil.h zlib.h zconf.h
|
|
46 $(CC) -c $(CFLAGS) $*.c
|
|
47
|
|
48 infblock.obj: infblock.c zutil.h zlib.h zconf.h infblock.h inftrees.h\
|
|
49 infcodes.h infutil.h
|
|
50 $(CC) -c $(CFLAGS) $*.c
|
|
51
|
|
52 infcodes.obj: infcodes.c zutil.h zlib.h zconf.h inftrees.h infutil.h\
|
|
53 infcodes.h inffast.h
|
|
54 $(CC) -c $(CFLAGS) $*.c
|
|
55
|
|
56 inflate.obj: inflate.c zutil.h zlib.h zconf.h infblock.h
|
|
57 $(CC) -c $(CFLAGS) $*.c
|
|
58
|
|
59 inftrees.obj: inftrees.c zutil.h zlib.h zconf.h inftrees.h
|
|
60 $(CC) -c $(CFLAGS) $*.c
|
|
61
|
|
62 infutil.obj: infutil.c zutil.h zlib.h zconf.h inftrees.h infutil.h
|
|
63 $(CC) -c $(CFLAGS) $*.c
|
|
64
|
|
65 inffast.obj: inffast.c zutil.h zlib.h zconf.h inftrees.h infutil.h inffast.h
|
|
66 $(CC) -c $(CFLAGS) $*.c
|
|
67
|
|
68 trees.obj: trees.c deflate.h zutil.h zlib.h zconf.h
|
|
69 $(CC) -c $(CFLAGS) $*.c
|
|
70
|
|
71 uncompr.obj: uncompr.c zlib.h zconf.h
|
|
72 $(CC) -c $(CFLAGS) $*.c
|
|
73
|
|
74 zutil.obj: zutil.c zutil.h zlib.h zconf.h
|
|
75 $(CC) -c $(CFLAGS) $*.c
|
|
76
|
|
77 example.obj: example.c zlib.h zconf.h
|
|
78 $(CC) -c $(CFLAGS) $*.c
|
|
79
|
|
80 minigzip.obj: minigzip.c zlib.h zconf.h
|
|
81 $(CC) -c $(CFLAGS) $*.c
|
|
82
|
|
83 # we must cut the command line to fit in the MS/DOS 128 byte limit:
|
|
84 zlib.lib: $(OBJ1) $(OBJ2)
|
|
85 $(LIB) zlib +$(OBJP1)
|
|
86 $(LIB) zlib +$(OBJP2)
|
|
87
|
|
88 example.exe: example.obj zlib.lib
|
|
89 $(LD) $(LDFLAGS) -eexample.exe example.obj zlib.lib
|
|
90
|
|
91 minigzip.exe: minigzip.obj zlib.lib
|
|
92 $(LD) $(LDFLAGS) -eminigzip.exe minigzip.obj zlib.lib
|
|
93
|
|
94 test: example.exe minigzip.exe
|
|
95 example
|
|
96 echo hello world | minigzip | minigzip -d
|
|
97
|
|
98 #clean:
|
|
99 # del *.obj
|
|
100 # del *.exe
|