1# Makefile for zlib 2# Borland C++ for Win32 3# 4# Usage: 5# make -f win32/Makefile.bor 6 7# ------------ Borland C++ ------------ 8 9# Optional nonstandard preprocessor flags (e.g. -DMAX_MEM_LEVEL=7) 10# should be added to the environment via "set LOCAL_ZLIB=-DFOO" or 11# added to the declaration of LOC here: 12LOC = $(LOCAL_ZLIB) 13 14CC = bcc32 15AS = bcc32 16LD = bcc32 17AR = tlib 18CFLAGS = -a -d -k- -O2 $(LOC) 19ASFLAGS = $(LOC) 20LDFLAGS = $(LOC) 21 22 23# variables 24ZLIB_LIB = zlib.lib 25 26OBJ1 = adler32.obj compress.obj crc32.obj deflate.obj gzclose.obj gzlib.obj gzread.obj 27OBJ2 = gzwrite.obj infback.obj inffast.obj inflate.obj inftrees.obj trees.obj uncompr.obj zutil.obj 28#OBJA = 29OBJP1 = +adler32.obj+compress.obj+crc32.obj+deflate.obj+gzclose.obj+gzlib.obj+gzread.obj 30OBJP2 = +gzwrite.obj+infback.obj+inffast.obj+inflate.obj+inftrees.obj+trees.obj+uncompr.obj+zutil.obj 31#OBJPA= 32 33 34# targets 35all: $(ZLIB_LIB) example.exe minigzip.exe 36 37.c.obj: 38 $(CC) -c $(CFLAGS) $< 39 40.asm.obj: 41 $(AS) -c $(ASFLAGS) $< 42 43adler32.obj: adler32.c zlib.h zconf.h 44 45compress.obj: compress.c zlib.h zconf.h 46 47crc32.obj: crc32.c zlib.h zconf.h crc32.h 48 49deflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h 50 51gzclose.obj: gzclose.c zlib.h zconf.h gzguts.h 52 53gzlib.obj: gzlib.c zlib.h zconf.h gzguts.h 54 55gzread.obj: gzread.c zlib.h zconf.h gzguts.h 56 57gzwrite.obj: gzwrite.c zlib.h zconf.h gzguts.h 58 59infback.obj: infback.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ 60 inffast.h inffixed.h 61 62inffast.obj: inffast.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ 63 inffast.h 64 65inflate.obj: inflate.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ 66 inffast.h inffixed.h 67 68inftrees.obj: inftrees.c zutil.h zlib.h zconf.h inftrees.h 69 70trees.obj: trees.c zutil.h zlib.h zconf.h deflate.h trees.h 71 72uncompr.obj: uncompr.c zlib.h zconf.h 73 74zutil.obj: zutil.c zutil.h zlib.h zconf.h 75 76example.obj: test/example.c zlib.h zconf.h 77 78minigzip.obj: test/minigzip.c zlib.h zconf.h 79 80 81# For the sake of the old Borland make, 82# the command line is cut to fit in the MS-DOS 128 byte limit: 83$(ZLIB_LIB): $(OBJ1) $(OBJ2) $(OBJA) 84 -del $(ZLIB_LIB) 85 $(AR) $(ZLIB_LIB) $(OBJP1) 86 $(AR) $(ZLIB_LIB) $(OBJP2) 87 $(AR) $(ZLIB_LIB) $(OBJPA) 88 89 90# testing 91test: example.exe minigzip.exe 92 example 93 echo hello world | minigzip | minigzip -d 94 95example.exe: example.obj $(ZLIB_LIB) 96 $(LD) $(LDFLAGS) example.obj $(ZLIB_LIB) 97 98minigzip.exe: minigzip.obj $(ZLIB_LIB) 99 $(LD) $(LDFLAGS) minigzip.obj $(ZLIB_LIB) 100 101 102# cleanup 103clean: 104 -del $(ZLIB_LIB) 105 -del *.obj 106 -del *.exe 107 -del *.tds 108 -del zlib.bak 109 -del foo.gz 110