# Makefile for zlib
-# TurboC 2.0
+# Turbo C 2.01, Turbo C++ 1.01
+# Last updated: 15-Mar-2003
# To use, do "make -fmakefile.tc"
-# To compile in small model, set below: MODEL=-ms
+# To compile in small model, set below: MODEL=s
# WARNING: the small model is supported but only for small values of
# MAX_WBITS and MAX_MEM_LEVEL. For example:
# -DMAX_WBITS=11 -DMAX_MEM_LEVEL=3
# If you wish to reduce the memory requirements (default 256K for big
-# objects plus a few K), you can add to CFLAGS below:
+# objects plus a few K), you can add to CFLAGS below:
# -DMAX_MEM_LEVEL=7 -DMAX_WBITS=14
# See zconf.h for details about the memory requirements.
-# ------------- Turbo C 2.0 -------------
-MODEL=-ml
-# CFLAGS=-O2 -G -Z $(MODEL) -DMAX_WBITS=11 -DMAX_MEM_LEVEL=3
-CFLAGS=-O2 -G -Z $(MODEL)
-CC=tcc -I\tc\include
-LD=tcc -L\tc\lib
-LIB=tlib
-LDFLAGS=$(MODEL) -f-
-O=.obj
+# ------------ Turbo C 2.01, Turbo C++ 1.01 ------------
+MODEL=l
+CC=tcc
+LD=tcc
+AR=tlib
+# CFLAGS=-O2 -G -Z -m$(MODEL) -DMAX_WBITS=11 -DMAX_MEM_LEVEL=3
+CFLAGS=-O2 -G -Z -m$(MODEL)
+LDFLAGS=-m$(MODEL) -f-
+
# variables
-OBJ1 = adler32$(O) compress$(O) crc32$(O) gzio$(O) uncompr$(O) deflate$(O) \
- trees$(O)
-OBJP1 = adler32$(O)+compress$(O)+crc32$(O)+gzio$(O)+uncompr$(O)+deflate$(O)+\
- trees$(O)
-OBJ2 = zutil$(O) inflate$(O) infblock$(O) inftrees$(O) infcodes$(O) \
- infutil$(O) inffast$(O)
-OBJP2 = zutil$(O)+inflate$(O)+infblock$(O)+inftrees$(O)+infcodes$(O)+\
- infutil$(O)+inffast$(O)
-
-all: test
-
-adler32.obj: adler32.c zutil.h zlib.h zconf.h
+ZLIB_LIB = zlib_$(MODEL).lib
+
+OBJ1 = adler32.obj compress.obj crc32.obj deflate.obj gzclose.obj gzlib.obj gzread.obj
+OBJ2 = gzwrite.obj infback.obj inffast.obj inflate.obj inftrees.obj trees.obj uncompr.obj zutil.obj
+OBJP1 = +adler32.obj+compress.obj+crc32.obj+deflate.obj+gzclose.obj+gzlib.obj+gzread.obj
+OBJP2 = +gzwrite.obj+infback.obj+inffast.obj+inflate.obj+inftrees.obj+trees.obj+uncompr.obj+zutil.obj
+
+
+# targets
+all: $(ZLIB_LIB) example.exe minigzip.exe
+
+.c.obj:
$(CC) -c $(CFLAGS) $*.c
+adler32.obj: adler32.c zlib.h zconf.h
+
compress.obj: compress.c zlib.h zconf.h
- $(CC) -c $(CFLAGS) $*.c
-crc32.obj: crc32.c zutil.h zlib.h zconf.h
- $(CC) -c $(CFLAGS) $*.c
+crc32.obj: crc32.c zlib.h zconf.h crc32.h
deflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h
- $(CC) -c $(CFLAGS) $*.c
-gzio.obj: gzio.c zutil.h zlib.h zconf.h
- $(CC) -c $(CFLAGS) $*.c
+gzclose.obj: gzclose.c zlib.h zconf.h gzguts.h
-infblock.obj: infblock.c zutil.h zlib.h zconf.h infblock.h inftrees.h\
- infcodes.h infutil.h
- $(CC) -c $(CFLAGS) $*.c
+gzlib.obj: gzlib.c zlib.h zconf.h gzguts.h
-infcodes.obj: infcodes.c zutil.h zlib.h zconf.h inftrees.h infutil.h\
- infcodes.h inffast.h
- $(CC) -c $(CFLAGS) $*.c
+gzread.obj: gzread.c zlib.h zconf.h gzguts.h
-inflate.obj: inflate.c zutil.h zlib.h zconf.h infblock.h
- $(CC) -c $(CFLAGS) $*.c
+gzwrite.obj: gzwrite.c zlib.h zconf.h gzguts.h
-inftrees.obj: inftrees.c zutil.h zlib.h zconf.h inftrees.h
- $(CC) -c $(CFLAGS) $*.c
+infback.obj: infback.c zutil.h zlib.h zconf.h inftrees.h inflate.h \
+ inffast.h inffixed.h
-infutil.obj: infutil.c zutil.h zlib.h zconf.h inftrees.h infutil.h
- $(CC) -c $(CFLAGS) $*.c
+inffast.obj: inffast.c zutil.h zlib.h zconf.h inftrees.h inflate.h \
+ inffast.h
-inffast.obj: inffast.c zutil.h zlib.h zconf.h inftrees.h infutil.h inffast.h
- $(CC) -c $(CFLAGS) $*.c
+inflate.obj: inflate.c zutil.h zlib.h zconf.h inftrees.h inflate.h \
+ inffast.h inffixed.h
-trees.obj: trees.c deflate.h zutil.h zlib.h zconf.h
- $(CC) -c $(CFLAGS) $*.c
+inftrees.obj: inftrees.c zutil.h zlib.h zconf.h inftrees.h
+
+trees.obj: trees.c zutil.h zlib.h zconf.h deflate.h trees.h
uncompr.obj: uncompr.c zlib.h zconf.h
- $(CC) -c $(CFLAGS) $*.c
zutil.obj: zutil.c zutil.h zlib.h zconf.h
- $(CC) -c $(CFLAGS) $*.c
-example.obj: example.c zlib.h zconf.h
- $(CC) -c $(CFLAGS) $*.c
+example.obj: test/example.c zlib.h zconf.h
+
+minigzip.obj: test/minigzip.c zlib.h zconf.h
-minigzip.obj: minigzip.c zlib.h zconf.h
- $(CC) -c $(CFLAGS) $*.c
-# we must cut the command line to fit in the MS/DOS 128 byte limit:
-zlib.lib: $(OBJ1) $(OBJ2)
- del zlib.lib
- $(LIB) zlib +$(OBJP1)
- $(LIB) zlib +$(OBJP2)
+# the command line is cut to fit in the MS-DOS 128 byte limit:
+$(ZLIB_LIB): $(OBJ1) $(OBJ2)
+ -del $(ZLIB_LIB)
+ $(AR) $(ZLIB_LIB) $(OBJP1)
+ $(AR) $(ZLIB_LIB) $(OBJP2)
-example.exe: example.obj zlib.lib
- $(LD) $(LDFLAGS) -eexample.exe example.obj zlib.lib
+example.exe: example.obj $(ZLIB_LIB)
+ $(LD) $(LDFLAGS) example.obj $(ZLIB_LIB)
-minigzip.exe: minigzip.obj zlib.lib
- $(LD) $(LDFLAGS) -eminigzip.exe minigzip.obj zlib.lib
+minigzip.exe: minigzip.obj $(ZLIB_LIB)
+ $(LD) $(LDFLAGS) minigzip.obj $(ZLIB_LIB)
test: example.exe minigzip.exe
example
- echo hello world | minigzip | minigzip -d
-
-#clean:
-# del *.obj
-# del *.exe
+ echo hello world | minigzip | minigzip -d
+
+clean:
+ -del *.obj
+ -del *.lib
+ -del *.exe
+ -del zlib_*.bak
+ -del foo.gz