1
# Makefile for UnZip, fUnZip and UnZipSFX
2
# for emx 0.9d + rsxnt 1.42 / gcc under WIN32. Derived from makefile.os2
3
# By E-Yen Tan and Christian Spieler. Last updated 10 February 2001.
5
# This makefile should work fine with GNU make and hopefully some others.
6
# Tested with Spieler's special GNU make 3.74 gnuish 16-bit version.
8
# If make does not support long command-line passing to gcc, the link step
9
# will fail. In this case, you have to edit the link commands to use the
10
# commented-out alternative that creates a link response file "by hand".
24
CC_OPTS=-Wall -DWIN32 $(AS_FLAGS) $(LOCAL_UNZIP)
25
CFLAGS=$(CC_OTIM) $(CC_OPTS)
26
CFLAGSX=$(CC_OSIZ) $(CC_OPTS) -DSFX
27
CFLAGSF=$(CC_OTIM) $(CC_OPTS) -DFUNZIP
32
LDFLAGS2=-ladvapi32 -Zsmall-conv -s
45
OBJUS=win32$(OBJ) nt$(OBJ)
46
OBJXS=win32_$(OBJ) nt_$(OBJ)
48
OSDEP_H=win32/w32cfg.h
51
# default settings for target dependent macros:
55
OBJU1 = unzip$(OBJ) $(CRC32)$(OBJ) crctab$(OBJ) crypt$(OBJ) envargs$(OBJ)
56
OBJU2 = explode$(OBJ) extract$(OBJ) fileio$(OBJ) globals$(OBJ)
57
OBJU3 = inflate$(OBJ) list$(OBJ) match$(OBJ) process$(OBJ) ttyio$(OBJ)
58
OBJU4 = unreduce$(OBJ) unshrink$(OBJ) zipinfo$(OBJ)
59
OBJU = $(OBJU1) $(OBJU2) $(OBJU3) $(OBJU4) $(OBJUS)
60
OBJX1 = unzipsf_$(OBJ) $(CRC32X)$(OBJ) crctab_$(OBJ) crypt_$(OBJ)
61
OBJX2 = extract_$(OBJ) fileio_$(OBJ) globals_$(OBJ) inflate_$(OBJ)
62
OBJX3 = match_$(OBJ) process_$(OBJ) ttyio_$(OBJ)
63
OBJX = $(OBJX1) $(OBJX2) $(OBJX3) $(OBJXS)
64
OBJF = funzip$(OBJ) $(CRC32F)$(OBJ) cryptf$(OBJ) inflatef$(OBJ) \
65
globalsf$(OBJ) ttyiof$(OBJ) $(OBJFS)
67
UNZIP_H = unzip.h unzpriv.h globals.h $(OSDEP_H)
74
$(CC) -c $(CFLAGS) $(DLLFLAG) $(OUT)$@ $<
78
all: unzip.exe funzip.exe unzipsfx.exe
80
# This next bit is nasty, but is needed to overcome the MS-DOS command
81
# line limit as response files for emx's gcc seem to only work if each
82
# file is on a different line. DJGPP doesn't do this (if you are at all
88
# @ for %f in ($(OBJU1)) do echo %f >> unzip.rsp
89
# @ for %f in ($(OBJU2)) do echo %f >> unzip.rsp
90
# @ for %f in ($(OBJU3)) do echo %f >> unzip.rsp
91
# @ for %f in ($(OBJU4) $(OBJUS)) do echo %f >> unzip.rsp
92
# $(CC) $(LDFLAGS)$@ $(DEF) @unzip.rsp $(LDFLAGS2)
93
$(CC) $(LDFLAGS)$@ $(DEF) $(OBJU) $(LDFLAGS2)
97
$(CC) $(LDFLAGS)$@ $(DEF) $(OBJF) $(LDFLAGS2)
101
# -@ $(RM) unzipsfx.rsp
102
# @ for %f in ($(OBJX1)) do echo %f >> unzipsfx.rsp
103
# @ for %f in ($(OBJX2)) do echo %f >> unzipsfx.rsp
104
# @ for %f in ($(OBJX3)) do echo %f >> unzipsfx.rsp
105
# @ for %f in ($(OBJXS)) do echo %f >> unzipsfx.rsp
106
# $(CC) $(LDFLAGS)$@ $(DEF) @unzipsfx.rsp $(LDFLAGS2)
107
$(CC) $(LDFLAGS)$@ $(DEF) $(OBJX) $(LDFLAGS2)
108
# @ $(RM) unzipsfx.rsp
110
uzexampl.exe: uzexampl$(OBJ)
111
$(CC) $(LDFLAGS)$@ $(DEF) uzexampl$(OBJ) -lversion $(LDFLAGS2)
115
apihelp$(OBJ): apihelp.c $(UNZIP_H) unzvers.h
116
crc32$(OBJ): crc32.c $(UNZIP_H) zip.h
117
crctab$(OBJ): crctab.c $(UNZIP_H) zip.h
118
envargs$(OBJ): envargs.c $(UNZIP_H)
119
explode$(OBJ): explode.c $(UNZIP_H)
120
extract$(OBJ): extract.c $(UNZIP_H) crypt.h
121
fileio$(OBJ): fileio.c $(UNZIP_H) crypt.h ttyio.h ebcdic.h
122
globals$(OBJ): globals.c $(UNZIP_H)
123
inflate$(OBJ): inflate.c $(UNZIP_H)
124
list$(OBJ): list.c $(UNZIP_H)
125
match$(OBJ): match.c $(UNZIP_H)
126
process$(OBJ): process.c $(UNZIP_H)
127
ttyio$(OBJ): ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h
128
unreduce$(OBJ): unreduce.c $(UNZIP_H)
129
unshrink$(OBJ): unshrink.c $(UNZIP_H)
130
unzip$(OBJ): unzip.c $(UNZIP_H) crypt.h unzvers.h consts.h
131
api$(OBJ): api.c $(UNZIP_H) unzvers.h
132
zipinfo$(OBJ): zipinfo.c $(UNZIP_H)
134
funzip$(OBJ): funzip.c $(UNZIP_H) crypt.h ttyio.h tables.h # funzip only
135
$(CC) -c $(CFLAGS) $(OUT)$@ funzip.c
137
unzipstb$(OBJ): unzipstb.c # DLL version
138
$(CC) -c $(CFLAGS) $(OUT)$@ unzipstb.c
140
uzexampl$(OBJ): windll/uzexampl.c windll/uzexampl.h # WINDLL example
141
$(CC) -c $(CFLAGS) $(OUT)$@ windll/uzexampl.c
143
win32$(OBJ): win32/win32.c $(UNZIP_H) win32/nt.h unzvers.h # win32 only
144
$(CC) -c $(CFLAGS) $(OUT)$@ win32$(DIRSEP)win32.c
146
win32f$(OBJ): win32/win32.c $(UNZIP_H) win32/nt.h # win32 funzip
147
$(CC) -c $(CFLAGSF) $(OUT)$@ win32$(DIRSEP)win32.c
149
win32_$(OBJ): win32/win32.c $(UNZIP_H) win32/nt.h # win32 unzipsfx
150
$(CC) -c $(CFLAGSX) $(OUT)$@ win32$(DIRSEP)win32.c
152
nt$(OBJ): win32/nt.c $(UNZIP_H) win32/nt.h # win32 only
153
$(CC) -c $(CFLAGS) $(OUT)$@ win32$(DIRSEP)nt.c
155
nt_$(OBJ): win32/nt.c $(UNZIP_H) win32/nt.h # win32 only
156
$(CC) -c $(CFLAGSX) $(OUT)$@ win32$(DIRSEP)nt.c
158
os2$(OBJ): os2/os2.c $(UNZIP_H) unzvers.h # OS/2 only
159
$(CC) -c $(CFLAGS) $(DLLFLAG) $(OUT)$@ os2$(DIRSEP)os2.c
161
os2_$(OBJ): os2/os2.c $(UNZIP_H) # OS/2 unzipsfx
162
$(CC) -c $(CFLAGSX) $(OUT)$@ os2$(DIRSEP)os2.c
164
os2acl$(OBJ): os2/os2acl.c $(UNZIP_H) unzvers.h # OS/2 only
165
$(CC) -c $(CFLAGS) $(DLLFLAG) $(OUT)$@ os2$(DIRSEP)os2acl.c
167
rexxhelp$(OBJ): os2/rexxhelp.c # OS/2 DLL only
168
$(CC) -c $(CFLAGS) $(DLLFLAG) $(OUT)$@ os2$(DIRSEP)rexxhelp.c
170
rexxapi$(OBJ): os2/rexxapi.c # OS/2 DLL only
171
$(CC) -c $(CFLAGS) $(DLLFLAG) $(OUT)$@ os2$(DIRSEP)rexxapi.c
173
crc_i86$(OBJ): msdos/crc_i86.asm # 16bit only
174
$(AS) $(ASFLAGS) msdos$(AS_DIRSEP)crc_i86.asm $(ASEOL)
176
crc_i386$(OBJ): win32/crc_i386.asm # 32bit, MASM
177
$(AS) $(ASFLAGS) win32$(AS_DIRSEP)crc_i386.asm $(ASEOL)
179
crc_gcc$(OBJ): crc_i386.S # 32bit, GNU AS
180
$(AS) $(ASFLAGS) -x assembler-with-cpp -c -o $@ crc_i386.S
182
crypt$(OBJ): crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h
183
$(CC) -c $(CFLAGS) $(DLLFLAG) $(OUT)$@ crypt.c
185
cryptf$(OBJ): crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h # funzip only
186
$(CC) -c $(CFLAGSF) $(OUT)$@ crypt.c
188
crc32f$(OBJ): crc32.c $(UNZIP_H) zip.h # funzip only
189
$(CC) -c $(CFLAGSF) $(OUT)$@ crc32.c
191
globalsf$(OBJ): globals.c $(UNZIP_H) # funzip only
192
$(CC) -c $(CFLAGSF) $(OUT)$@ globals.c
194
inflatef$(OBJ): inflate.c inflate.h $(UNZIP_H) crypt.h # funzip only
195
$(CC) -c $(CFLAGSF) $(OUT)$@ inflate.c
197
ttyiof$(OBJ): ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h # funzip only
198
$(CC) -c $(CFLAGSF) $(OUT)$@ ttyio.c
200
crc32_$(OBJ): crc32.c $(UNZIP_H) zip.h # unzipsfx only
201
$(CC) -c $(CFLAGSX) $(OUT)$@ crc32.c
203
crctab_$(OBJ): crctab.c $(UNZIP_H) zip.h # unzipsfx only
204
$(CC) -c $(CFLAGSX) $(OUT)$@ crctab.c
206
crypt_$(OBJ): crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h # unzipsfx only
207
$(CC) -c $(CFLAGSX) $(OUT)$@ crypt.c
209
extract_$(OBJ): extract.c $(UNZIP_H) crypt.h # unzipsfx only
210
$(CC) -c $(CFLAGSX) $(OUT)$@ extract.c
212
fileio_$(OBJ): fileio.c $(UNZIP_H) crypt.h ttyio.h ebcdic.h # unzipsfx only
213
$(CC) -c $(CFLAGSX) $(OUT)$@ fileio.c
215
globals_$(OBJ): globals.c $(UNZIP_H) # unzipsfx only
216
$(CC) -c $(CFLAGSX) $(OUT)$@ globals.c
218
inflate_$(OBJ): inflate.c inflate.h $(UNZIP_H) crypt.h # unzipsfx only
219
$(CC) -c $(CFLAGSX) $(OUT)$@ inflate.c
221
match_$(OBJ): match.c $(UNZIP_H) # unzipsfx only
222
$(CC) -c $(CFLAGSX) $(OUT)$@ match.c
224
process_$(OBJ): process.c $(UNZIP_H) # unzipsfx only
225
$(CC) -c $(CFLAGSX) $(OUT)$@ process.c
227
ttyio_$(OBJ): ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h # unzipsfx only
228
$(CC) -c $(CFLAGSX) $(OUT)$@ ttyio.c
230
unzipsf_$(OBJ): unzip.c $(UNZIP_H) crypt.h unzvers.h consts.h # unzipsfx only
231
$(CC) -c $(CFLAGSX) $(OUT)$@ unzip.c