1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252
|
#------------------------------------------------------------------------------
# Makefile for UnZip 5.53 and later Greg Roelofs and others
# Version: Microsoft C (5.x and later) 29 Dec 05
#------------------------------------------------------------------------------
# Users of MSC 6/7 and NMAKE can use the Unix Makefile (target msc_dos),
# if desired. This makefile works just fine, too, however. OS/2 users
# can cross-compile using os2/makefile.os2 (target mscdos). Note that
# there is possibly a bug in MSC 6 which screws up funzip (goes into
# infinite loop? --this has not been confirmed in over a year...). There
# is definitely a bug (internal compiler error) in MSC 6.00 while com-
# piling explode.c (fixed in 6.0a, 6.0ax, 6.0ax2, 7.*, 8.*).
# GNU make doesn't like the return value from "rem"
#STRIP=rem
STRIP=echo Ignore this line.
# If you don't have UPX, LZEXE, or PKLITE, get one of them. Then define:
# (NOTE: upx needs a 386 or higher system to run the exe compressor)
#STRIP=upx --8086 --best
# or
#STRIP=lzexe
# or
#STRIP=pklite
# and remove /e from LDFLAGS.
# This makes a big difference in .exe size (and possibly load time).
# Optional nonstandard preprocessor flags (as -DCHECK_EOF or -DDOS_WILD)
# should be added to the environment via "set LOCAL_UNZIP=-DFOO" or added
# to the declaration of LOC here:
LOC = $(LOCAL_UNZIP)
# Type for CPU required: 0: 8086, 1: 80186, 2: 80286, 3: 80386, etc.
CPU_TYP = 0
#UNMODEL=M # medium model for UnZip
# with MSC 5.1, 6.0 and 8.x, small model exceeds 64k code segment; use medium
# deflate64 support requires large or compact model
UNMODEL=L # large model for UnZip with Deflate64 support
FUMODEL=C # compact model for fUnZip (Deflate64 support enabled)
SXMODEL=S # small model for UnZipSFX (without Deflate64 support)
# name of Flag to select memory model for assembler compiles, supported
# values are __SMALL__ , __MEDIUM__ , __COMPACT__ , __LARGE__ :
# for MSC 5.1 and 8.x use:
ASUNMODEL=__LARGE__ # keep in sync with UNMODEL definition !!
ASFUMODEL=__COMPACT__ # keep in sync with FUMODEL definition !!
ASSXMODEL=__SMALL__ # keep in sync with SXMODEL definition !!
# Uncomment the following three macros to use the optimized CRC32 assembler
# routine in UnZip and UnZipSFX:
ASMFLG = -DASM_CRC
ASMOBJS = crc_i86.obj
ASMOBJF = crc_i86_.obj
ASMOBJX = crc_i86x.obj
ASCPUFLAG = __$(CPU_TYP)86
CC = cl
# add -G2(3,4) for 286 (386, 486) and/or -FPi87 for 80x87:
CC_GENFLAGS = -nologo -DMSC $(ASMFLG) $(LOC) -I. -G$(CPU_TYP)
CC_SPEEDOPT = -Oait -Gs # -Ox does not work for inflate.c
CC_SIZEOPT = -Oas -Gs
CFLAGS_UN = -A$(UNMODEL) $(CC_GENFLAGS) $(CC_SPEEDOPT)
CFLAGS_FU = -A$(FUMODEL) $(CC_GENFLAGS) $(CC_SPEEDOPT) -DFUNZIP
CFLAGS_SX = -A$(SXMODEL) $(CC_GENFLAGS) $(CC_SIZEOPT) -DSFX
AS = masm
ASFLAGS = -ml -D$(ASCPUFLAG) $(LOC)
LD = Link # mixed case to disable special handling by GNU Make
# remove /e if you have LZEXE or PKLITE:
LDFLAGS = /nologo/noi/e/st:0x0c00/farcall/packcode
# "/farcall/packcode" are only useful for `large code' memory models
# but should be a "no-op" for small code models.
LDFLAGS2 = ,$*
LDFLAGS2_UN = $(LDFLAGS2);
LDFLAGS2_FU = $(LDFLAGS2);
LDFLAGS2_SX = $(LDFLAGS2);
OBJS1 = unzip.obj crc32.obj crypt.obj envargs.obj explode.obj
OBJS2 = extract.obj fileio.obj globals.obj inflate.obj list.obj match.obj
OBJS3 = process.obj ttyio.obj unreduce.obj unshrink.obj zipinfo.obj
OBJS4 = msdos.obj $(ASMOBJS)
OBJS = $(OBJS1) $(OBJS2) $(OBJS3) $(OBJS4)
OBJX1 = unzipsfx.obj crc32x.obj cryptx.obj extractx.obj fileiox.obj
OBJX2 = globalsx.obj inflatex.obj matchx.obj processx.obj ttyiox.obj
OBJX3 = msdosx.obj $(ASMOBJX)
OBJX = $(OBJX1) $(OBJX2) $(OBJX3)
OBJF = funzip.obj crc32_.obj crypt_.obj globals_.obj inflate_.obj ttyio_.obj \
msdos_.obj $(ASMOBJF)
UNZIP_H = unzip.h unzpriv.h globals.h msdos/doscfg.h
default: unzip.exe funzip.exe unzipsfx.exe
#clean:
# As long as the brain damaged old ``Make'' utility from MSC 5.1 and earlier
# (NMAKE from MSC 6.0 + would work !) remains supported, a "clean" target
# cannot be inserted !!
# pattern rules for implicit dependencies:
.asm.obj:
$(AS) $(ASFLAGS) -D$(ASUNMODEL) $<, $@;
.c.obj:
$(CC) -c $(CFLAGS_UN) $*.c
# individual dependencies and action rules:
crc_i86.obj: msdos/crc_i86.asm
$(AS) $(ASFLAGS) -D$(ASUNMODEL) msdos/crc_i86.asm, $@;
crc_i86_.obj: msdos/crc_i86.asm
$(AS) $(ASFLAGS) -D$(ASFUMODEL) msdos/crc_i86.asm, $@;
crc_i86x.obj: msdos/crc_i86.asm
$(AS) $(ASFLAGS) -D$(ASSXMODEL) msdos/crc_i86.asm, $@;
crc32.obj: crc32.c $(UNZIP_H) zip.h crc32.h
crc32_.obj: crc32.c $(UNZIP_H) zip.h crc32.h
$(CC) -c $(CFLAGS_FU) -Focrc32_.obj crc32.c
crc32x.obj: crc32.c $(UNZIP_H) zip.h crc32.h
$(CC) -c $(CFLAGS_SX) -Focrc32x.obj crc32.c
crypt.obj: crypt.c $(UNZIP_H) crypt.h crc32.h ttyio.h zip.h
crypt_.obj: crypt.c $(UNZIP_H) crypt.h crc32.h ttyio.h zip.h
$(CC) -c $(CFLAGS_FU) -Focrypt_.obj crypt.c
cryptx.obj: crypt.c $(UNZIP_H) crypt.h crc32.h ttyio.h zip.h
$(CC) -c $(CFLAGS_SX) -Focryptx.obj crypt.c
envargs.obj: envargs.c $(UNZIP_H)
explode.obj: explode.c $(UNZIP_H)
extract.obj: extract.c $(UNZIP_H) crc32.h crypt.h
extractx.obj: extract.c $(UNZIP_H) crc32.h crypt.h
$(CC) -c $(CFLAGS_SX) -Foextractx.obj extract.c
fileio.obj: fileio.c $(UNZIP_H) crc32.h crypt.h ttyio.h ebcdic.h
fileiox.obj: fileio.c $(UNZIP_H) crc32.h crypt.h ttyio.h ebcdic.h
$(CC) -c $(CFLAGS_SX) -Fofileiox.obj fileio.c
funzip.obj: funzip.c $(UNZIP_H) crc32.h crypt.h ttyio.h
$(CC) -c $(CFLAGS_FU) funzip.c
globals.obj: globals.c $(UNZIP_H)
globals_.obj: globals.c $(UNZIP_H)
$(CC) -c $(CFLAGS_FU) -Foglobals_.obj globals.c
globalsx.obj: globals.c $(UNZIP_H)
$(CC) -c $(CFLAGS_SX) -Foglobalsx.obj globals.c
inflate.obj: inflate.c inflate.h $(UNZIP_H)
inflate_.obj: inflate.c inflate.h $(UNZIP_H) crypt.h
$(CC) -c $(CFLAGS_FU) -Foinflate_.obj inflate.c
inflatex.obj: inflate.c inflate.h $(UNZIP_H) crypt.h
$(CC) -c $(CFLAGS_SX) -Foinflatex.obj inflate.c
list.obj: list.c $(UNZIP_H)
match.obj: match.c $(UNZIP_H)
matchx.obj: match.c $(UNZIP_H)
$(CC) -c $(CFLAGS_SX) -Fomatchx.obj match.c
msdos.obj: msdos/msdos.c $(UNZIP_H)
$(CC) -c $(CFLAGS_UN) msdos/msdos.c
msdos_.obj: msdos/msdos.c $(UNZIP_H)
$(CC) -c $(CFLAGS_FU) -Fomsdos_.obj msdos/msdos.c
msdosx.obj: msdos/msdos.c $(UNZIP_H)
$(CC) -c $(CFLAGS_SX) -Fomsdosx.obj msdos/msdos.c
process.obj: process.c $(UNZIP_H) crc32.h
processx.obj: process.c $(UNZIP_H) crc32.h
$(CC) -c $(CFLAGS_SX) -Foprocessx.obj process.c
ttyio.obj: ttyio.c $(UNZIP_H) crypt.h ttyio.h zip.h
ttyio_.obj: ttyio.c $(UNZIP_H) crypt.h ttyio.h zip.h
$(CC) -c $(CFLAGS_FU) -Fottyio_.obj ttyio.c
ttyiox.obj: ttyio.c $(UNZIP_H) crypt.h ttyio.h zip.h
$(CC) -c $(CFLAGS_SX) -Fottyiox.obj ttyio.c
unreduce.obj: unreduce.c $(UNZIP_H)
unshrink.obj: unshrink.c $(UNZIP_H)
unzip.obj: unzip.c $(UNZIP_H) crypt.h unzvers.h consts.h
unzipsfx.obj: unzip.c $(UNZIP_H) crypt.h unzvers.h consts.h
$(CC) -c $(CFLAGS_SX) -Founzipsfx.obj unzip.c
zipinfo.obj: zipinfo.c $(UNZIP_H)
# MS make:
# -------
unzip.exe: $(OBJS)
echo $(OBJS1)+ > unzip.rsp
echo $(OBJS2)+ >> unzip.rsp
echo $(OBJS3)+ >> unzip.rsp
echo $(OBJS4) >> unzip.rsp
echo $(LDFLAGS2_UN) >> unzip.rsp
$(LD) $(LDFLAGS) @unzip.rsp
del unzip.rsp
$(STRIP) unzip.exe
unzipsfx.exe: $(OBJX)
echo $(OBJX1)+ > unzipsfx.rsp
echo $(OBJX2)+ >> unzipsfx.rsp
echo $(OBJX3) >> unzipsfx.rsp
echo $(LDFLAGS2_UN) >> unzipsfx.rsp
$(LD) $(LDFLAGS) @unzipsfx.rsp
del unzipsfx.rsp
$(STRIP) unzipsfx.exe
funzip.exe: $(OBJF)
echo $(OBJF) > funzip.rsp
echo $(LDFLAGS2_FU) >> funzip.rsp
$(LD) $(LDFLAGS) @funzip.rsp
del funzip.rsp
$(STRIP) funzip.exe
# better makes which know how to deal with 128-char limit on command line:
# -----------------------------------------------------------------------
#unzip.exe: $(OBJS)
# $(LD) $(LDFLAGS) $(OBJS) $(LDFLAGS2)
# $(STRIP) unzip.exe
#
#unzipsfx.exe: $(OBJX)
# $(LD) $(LDFLAGS) $(OBJX) $(LDFLAGS2)
# $(STRIP) unzipsfx.exe
#
#funzip.exe: $(OBJF)
# $(LD) $(LDFLAGS) $(OBJF) $(LDFLAGS2_FU)
# $(STRIP) funzip.exe
|