1*44bedb31SLionel Sambuc# Makefile for zlib 2*44bedb31SLionel Sambuc# Borland C++ 3*44bedb31SLionel Sambuc# Last updated: 15-Mar-2003 4*44bedb31SLionel Sambuc 5*44bedb31SLionel Sambuc# To use, do "make -fmakefile.bor" 6*44bedb31SLionel Sambuc# To compile in small model, set below: MODEL=s 7*44bedb31SLionel Sambuc 8*44bedb31SLionel Sambuc# WARNING: the small model is supported but only for small values of 9*44bedb31SLionel Sambuc# MAX_WBITS and MAX_MEM_LEVEL. For example: 10*44bedb31SLionel Sambuc# -DMAX_WBITS=11 -DDEF_WBITS=11 -DMAX_MEM_LEVEL=3 11*44bedb31SLionel Sambuc# If you wish to reduce the memory requirements (default 256K for big 12*44bedb31SLionel Sambuc# objects plus a few K), you can add to the LOC macro below: 13*44bedb31SLionel Sambuc# -DMAX_MEM_LEVEL=7 -DMAX_WBITS=14 14*44bedb31SLionel Sambuc# See zconf.h for details about the memory requirements. 15*44bedb31SLionel Sambuc 16*44bedb31SLionel Sambuc# ------------ Turbo C++, Borland C++ ------------ 17*44bedb31SLionel Sambuc 18*44bedb31SLionel Sambuc# Optional nonstandard preprocessor flags (e.g. -DMAX_MEM_LEVEL=7) 19*44bedb31SLionel Sambuc# should be added to the environment via "set LOCAL_ZLIB=-DFOO" or added 20*44bedb31SLionel Sambuc# to the declaration of LOC here: 21*44bedb31SLionel SambucLOC = $(LOCAL_ZLIB) 22*44bedb31SLionel Sambuc 23*44bedb31SLionel Sambuc# type for CPU required: 0: 8086, 1: 80186, 2: 80286, 3: 80386, etc. 24*44bedb31SLionel SambucCPU_TYP = 0 25*44bedb31SLionel Sambuc 26*44bedb31SLionel Sambuc# memory model: one of s, m, c, l (small, medium, compact, large) 27*44bedb31SLionel SambucMODEL=l 28*44bedb31SLionel Sambuc 29*44bedb31SLionel Sambuc# replace bcc with tcc for Turbo C++ 1.0, with bcc32 for the 32 bit version 30*44bedb31SLionel SambucCC=bcc 31*44bedb31SLionel SambucLD=bcc 32*44bedb31SLionel SambucAR=tlib 33*44bedb31SLionel Sambuc 34*44bedb31SLionel Sambuc# compiler flags 35*44bedb31SLionel Sambuc# replace "-O2" by "-O -G -a -d" for Turbo C++ 1.0 36*44bedb31SLionel SambucCFLAGS=-O2 -Z -m$(MODEL) $(LOC) 37*44bedb31SLionel Sambuc 38*44bedb31SLionel SambucLDFLAGS=-m$(MODEL) -f- 39*44bedb31SLionel Sambuc 40*44bedb31SLionel Sambuc 41*44bedb31SLionel Sambuc# variables 42*44bedb31SLionel SambucZLIB_LIB = zlib_$(MODEL).lib 43*44bedb31SLionel Sambuc 44*44bedb31SLionel SambucOBJ1 = adler32.obj compress.obj crc32.obj deflate.obj gzio.obj infback.obj 45*44bedb31SLionel SambucOBJ2 = inffast.obj inflate.obj inftrees.obj trees.obj uncompr.obj zutil.obj 46*44bedb31SLionel SambucOBJP1 = +adler32.obj+compress.obj+crc32.obj+deflate.obj+gzio.obj+infback.obj 47*44bedb31SLionel SambucOBJP2 = +inffast.obj+inflate.obj+inftrees.obj+trees.obj+uncompr.obj+zutil.obj 48*44bedb31SLionel Sambuc 49*44bedb31SLionel Sambuc 50*44bedb31SLionel Sambuc# targets 51*44bedb31SLionel Sambucall: $(ZLIB_LIB) example.exe minigzip.exe 52*44bedb31SLionel Sambuc 53*44bedb31SLionel Sambuc.c.obj: 54*44bedb31SLionel Sambuc $(CC) -c $(CFLAGS) $*.c 55*44bedb31SLionel Sambuc 56*44bedb31SLionel Sambucadler32.obj: adler32.c zlib.h zconf.h 57*44bedb31SLionel Sambuc 58*44bedb31SLionel Sambuccompress.obj: compress.c zlib.h zconf.h 59*44bedb31SLionel Sambuc 60*44bedb31SLionel Sambuccrc32.obj: crc32.c zlib.h zconf.h crc32.h 61*44bedb31SLionel Sambuc 62*44bedb31SLionel Sambucdeflate.obj: deflate.c deflate.h zutil.h zlib.h zconf.h 63*44bedb31SLionel Sambuc 64*44bedb31SLionel Sambucgzio.obj: gzio.c zutil.h zlib.h zconf.h 65*44bedb31SLionel Sambuc 66*44bedb31SLionel Sambucinfback.obj: infback.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ 67*44bedb31SLionel Sambuc inffast.h inffixed.h 68*44bedb31SLionel Sambuc 69*44bedb31SLionel Sambucinffast.obj: inffast.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ 70*44bedb31SLionel Sambuc inffast.h 71*44bedb31SLionel Sambuc 72*44bedb31SLionel Sambucinflate.obj: inflate.c zutil.h zlib.h zconf.h inftrees.h inflate.h \ 73*44bedb31SLionel Sambuc inffast.h inffixed.h 74*44bedb31SLionel Sambuc 75*44bedb31SLionel Sambucinftrees.obj: inftrees.c zutil.h zlib.h zconf.h inftrees.h 76*44bedb31SLionel Sambuc 77*44bedb31SLionel Sambuctrees.obj: trees.c zutil.h zlib.h zconf.h deflate.h trees.h 78*44bedb31SLionel Sambuc 79*44bedb31SLionel Sambucuncompr.obj: uncompr.c zlib.h zconf.h 80*44bedb31SLionel Sambuc 81*44bedb31SLionel Sambuczutil.obj: zutil.c zutil.h zlib.h zconf.h 82*44bedb31SLionel Sambuc 83*44bedb31SLionel Sambucexample.obj: example.c zlib.h zconf.h 84*44bedb31SLionel Sambuc 85*44bedb31SLionel Sambucminigzip.obj: minigzip.c zlib.h zconf.h 86*44bedb31SLionel Sambuc 87*44bedb31SLionel Sambuc 88*44bedb31SLionel Sambuc# the command line is cut to fit in the MS-DOS 128 byte limit: 89*44bedb31SLionel Sambuc$(ZLIB_LIB): $(OBJ1) $(OBJ2) 90*44bedb31SLionel Sambuc -del $(ZLIB_LIB) 91*44bedb31SLionel Sambuc $(AR) $(ZLIB_LIB) $(OBJP1) 92*44bedb31SLionel Sambuc $(AR) $(ZLIB_LIB) $(OBJP2) 93*44bedb31SLionel Sambuc 94*44bedb31SLionel Sambucexample.exe: example.obj $(ZLIB_LIB) 95*44bedb31SLionel Sambuc $(LD) $(LDFLAGS) example.obj $(ZLIB_LIB) 96*44bedb31SLionel Sambuc 97*44bedb31SLionel Sambucminigzip.exe: minigzip.obj $(ZLIB_LIB) 98*44bedb31SLionel Sambuc $(LD) $(LDFLAGS) minigzip.obj $(ZLIB_LIB) 99*44bedb31SLionel Sambuc 100*44bedb31SLionel Sambuctest: example.exe minigzip.exe 101*44bedb31SLionel Sambuc example 102*44bedb31SLionel Sambuc echo hello world | minigzip | minigzip -d 103*44bedb31SLionel Sambuc 104*44bedb31SLionel Sambucclean: 105*44bedb31SLionel Sambuc -del *.obj 106*44bedb31SLionel Sambuc -del *.lib 107*44bedb31SLionel Sambuc -del *.exe 108*44bedb31SLionel Sambuc -del zlib_*.bak 109*44bedb31SLionel Sambuc -del foo.gz 110