Makefile.bor 2.6 KB
Newer Older
M
Mark Adler 已提交
1 2
# Makefile for zlib
# Borland C++ for Win32
M
Mark Adler 已提交
3 4 5 6 7 8 9 10 11 12
#
# Usage:
#  make -f win32/Makefile.bor
#  make -f win32/Makefile.bor LOCAL_ZLIB=-DASMV OBJA=match.obj OBJPA=+match.obj

# ------------ Borland C++ ------------

# Optional nonstandard preprocessor flags (e.g. -DMAX_MEM_LEVEL=7)
# should be added to the environment via "set LOCAL_ZLIB=-DFOO" or
# added to the declaration of LOC here:
M
Mark Adler 已提交
13 14 15
LOC = $(LOCAL_ZLIB)

CC = bcc32
M
Mark Adler 已提交
16
AS = bcc32
M
Mark Adler 已提交
17 18
LD = bcc32
AR = tlib
M
Mark Adler 已提交
19 20
CFLAGS  = -a -d -k- -O2 $(LOC)
ASFLAGS = $(LOC)
M
Mark Adler 已提交
21 22 23 24 25 26
LDFLAGS = $(LOC)


# variables
ZLIB_LIB = zlib.lib

M
Mark Adler 已提交
27 28
OBJ1 = adler32.obj compress.obj crc32.obj deflate.obj gzclose.obj gzio.obj gzlib.obj gzread.obj
OBJ2 = gzwrite.obj infback.obj inffast.obj inflate.obj inftrees.obj trees.obj uncompr.obj zutil.obj
M
Mark Adler 已提交
29
#OBJA =
M
Mark Adler 已提交
30 31
OBJP1 = +adler32.obj+compress.obj+crc32.obj+deflate.obj+gzclose.obj+gzio.obj+gzlib.obj+gzread.obj
OBJP2 = +gzwrite.obj+infback.obj+inffast.obj+inflate.obj+inftrees.obj+trees.obj+uncompr.obj+zutil.obj
M
Mark Adler 已提交
32
#OBJPA=
M
Mark Adler 已提交
33 34 35 36 37 38


# targets
all: $(ZLIB_LIB) example.exe minigzip.exe

.c.obj:
M
Mark Adler 已提交
39 40 41 42
	$(CC) -c $(CFLAGS) $<

.asm.obj:
	$(AS) -c $(ASFLAGS) $<
M
Mark Adler 已提交
43 44 45 46 47 48 49 50 51

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

M
Mark Adler 已提交
52 53
gzclose.obj: gzclose.c zlib.h zconf.h gzguts.h

M
Mark Adler 已提交
54 55
gzio.obj: gzio.c zutil.h zlib.h zconf.h

M
Mark Adler 已提交
56 57 58 59 60 61
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

M
Mark Adler 已提交
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
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

example.obj: example.c zlib.h zconf.h

minigzip.obj: minigzip.c zlib.h zconf.h


# For the sake of the old Borland make,
# the command line is cut to fit in the MS-DOS 128 byte limit:
M
Mark Adler 已提交
86
$(ZLIB_LIB): $(OBJ1) $(OBJ2) $(OBJA)
M
Mark Adler 已提交
87 88 89
	-del $(ZLIB_LIB)
	$(AR) $(ZLIB_LIB) $(OBJP1)
	$(AR) $(ZLIB_LIB) $(OBJP2)
M
Mark Adler 已提交
90 91 92 93 94 95 96
	$(AR) $(ZLIB_LIB) $(OBJPA)


# testing
test: example.exe minigzip.exe
	example
	echo hello world | minigzip | minigzip -d
M
Mark Adler 已提交
97 98 99 100 101 102 103 104

example.exe: example.obj $(ZLIB_LIB)
	$(LD) $(LDFLAGS) example.obj $(ZLIB_LIB)

minigzip.exe: minigzip.obj $(ZLIB_LIB)
	$(LD) $(LDFLAGS) minigzip.obj $(ZLIB_LIB)


M
Mark Adler 已提交
105
# cleanup
M
Mark Adler 已提交
106
clean:
M
Mark Adler 已提交
107
	-del $(ZLIB_LIB)
M
Mark Adler 已提交
108
	-del *.obj
M
Mark Adler 已提交
109
	-del *.exe
M
Mark Adler 已提交
110 111 112
	-del *.tds
	-del zlib.bak
	-del foo.gz