2011-09-10 06:21:57 +00:00
|
|
|
# Makefile for zlib
|
|
|
|
# Turbo C 2.01, Turbo C++ 1.01
|
2011-09-10 06:22:37 +00:00
|
|
|
# Last updated: 15-Mar-2003
|
2011-09-10 06:21:57 +00:00
|
|
|
|
|
|
|
# To use, do "make -fmakefile.tc"
|
|
|
|
# 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:
|
|
|
|
# -DMAX_MEM_LEVEL=7 -DMAX_WBITS=14
|
|
|
|
# See zconf.h for details about the memory requirements.
|
|
|
|
|
|
|
|
# ------------ 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
|
|
|
|
ZLIB_LIB = zlib_$(MODEL).lib
|
|
|
|
|
2011-09-10 06:27:26 +00:00
|
|
|
OBJ1 = adler32.obj compress.obj crc32.obj deflate.obj gzclose.obj gzlib.obj gzread.obj
|
2011-09-10 06:26:49 +00:00
|
|
|
OBJ2 = gzwrite.obj infback.obj inffast.obj inflate.obj inftrees.obj trees.obj uncompr.obj zutil.obj
|
2011-09-10 06:27:26 +00:00
|
|
|
OBJP1 = +adler32.obj+compress.obj+crc32.obj+deflate.obj+gzclose.obj+gzlib.obj+gzread.obj
|
2011-09-10 06:26:49 +00:00
|
|
|
OBJP2 = +gzwrite.obj+infback.obj+inffast.obj+inflate.obj+inftrees.obj+trees.obj+uncompr.obj+zutil.obj
|
2011-09-10 06:21:57 +00:00
|
|
|
|
|
|
|
|
|
|
|
# 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
|
|
|
|
|
|
|
|
crc32.obj: crc32.c zlib.h zconf.h crc32.h
|
|
|
|
|
|
|
|
deflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h
|
|
|
|
|
2011-09-10 06:26:49 +00:00
|
|
|
gzclose.obj: gzclose.c zlib.h zconf.h gzguts.h
|
|
|
|
|
|
|
|
gzlib.obj: gzlib.c zlib.h zconf.h gzguts.h
|
|
|
|
|
|
|
|
gzread.obj: gzread.c zlib.h zconf.h gzguts.h
|
|
|
|
|
|
|
|
gzwrite.obj: gzwrite.c zlib.h zconf.h gzguts.h
|
|
|
|
|
2011-09-10 06:21:57 +00:00
|
|
|
infback.obj: infback.c zutil.h zlib.h zconf.h inftrees.h inflate.h \
|
|
|
|
inffast.h inffixed.h
|
|
|
|
|
|
|
|
inffast.obj: inffast.c zutil.h zlib.h zconf.h inftrees.h inflate.h \
|
|
|
|
inffast.h
|
|
|
|
|
|
|
|
inflate.obj: inflate.c zutil.h zlib.h zconf.h inftrees.h inflate.h \
|
|
|
|
inffast.h inffixed.h
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
|
zutil.obj: zutil.c zutil.h zlib.h zconf.h
|
|
|
|
|
2011-11-22 02:56:02 +00:00
|
|
|
example.obj: test/example.c zlib.h zconf.h
|
2011-09-10 06:21:57 +00:00
|
|
|
|
2011-11-22 02:56:02 +00:00
|
|
|
minigzip.obj: test/minigzip.c zlib.h zconf.h
|
2011-09-10 06:21:57 +00:00
|
|
|
|
|
|
|
|
|
|
|
# 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) example.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 *.lib
|
2011-09-10 06:22:37 +00:00
|
|
|
-del *.exe
|
|
|
|
-del zlib_*.bak
|
2011-09-10 06:21:57 +00:00
|
|
|
-del foo.gz
|