1
# WMAKE makefile for Windows 95 and Windows NT (Intel only)
2
# using Watcom C/C++ v11.0+, by Paul Kienitz, last revised 17 Feb 02.
3
# Makes UnZip.exe, fUnZip.exe, and UnZipSFX.exe.
5
# Invoke from UnZip source dir with "WMAKE -F WIN32\MAKEFILE.WAT [targets]"
6
# To build with debug info use "WMAKE DEBUG=1 ..."
7
# To build with no assembly modules use "WMAKE NOASM=1 ..."
8
# To support unshrinking use "WMAKE LAWSUIT=1 ..."
9
# To support unreducing, get the real unreduce.c and go "WMAKE OFFEND_RMS=1 ..."
10
# To use Info-Zip's generic timezone functions use "WMAKE USE_IZTIMEZONE=1 ..."
12
# Other options to be fed to the compiler can be specified in an environment
13
# variable called LOCAL_UNZIP.
15
variation = $(%LOCAL_UNZIP)
17
# Stifle annoying "Delete this file?" questions when errors occur:
21
.EXTENSIONS: .exe .obj .obx .c .h .asm
23
# We maintain multiple sets of object files in different directories so that
24
# we can compile msdos, dos/4gw or pmode/w, and win32 versions of UnZip without
25
# their object files interacting. The following var must be a directory name
26
# ending with a backslash. All object file names must include this macro
27
# at the beginning, for example "$(O)foo.obj".
34
O = $(OBDIR)\ # comment here so backslash won't continue the line
37
cvars = $+$(cvars)$- -DUSE_UNSHRINK
38
avars = $+$(avars)$- -DUSE_UNSHRINK
39
# "$+$(foo)$-" means expand foo as it has been defined up to now; normally,
40
# this Make defers inner expansion until the outer macro is expanded.
43
cvars = $+$(cvars)$- -DUSE_SMITH_CODE
44
avars = $+$(avars)$- -DUSE_SMITH_CODE
47
!ifndef USE_IZTIMEZONE
48
#default: do not use the IZ timezone replacement
52
# The assembly hot-spot code in crc_i386.asm is optional. This section
58
cvars = $+$(cvars)$- -DASM_CRC
59
crcob = $(O)crc_i386.obj
62
!if $(USE_IZTIMEZONE) != 0
63
cvars = $+$(cvars)$- -DW32_USE_IZ_TIMEZONE
64
TIMEZONE_OBJU = $(O)timezone.obj
65
TIMEZONE_OBJX = $(O)timezone.obx
66
TIMEZONE_OBJD = $(O)timezonl.obj
67
TIMEZONE_OBLX = $(O)timezolx.obj
68
TIMEZONE_OBJB = $(O)timezonb.obj
77
# Our object files. OBJU is for UnZip, OBJX for UnZipSFX, OBJF for fUnZip:
79
OBJU1 = $(O)unzip.obj $(crcob) $(O)crctab.obj $(O)crypt.obj $(O)envargs.obj
80
OBJU2 = $(O)explode.obj $(O)extract.obj $(O)fileio.obj $(O)globals.obj
81
OBJU3 = $(O)inflate.obj $(O)list.obj $(O)match.obj $(O)process.obj
82
OBJU4 = $(O)ttyio.obj $(O)unreduce.obj $(O)unshrink.obj $(O)zipinfo.obj
83
OBJUS = $(O)win32.obj $(O)nt.obj $(TIMEZONE_OBJU)
84
OBJU = $(OBJU1) $(OBJU2) $(OBJU3) $(OBJU4) $(OBJUS)
86
OBJX1 = $(O)unzip.obx $(crcob) $(O)crctab.obx $(O)crypt.obx $(O)extract.obx
87
OBJX2 = $(O)fileio.obx $(O)globals.obx $(O)inflate.obx $(O)match.obx
88
OBJX3 = $(O)process.obx $(O)ttyio.obx
89
OBJXS = $(O)win32.obx $(O)nt.obx $(TIMEZONE_OBJX)
90
OBJX = $(OBJX1) $(OBJX2) $(OBJX3) $(OBJXS)
92
OBJF1 = $(O)funzip.obj $(crcob) $(O)cryptf.obj $(O)globalsf.obj
93
OBJF2 = $(O)inflatef.obj $(O)ttyiof.obj
94
OBJFS = $(O)win32f.obj
95
OBJF = $(OBJF1) $(OBJF2) $(OBJFS)
97
OBJD1 = $(O)api.obj $(crcob) $(O)crctabl.obj $(O)cryptl.obj $(O)explodel.obj
98
OBJD2 = $(O)extractl.obj $(O)fileiol.obj $(O)globalsl.obj $(O)inflatel.obj
99
OBJD3 = $(O)listl.obj $(O)matchl.obj $(O)processl.obj
100
OBJD4 = $(O)unreducl.obj $(O)unshrnkl.obj $(O)zipinfol.obj
101
OBJDS = $(O)win32l.obj $(O)ntl.obj $(O)windll.obj $(TIMEZONE_OBJD)
102
OBJD = $(OBJD1) $(OBJD2) $(OBJD3) $(OBJD4) $(OBJDS)
104
UNZIP_H = unzip.h unzpriv.h globals.h win32/w32cfg.h
105
WINDLL_H = windll/windll.h windll/decs.h windll/structs.h
106
WINDLL_DEF = windll/windll32.def
107
WINDLL_IMP_H = windll/decs.h windll/structs.h
109
# Now we have to pick out the proper compiler and options for it.
114
# Use Pentium Pro timings, register args, static strings in code, high strictness:
115
cflags = -bt=NT -6r -zt -zq -wx
116
aflags = -bt=NT -mf -3 -zq
118
lflags_dll = sys NT_DLL
119
cvars = $+$(cvars)$- -DWIN32 $(variation)
120
avars = $+$(avars)$- $(variation)
122
# Specify optimizations, or a nonoptimized debugging version:
127
ldebug = d w all op symf
129
cdebug = -s -obhikl+rt -oe=100 -zp8
130
cdebux = -s -obhiklrs
131
# -oa helps slightly but might be dangerous.
135
CFLAGS_FU = $(cdebug) $(cflags) $(cvars) -DFUNZIP
136
CFLAGS_DL = $(cdebug) $(cflags) $(cvars) -bd -bm -DWINDLL -DDLL
138
# How to compile sources:
140
$(cc) $(cdebux) $(cflags) $(cvars) -DSFX $[@ -fo=$@
143
$(cc) $(cdebug) $(cflags) $(cvars) $[@ -fo=$@
145
# Here we go! By default, make all targets:
146
all: UnZip.exe fUnZip.exe UnZipSFX.exe
148
# Convenient shorthand options for single targets:
149
u: UnZip.exe .SYMBOLIC
150
f: fUnZip.exe .SYMBOLIC
151
x: UnZipSFX.exe .SYMBOLIC
152
d: UnZip32.dll .SYMBOLIC
154
UnZip.exe: $(OBDIR) $(OBJU)
155
$(link) $(lflags) $(ldebug) name $@ file {$(OBJU)}
157
UnZipSFX.exe: $(OBDIR) $(OBJX)
158
$(link) $(lflags) $(ldebug) name $@ file {$(OBJX)}
160
fUnZip.exe: $(OBDIR) $(OBJF)
161
$(link) $(lflags) $(ldebug) name $@ file {$(OBJF)}
163
UnZip32.dll: $(OBDIR) $(OBJD)
164
$(link) $(lflags_dll) $(ldebug) name $@ file {$(OBJD)}
166
uzexampl.exe: $(OBDIR) $(O)uzexampl.obj
167
$(link) $(lflags) $(ldebug) name $@ file {$(O)uzexampl.obj}
169
# Source dependencies:
171
# generic (UnZip, fUnZip):
173
$(O)crc32.obj: crc32.c $(UNZIP_H) zip.h
174
$(O)crctab.obj: crctab.c $(UNZIP_H) zip.h
175
$(O)crypt.obj: crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h
176
$(O)envargs.obj: envargs.c $(UNZIP_H)
177
$(O)explode.obj: explode.c $(UNZIP_H)
178
$(O)extract.obj: extract.c $(UNZIP_H) crypt.h
179
$(O)fileio.obj: fileio.c $(UNZIP_H) crypt.h ttyio.h ebcdic.h
180
$(O)funzip.obj: funzip.c $(UNZIP_H) crypt.h ttyio.h tables.h
181
$(O)globals.obj: globals.c $(UNZIP_H)
182
$(O)inflate.obj: inflate.c inflate.h $(UNZIP_H)
183
$(O)list.obj: list.c $(UNZIP_H)
184
$(O)match.obj: match.c $(UNZIP_H)
185
$(O)process.obj: process.c $(UNZIP_H)
186
$(O)timezone.obj: timezone.c $(UNZIP_H) zip.h timezone.h
187
$(O)ttyio.obj: ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h
188
$(O)unreduce.obj: unreduce.c $(UNZIP_H)
189
$(O)unshrink.obj: unshrink.c $(UNZIP_H)
190
$(O)unzip.obj: unzip.c $(UNZIP_H) crypt.h unzvers.h consts.h
191
$(O)zipinfo.obj: zipinfo.c $(UNZIP_H)
195
$(O)crc32.obx: crc32.c $(UNZIP_H) zip.h
196
$(O)crctab.obx: crctab.c $(UNZIP_H) zip.h
197
$(O)crypt.obx: crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h
198
$(O)extract.obx: extract.c $(UNZIP_H) crypt.h
199
$(O)fileio.obx: fileio.c $(UNZIP_H) crypt.h ttyio.h ebcdic.h
200
$(O)globals.obx: globals.c $(UNZIP_H)
201
$(O)inflate.obx: inflate.c inflate.h $(UNZIP_H)
202
$(O)match.obx: match.c $(UNZIP_H)
203
$(O)process.obx: process.c $(UNZIP_H)
204
$(O)timezone.obx: timezone.c $(UNZIP_H) zip.h timezone.h
205
$(O)ttyio.obx: ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h
206
$(O)unzip.obx: unzip.c $(UNZIP_H) crypt.h unzvers.h consts.h
208
# Special case object files:
210
$(O)win32.obj: win32\win32.c $(UNZIP_H) win32\nt.h
211
$(cc) $(cdebug) $(cflags) $(cvars) win32\win32.c -fo=$@
213
$(O)win32.obx: win32\win32.c $(UNZIP_H) win32\nt.h
214
$(cc) $(cdebux) $(cflags) $(cvars) -DSFX win32\win32.c -fo=$@
216
$(O)nt.obj: win32\nt.c $(UNZIP_H) win32\nt.h
217
$(cc) $(cdebug) $(cflags) $(cvars) win32\nt.c -fo=$@
219
$(O)nt.obx: win32\nt.c $(UNZIP_H) win32\nt.h
220
$(cc) $(cdebux) $(cflags) $(cvars) -DSFX win32\nt.c -fo=$@
222
$(O)crc_i386.obj: win32\crc_i386.asm
223
$(asm) $(aflags) $(avars) win32\crc_i386.asm -fo=$@
225
# Variant object files for fUnZip:
227
$(O)cryptf.obj: crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h
228
$(cc) $(CFLAGS_FU) crypt.c -fo=$@
230
$(O)globalsf.obj: globals.c $(UNZIP_H)
231
$(cc) $(CFLAGS_FU) globals.c -fo=$@
233
$(O)inflatef.obj: inflate.c inflate.h $(UNZIP_H) crypt.h
234
$(cc) $(CFLAGS_FU) inflate.c -fo=$@
236
$(O)ttyiof.obj: ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h
237
$(cc) $(CFLAGS_FU) ttyio.c -fo=$@
239
$(O)win32f.obj: win32\win32.c $(UNZIP_H)
240
$(cc) $(CFLAGS_FU) win32\win32.c -fo=$@
242
# DLL compilation section
243
$(O)api.obj: api.c $(UNZIP_H) $(WINDLL_H) unzvers.h
244
$(cc) $(CFLAGS_DL) api.c -fo=$@
245
$(O)crc32l.obj: crc32.c $(UNZIP_H) zip.h
246
$(cc) $(CFLAGS_DL) crc32.c -fo=$@
247
$(O)crctabl.obj: crctab.c $(UNZIP_H) zip.h
248
$(cc) $(CFLAGS_DL) crctab.c -fo=$@
249
$(O)cryptl.obj: crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h
250
$(cc) $(CFLAGS_DL) crypt.c -fo=$@
251
$(O)explodel.obj: explode.c $(UNZIP_H)
252
$(cc) $(CFLAGS_DL) explode.c -fo=$@
253
$(O)extractl.obj: extract.c $(UNZIP_H) $(WINDLL_H) crypt.h
254
$(cc) $(CFLAGS_DL) extract.c -fo=$@
255
$(O)fileiol.obj: fileio.c $(UNZIP_H) $(WINDLL_H) crypt.h ttyio.h ebcdic.h
256
$(cc) $(CFLAGS_DL) fileio.c -fo=$@
257
$(O)globalsl.obj: globals.c $(UNZIP_H)
258
$(cc) $(CFLAGS_DL) globals.c -fo=$@
259
$(O)inflatel.obj: inflate.c inflate.h $(UNZIP_H)
260
$(cc) $(CFLAGS_DL) inflate.c -fo=$@
261
$(O)listl.obj: list.c $(UNZIP_H) $(WINDLL_H)
262
$(cc) $(CFLAGS_DL) list.c -fo=$@
263
$(O)matchl.obj: match.c $(UNZIP_H)
264
$(cc) $(CFLAGS_DL) match.c -fo=$@
265
$(O)processl.obj: process.c $(UNZIP_H) $(WINDLL_H)
266
$(cc) $(CFLAGS_DL) process.c -fo=$@
267
$(O)timezonl.obj: timezone.c $(UNZIP_H) zip.h timezone.h
268
$(cc) $(CFLAGS_DL) timezone.c -fo=$@
269
$(O)unreducl.obj: unreduce.c $(UNZIP_H)
270
$(cc) $(CFLAGS_DL) unreduce.c -fo=$@
271
$(O)unshrnkl.obj: unshrink.c $(UNZIP_H)
272
$(cc) $(CFLAGS_DL) unshrink.c -fo=$@
273
$(O)zipinfol.obj: zipinfo.c $(UNZIP_H)
274
$(cc) $(CFLAGS_DL) zipinfo.c -fo=$@
276
$(O)win32l.obj: win32\win32.c $(UNZIP_H) win32\nt.h
277
$(cc) $(CFLAGS_DL) -I. win32\win32.c -fo=$@
279
$(O)ntl.obj: win32\nt.c $(UNZIP_H) win32\nt.h
280
$(cc) $(CFLAGS_DL) -I. win32\nt.c -fo=$@
282
$(O)windll.obj: windll\windll.c $(UNZIP_H) $(WINDLL_H)
283
$(O)windll.obj: crypt.h unzvers.h consts.h
284
$(cc) $(CFLAGS_DL) -I. windll\windll.c -fo=$@
286
windll.res: windll\windll.rc unzvers.h
287
$(rc) /l 0x409 /fo$@ /i windll /d WIN32 windll\windll.rc
289
# Windll command line example:
291
$(O)uzexampl.obj: windll/uzexampl.c windll/uzexampl.h
292
$(cc) $(cdebug) $(cflags) $(cvars) windll\uzexampl.c -fo=$@
294
# Creation of subdirectory for intermediate files
298
# Unwanted file removal:
303
cleaner: clean .SYMBOLIC