kusano fc6ab3
# Makefile for zlib
kusano fc6ab3
# Borland C++ for Win32
kusano fc6ab3
#
kusano fc6ab3
# Usage:
kusano fc6ab3
#  make -f win32/Makefile.bor
kusano fc6ab3
#  make -f win32/Makefile.bor LOCAL_ZLIB=-DASMV OBJA=match.obj OBJPA=+match.obj
kusano fc6ab3
kusano fc6ab3
# ------------ Borland C++ ------------
kusano fc6ab3
kusano fc6ab3
# Optional nonstandard preprocessor flags (e.g. -DMAX_MEM_LEVEL=7)
kusano fc6ab3
# should be added to the environment via "set LOCAL_ZLIB=-DFOO" or
kusano fc6ab3
# added to the declaration of LOC here:
kusano fc6ab3
LOC = $(LOCAL_ZLIB)
kusano fc6ab3
kusano fc6ab3
CC = bcc32
kusano fc6ab3
AS = bcc32
kusano fc6ab3
LD = bcc32
kusano fc6ab3
AR = tlib
kusano fc6ab3
CFLAGS  = -a -d -k- -O2 $(LOC)
kusano fc6ab3
ASFLAGS = $(LOC)
kusano fc6ab3
LDFLAGS = $(LOC)
kusano fc6ab3
kusano fc6ab3
kusano fc6ab3
# variables
kusano fc6ab3
ZLIB_LIB = zlib.lib
kusano fc6ab3
kusano fc6ab3
OBJ1 = adler32.obj compress.obj crc32.obj deflate.obj gzclose.obj gzlib.obj gzread.obj
kusano fc6ab3
OBJ2 = gzwrite.obj infback.obj inffast.obj inflate.obj inftrees.obj trees.obj uncompr.obj zutil.obj
kusano fc6ab3
#OBJA =
kusano fc6ab3
OBJP1 = +adler32.obj+compress.obj+crc32.obj+deflate.obj+gzclose.obj+gzlib.obj+gzread.obj
kusano fc6ab3
OBJP2 = +gzwrite.obj+infback.obj+inffast.obj+inflate.obj+inftrees.obj+trees.obj+uncompr.obj+zutil.obj
kusano fc6ab3
#OBJPA=
kusano fc6ab3
kusano fc6ab3
kusano fc6ab3
# targets
kusano fc6ab3
all: $(ZLIB_LIB) example.exe minigzip.exe
kusano fc6ab3
kusano fc6ab3
.c.obj:
kusano fc6ab3
	$(CC) -c $(CFLAGS) $<
kusano fc6ab3
kusano fc6ab3
.asm.obj:
kusano fc6ab3
	$(AS) -c $(ASFLAGS) $<
kusano fc6ab3
kusano fc6ab3
adler32.obj: adler32.c zlib.h zconf.h
kusano fc6ab3
kusano fc6ab3
compress.obj: compress.c zlib.h zconf.h
kusano fc6ab3
kusano fc6ab3
crc32.obj: crc32.c zlib.h zconf.h crc32.h
kusano fc6ab3
kusano fc6ab3
deflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h
kusano fc6ab3
kusano fc6ab3
gzclose.obj: gzclose.c zlib.h zconf.h gzguts.h
kusano fc6ab3
kusano fc6ab3
gzlib.obj: gzlib.c zlib.h zconf.h gzguts.h
kusano fc6ab3
kusano fc6ab3
gzread.obj: gzread.c zlib.h zconf.h gzguts.h
kusano fc6ab3
kusano fc6ab3
gzwrite.obj: gzwrite.c zlib.h zconf.h gzguts.h
kusano fc6ab3
kusano fc6ab3
infback.obj: infback.c zutil.h zlib.h zconf.h inftrees.h inflate.h \
kusano fc6ab3
 inffast.h inffixed.h
kusano fc6ab3
kusano fc6ab3
inffast.obj: inffast.c zutil.h zlib.h zconf.h inftrees.h inflate.h \
kusano fc6ab3
 inffast.h
kusano fc6ab3
kusano fc6ab3
inflate.obj: inflate.c zutil.h zlib.h zconf.h inftrees.h inflate.h \
kusano fc6ab3
 inffast.h inffixed.h
kusano fc6ab3
kusano fc6ab3
inftrees.obj: inftrees.c zutil.h zlib.h zconf.h inftrees.h
kusano fc6ab3
kusano fc6ab3
trees.obj: trees.c zutil.h zlib.h zconf.h deflate.h trees.h
kusano fc6ab3
kusano fc6ab3
uncompr.obj: uncompr.c zlib.h zconf.h
kusano fc6ab3
kusano fc6ab3
zutil.obj: zutil.c zutil.h zlib.h zconf.h
kusano fc6ab3
kusano fc6ab3
example.obj: test/example.c zlib.h zconf.h
kusano fc6ab3
kusano fc6ab3
minigzip.obj: test/minigzip.c zlib.h zconf.h
kusano fc6ab3
kusano fc6ab3
kusano fc6ab3
# For the sake of the old Borland make,
kusano fc6ab3
# the command line is cut to fit in the MS-DOS 128 byte limit:
kusano fc6ab3
$(ZLIB_LIB): $(OBJ1) $(OBJ2) $(OBJA)
kusano fc6ab3
	-del $(ZLIB_LIB)
kusano fc6ab3
	$(AR) $(ZLIB_LIB) $(OBJP1)
kusano fc6ab3
	$(AR) $(ZLIB_LIB) $(OBJP2)
kusano fc6ab3
	$(AR) $(ZLIB_LIB) $(OBJPA)
kusano fc6ab3
kusano fc6ab3
kusano fc6ab3
# testing
kusano fc6ab3
test: example.exe minigzip.exe
kusano fc6ab3
	example
kusano fc6ab3
	echo hello world | minigzip | minigzip -d
kusano fc6ab3
kusano fc6ab3
example.exe: example.obj $(ZLIB_LIB)
kusano fc6ab3
	$(LD) $(LDFLAGS) example.obj $(ZLIB_LIB)
kusano fc6ab3
kusano fc6ab3
minigzip.exe: minigzip.obj $(ZLIB_LIB)
kusano fc6ab3
	$(LD) $(LDFLAGS) minigzip.obj $(ZLIB_LIB)
kusano fc6ab3
kusano fc6ab3
kusano fc6ab3
# cleanup
kusano fc6ab3
clean:
kusano fc6ab3
	-del $(ZLIB_LIB)
kusano fc6ab3
	-del *.obj
kusano fc6ab3
	-del *.exe
kusano fc6ab3
	-del *.tds
kusano fc6ab3
	-del zlib.bak
kusano fc6ab3
	-del foo.gz