| 1 |
# Makefile for Zip, ZipCloak, ZipNote and ZipSplit for |
| 2 |
# Borland (Turbo) C++ 1.0 or 2.0. |
| 3 |
# Warning: this file is not suitable for Turbo C 2.0. Use makefile.tc instead. |
| 4 |
|
| 5 |
# To use, do "make -fmakefile.bor" |
| 6 |
|
| 7 |
# WARNING: the small model is not supported. |
| 8 |
# Add -DSMALL_MEM or -DMEDIUM_MEM to the LOC macro if you wish to reduce |
| 9 |
# the memory requirements. |
| 10 |
# Add -DNO_ASM to CFLAGS and comment out the ASMOBJS definition if |
| 11 |
# you do not have tasm. |
| 12 |
|
| 13 |
# Optional nonstandard preprocessor flags (as -DMEDIUM_MEM or -DNO_ASM) |
| 14 |
# should be added to the environment via "set LOCAL_ZIP=-DFOO" or added |
| 15 |
# to the declaration of LOC here: |
| 16 |
LOC = -DDOS -DNO_SECURE_TESTS $(LOCAL_ZIP) |
| 17 |
|
| 18 |
# Zip requires compact or large memory model. |
| 19 |
# with 2.1, compact model exceeds 64k code segment; use large model |
| 20 |
ZIPMODEL=l # large model for Zip and ZipUtils |
| 21 |
|
| 22 |
# name of Flag to select memory model for assembler compiles, supported |
| 23 |
# values are __SMALL__ , __MEDIUM__ , __COMPACT__ , __LARGE__ : |
| 24 |
ASMODEL=__LARGE__ # keep in sync with ZIPMODEL definition !! |
| 25 |
|
| 26 |
# Type for CPU required: 0: 8086, 1: 80186, 2: 80286, 3: 80386, etc. |
| 27 |
CPU_TYP = 0 |
| 28 |
|
| 29 |
# Uncomment the following macro to use the optimized assembler |
| 30 |
# routines in Zip: |
| 31 |
CRCA_O = crc_i86.obj |
| 32 |
ASMOBJS = match.obj $(CRCA_O) |
| 33 |
|
| 34 |
ASCPUFLAG = __$(CPU_TYP)86 |
| 35 |
!if $(CPU_TYP) != 0 |
| 36 |
CC_CPUFLG = -$(CPU_TYP) |
| 37 |
!endif |
| 38 |
|
| 39 |
VPATH=.;msdos |
| 40 |
# ------------- Turbo C++, Borland C++ ------------- |
| 41 |
!if $(CC_REV) == 1 |
| 42 |
CC = tcc |
| 43 |
!else |
| 44 |
! if !$(CC_REV) |
| 45 |
CC_REV = 3 |
| 46 |
! endif |
| 47 |
CC = bcc |
| 48 |
!endif |
| 49 |
|
| 50 |
MODEL=-m$(ZIPMODEL) |
| 51 |
!if $(CC_REV) == 1 |
| 52 |
CFLAGS=-w -w-eff -w-def -w-sig -w-cln -a -d -G -O -Z $(CC_CPUFLG) $(MODEL) $(LOC) |
| 53 |
!else |
| 54 |
CFLAGS=-w -w-cln -O2 -Z $(CC_CPUFLG) $(MODEL) $(LOC) |
| 55 |
!endif |
| 56 |
UTILFLAGS=-DUTIL $(CFLAGS) -o |
| 57 |
# for Turbo C++ 1.0, replace bcc with tcc and use the upper version of CFLAGS |
| 58 |
|
| 59 |
AS=tasm |
| 60 |
ASFLAGS=-ml -t -m2 -DDYN_ALLOC -DSS_NEQ_DS -D$(ASCPUFLAG) -D$(ASMODEL) $(LOC) |
| 61 |
|
| 62 |
LD=$(CC) |
| 63 |
LDFLAGS=$(MODEL) |
| 64 |
|
| 65 |
# ------------- Common declarations: |
| 66 |
STRIP=@rem |
| 67 |
# If you don't have UPX, LZEXE, or PKLITE, get one of them. Then define: |
| 68 |
# (NOTE: upx needs a 386 or higher system to run the exe compressor) |
| 69 |
#STRIP=upx --8086 --best |
| 70 |
# or |
| 71 |
#STRIP=lzexe |
| 72 |
# or (if you've registered PKLITE) |
| 73 |
#STRIP=pklite |
| 74 |
# This makes a big difference in .exe size (and possibly load time) |
| 75 |
|
| 76 |
# ------------- Used by install rule |
| 77 |
# set BIN to the directory you want to install the executables to |
| 78 |
BIN = c:\util |
| 79 |
|
| 80 |
# variables |
| 81 |
OBJZ = zip.obj crypt.obj ttyio.obj zipfile.obj zipup.obj fileio.obj util.obj \ |
| 82 |
crc32.obj globals.obj |
| 83 |
|
| 84 |
OBJI = deflate.obj trees.obj $(ASMOBJS) msdos.obj |
| 85 |
|
| 86 |
OBJU = zipfile_.obj fileio_.obj util_.obj globals.obj msdos_.obj |
| 87 |
OBJN = zipnote.obj $(OBJU) |
| 88 |
OBJC = zipcloak.obj crc32_.obj crypt_.obj ttyio.obj $(OBJU) |
| 89 |
OBJS = zipsplit.obj $(OBJU) |
| 90 |
|
| 91 |
ZIP_H = zip.h ziperr.h tailor.h msdos/osdep.h |
| 92 |
|
| 93 |
ZIPS = zip.exe zipnote.exe zipsplit.exe zipcloak.exe |
| 94 |
|
| 95 |
zips: $(ZIPS) |
| 96 |
|
| 97 |
zip.obj: zip.c $(ZIP_H) revision.h crc32.h crypt.h ttyio.h |
| 98 |
$(CC) -c $(CFLAGS) $*.c |
| 99 |
|
| 100 |
zipfile.obj: zipfile.c $(ZIP_H) crc32.h |
| 101 |
$(CC) -c $(CFLAGS) $*.c |
| 102 |
|
| 103 |
zipup.obj: zipup.c $(ZIP_H) revision.h crc32.h crypt.h msdos/zipup.h |
| 104 |
$(CC) -c $(CFLAGS) $*.c |
| 105 |
|
| 106 |
fileio.obj: fileio.c $(ZIP_H) crc32.h |
| 107 |
$(CC) -c $(CFLAGS) $*.c |
| 108 |
|
| 109 |
util.obj: util.c $(ZIP_H) |
| 110 |
$(CC) -c $(CFLAGS) $*.c |
| 111 |
|
| 112 |
globals.obj: globals.c $(ZIP_H) |
| 113 |
$(CC) -c $(CFLAGS) $*.c |
| 114 |
|
| 115 |
deflate.obj: deflate.c $(ZIP_H) |
| 116 |
$(CC) -c $(CFLAGS) $*.c |
| 117 |
|
| 118 |
trees.obj: trees.c $(ZIP_H) |
| 119 |
$(CC) -c $(CFLAGS) $*.c |
| 120 |
|
| 121 |
crc32.obj: crc32.c $(ZIP_H) crc32.h |
| 122 |
$(CC) -c $(CFLAGS) $*.c |
| 123 |
|
| 124 |
crypt.obj: crypt.c $(ZIP_H) crypt.h crc32.h ttyio.h |
| 125 |
$(CC) -c $(CFLAGS) $*.c |
| 126 |
|
| 127 |
ttyio.obj: ttyio.c $(ZIP_H) crypt.h ttyio.h |
| 128 |
$(CC) -c $(CFLAGS) $*.c |
| 129 |
|
| 130 |
msdos.obj: msdos/msdos.c $(ZIP_H) |
| 131 |
$(CC) -c $(CFLAGS) msdos/$*.c |
| 132 |
|
| 133 |
zipcloak.obj: zipcloak.c $(ZIP_H) revision.h crc32.h crypt.h ttyio.h |
| 134 |
$(CC) -c $(CFLAGS) $*.c |
| 135 |
|
| 136 |
zipnote.obj: zipnote.c $(ZIP_H) revision.h |
| 137 |
$(CC) -c $(CFLAGS) $*.c |
| 138 |
|
| 139 |
zipsplit.obj: zipsplit.c $(ZIP_H) revision.h |
| 140 |
$(CC) -c $(CFLAGS) $*.c |
| 141 |
|
| 142 |
zipfile_.obj: zipfile.c $(ZIP_H) crc32.h |
| 143 |
$(CC) -c $(UTILFLAGS)$* zipfile.c |
| 144 |
|
| 145 |
fileio_.obj: fileio.c $(ZIP_H) crc32.h |
| 146 |
$(CC) -c $(UTILFLAGS)$* fileio.c |
| 147 |
|
| 148 |
util_.obj: util.c $(ZIP_H) |
| 149 |
$(CC) -c $(UTILFLAGS)$* util.c |
| 150 |
|
| 151 |
crc32_.obj: crc32.c $(ZIP_H) crc32.h |
| 152 |
$(CC) -c $(UTILFLAGS) crc32.c |
| 153 |
|
| 154 |
crypt_.obj: crypt.c $(ZIP_H) crypt.h crc32.h ttyio.h |
| 155 |
$(CC) -c $(UTILFLAGS)$* crypt.c |
| 156 |
|
| 157 |
msdos_.obj: msdos/msdos.c $(ZIP_H) |
| 158 |
$(CC) -c $(UTILFLAGS)$* msdos/msdos.c |
| 159 |
|
| 160 |
crc_i86.obj: msdos/crc_i86.asm |
| 161 |
$(AS) $(ASFLAGS) msdos\crc_i86.asm ; |
| 162 |
|
| 163 |
match.obj: msdos/match.asm |
| 164 |
$(AS) $(ASFLAGS) msdos\match.asm ; |
| 165 |
|
| 166 |
# we must cut the command line to fit in the MS/DOS 128 byte limit: |
| 167 |
zip.exe: $(OBJZ) $(OBJI) |
| 168 |
echo $(OBJZ) > zip.rsp |
| 169 |
echo $(OBJI) >> zip.rsp |
| 170 |
$(LD) $(LDFLAGS) @zip.rsp |
| 171 |
del zip.rsp |
| 172 |
$(STRIP) zip.exe |
| 173 |
|
| 174 |
zipcloak.exe: $(OBJC) |
| 175 |
echo $(OBJC) > zipc.rsp |
| 176 |
$(LD) $(LDFLAGS) @zipc.rsp |
| 177 |
del zipc.rsp |
| 178 |
$(STRIP) zipcloak.exe |
| 179 |
|
| 180 |
zipnote.exe: $(OBJN) |
| 181 |
echo $(OBJN) > zipn.rsp |
| 182 |
$(LD) $(LDFLAGS) @zipn.rsp |
| 183 |
del zipn.rsp |
| 184 |
$(STRIP) zipnote.exe |
| 185 |
|
| 186 |
zipsplit.exe: $(OBJS) |
| 187 |
echo $(OBJS) > zips.rsp |
| 188 |
$(LD) $(LDFLAGS) @zips.rsp |
| 189 |
del zips.rsp |
| 190 |
$(STRIP) zipsplit.exe |
| 191 |
|
| 192 |
install: $(ZIPS) |
| 193 |
copy /b *.exe $(BIN) |
| 194 |
|
| 195 |
clean: |
| 196 |
del *.obj |
| 197 |
del *.exe |