|
kusano |
fc6ab3 |
# Makefile for zlib
|
|
kusano |
fc6ab3 |
# For use with Delphi and C++ Builder under Win32
|
|
kusano |
fc6ab3 |
# Updated for zlib 1.2.x by Cosmin Truta
|
|
kusano |
fc6ab3 |
|
|
kusano |
fc6ab3 |
# ------------ Borland C++ ------------
|
|
kusano |
fc6ab3 |
|
|
kusano |
fc6ab3 |
# This project uses the Delphi (fastcall/register) calling convention:
|
|
kusano |
fc6ab3 |
LOC = -DZEXPORT=__fastcall -DZEXPORTVA=__cdecl
|
|
kusano |
fc6ab3 |
|
|
kusano |
fc6ab3 |
CC = bcc32
|
|
kusano |
fc6ab3 |
LD = bcc32
|
|
kusano |
fc6ab3 |
AR = tlib
|
|
kusano |
fc6ab3 |
# do not use "-pr" in CFLAGS
|
|
kusano |
fc6ab3 |
CFLAGS = -a -d -k- -O2 $(LOC)
|
|
kusano |
fc6ab3 |
LDFLAGS =
|
|
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 |
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 |
|
|
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) $*.c
|
|
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)
|
|
kusano |
fc6ab3 |
-del $(ZLIB_LIB)
|
|
kusano |
fc6ab3 |
$(AR) $(ZLIB_LIB) $(OBJP1)
|
|
kusano |
fc6ab3 |
$(AR) $(ZLIB_LIB) $(OBJP2)
|
|
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 *.obj
|
|
kusano |
fc6ab3 |
-del *.exe
|
|
kusano |
fc6ab3 |
-del *.lib
|
|
kusano |
fc6ab3 |
-del *.tds
|
|
kusano |
fc6ab3 |
-del zlib.bak
|
|
kusano |
fc6ab3 |
-del foo.gz
|
|
kusano |
fc6ab3 |
|