~ubuntu-branches/ubuntu/quantal/unzip/quantal

« back to all changes in this revision

Viewing changes to win32/Makefile.wat

  • Committer: Bazaar Package Importer
  • Author(s): Santiago Vila
  • Date: 2009-05-08 20:02:40 UTC
  • mfrom: (2.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090508200240-rk23wg0jdoyc6caj
Tags: 6.0-1
* New upstream release. Closes: #496989.
* Enabled new Unicode support. Closes: #197427. This may or may not work
  for your already created zipfiles, but it's not a bug unless they were
  created using the Unicode feature present in zip 3.0.
* Built using DATE_FORMAT=DF_YMD so that unzip -l show dates in ISO format,
  as that's the only available one which makes sense. Closes: #312886.
* Enabled new bzip2 support. Closes: #426798.
* Exit code for zipgrep should now be the right one. Closes: #441997.
* The reason why a file may not be created is now shown. Closes: #478791.
* Summary of changes in this version not being the debian/* files:
- Manpages in section 1, not 1L.
- Branding patch. UnZip by Debian. Original by Info-ZIP.
- Always #include <unistd.h>. Debian GNU/kFreeBSD needs it.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# WMAKE makefile for Windows 95 and Windows NT (Intel only)
2
 
# using Watcom C/C++ v11.0+, by Paul Kienitz, last revised 24 Jan 05.
 
1
# WMAKE makefile for Windows 9x and Windows NT (Intel only)
 
2
# using Watcom C/C++ v11.0+, by Paul Kienitz, last revised 18 Jan 2009.
3
3
# Makes UnZip.exe, fUnZip.exe, and UnZipSFX.exe.
4
4
#
5
5
# Invoke from UnZip source dir with "WMAKE -F WIN32\MAKEFILE.WAT [targets]"
6
6
# To build with debug info use "WMAKE DEBUG=1 ..."
7
7
# To build with no assembly modules use "WMAKE NOASM=1 ..."
8
 
# To support unshrinking use "WMAKE LAWSUIT=1 ..."
 
8
# To omit unshrinking support use "WMAKE NO_LZW=1 ..."
9
9
# To support unreducing, get the real unreduce.c and go "WMAKE OFFEND_RMS=1 ..."
10
10
# To use Info-Zip's generic timezone functions use "WMAKE USE_IZTIMEZONE=1 ..."
 
11
# To include support for bzip2 decompression, get the bzip2 source distribution
 
12
#  into the bzip2/ subfolder and start compilation with "WMAKE USEBZ2=1 ..."
11
13
#
12
14
# Other options to be fed to the compiler can be specified in an environment
13
15
# variable called LOCAL_UNZIP.
44
46
avars = $+$(avars)$- -DUSE_SMITH_CODE
45
47
!endif
46
48
 
 
49
IZ_BZIP2 = bzip2
 
50
!ifdef USEBZ2
 
51
cvars = $+$(cvars)$- -DUSE_BZIP2 -I$(IZ_BZIP2)
 
52
BZIPLIB = $(IZ_BZIP2)/$(OBDIR)/bz2.lib
 
53
BZ2LNKLIB = lib {$(BZIPLIB)}
 
54
!else
 
55
BZIPLIB =
 
56
BZ2LNKLIB =
 
57
!endif
 
58
 
47
59
!ifndef USE_IZTIMEZONE
48
60
#default: do not use the IZ timezone replacement
49
61
USE_IZTIMEZONE=0
53
65
# controls its usage.
54
66
 
55
67
!ifdef NOASM
56
 
crcob = $(O)crc32.obj
 
68
crcaob =
57
69
!else   # !NOASM
58
70
cvars = $+$(cvars)$- -DASM_CRC
59
 
crcob = $(O)crc_i386.obj
 
71
crcaob = $(O)crc_i386.obj
60
72
!endif
61
73
 
62
74
!if $(USE_IZTIMEZONE) != 0
76
88
 
77
89
# Our object files.  OBJU is for UnZip, OBJX for UnZipSFX, OBJF for fUnZip:
78
90
 
79
 
OBJU1 = $(O)unzip.obj $(crcob) $(O)crctab.obj $(O)crypt.obj $(O)envargs.obj
 
91
OBJU1 = $(O)unzip.obj $(O)crc32.obj $(crcaob) $(O)crypt.obj $(O)envargs.obj
80
92
OBJU2 = $(O)explode.obj $(O)extract.obj $(O)fileio.obj $(O)globals.obj
81
93
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)
 
94
OBJU4 = $(O)ubz2err.obj $(O)ttyio.obj $(O)unreduce.obj $(O)unshrink.obj
 
95
OBJU5 = $(O)zipinfo.obj
 
96
OBJUS = $(O)win32.obj $(O)win32i64.obj $(O)nt.obj $(TIMEZONE_OBJU)
 
97
OBJU  = $(OBJU1) $(OBJU2) $(OBJU3) $(OBJU4) $(OBJU5) $(OBJUS)
85
98
 
86
 
OBJX1 = $(O)unzip.obx $(crcob) $(O)crctab.obx $(O)crypt.obx $(O)extract.obx
 
99
OBJX1 = $(O)unzip.obx $(O)crc32.obx $(crcaob) $(O)crypt.obx $(O)extract.obx
87
100
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)
 
101
OBJX3 = $(O)process.obx $(O)ttyio.obx $(O)ubz2err.obx
 
102
OBJXS = $(O)win32.obx $(O)win32i64.obx $(O)nt.obx $(TIMEZONE_OBJX)
90
103
OBJX  = $(OBJX1) $(OBJX2) $(OBJX3) $(OBJXS)
91
104
 
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
 
105
OBJF1 = $(O)funzip.obj $(O)crc32f.obj $(crcaob) $(O)cryptf.obj
 
106
OBJF2 = $(O)globalsf.obj $(O)inflatef.obj $(O)ttyiof.obj
 
107
OBJFS = $(O)win32f.obj $(O)win32i64f.obj
95
108
OBJF  = $(OBJF1) $(OBJF2) $(OBJFS)
96
109
 
97
 
OBJD1 = $(O)api.obj $(crcob) $(O)crctabl.obj $(O)cryptl.obj $(O)explodel.obj
 
110
OBJD1 = $(O)api.obj $(O)crc32l.obj $(crcaob) $(O)cryptl.obj $(O)explodel.obj
98
111
OBJD2 = $(O)extractl.obj $(O)fileiol.obj $(O)globalsl.obj $(O)inflatel.obj
99
 
OBJD3 = $(O)listl.obj $(O)matchl.obj $(O)processl.obj
 
112
OBJD3 = $(O)listl.obj $(O)matchl.obj $(O)processl.obj $(O)ubz2errl.obj
100
113
OBJD4 = $(O)unreducl.obj $(O)unshrnkl.obj $(O)zipinfol.obj
101
 
OBJDS = $(O)win32l.obj $(O)ntl.obj $(O)windll.obj $(TIMEZONE_OBJD)
 
114
OBJDS = $(O)win32l.obj $(O)win32i64l.obj $(O)ntl.obj $(O)windll.obj $(TIMEZONE_OBJD)
102
115
OBJD  = $(OBJD1) $(OBJD2) $(OBJD3) $(OBJD4) $(OBJDS)
103
116
 
104
117
UNZIP_H = unzip.h unzpriv.h globals.h win32/w32cfg.h
111
124
cc     = wcc386
112
125
link   = wlink
113
126
asm    = wasm
 
127
rc     = wrc
114
128
# Use Pentium Pro timings, register args, static strings in code, high strictness:
115
129
cflags = -bt=NT -6r -zt -zq -wx
116
130
aflags = -bt=NT -mf -3 -zq
 
131
rflags = -bt=NT
117
132
lflags = sys NT
118
133
lflags_dll = sys NT_DLL
119
134
cvars  = $+$(cvars)$- -DWIN32 $(variation)
151
166
x:   UnZipSFX.exe  .SYMBOLIC
152
167
d:   UnZip32.dll   .SYMBOLIC
153
168
 
154
 
UnZip.exe:      $(OBDIR) $(OBJU)
155
 
        $(link) $(lflags) $(ldebug) name $@ file {$(OBJU)}
 
169
UnZip.exe:      $(OBDIR) $(OBJU) $(BZIPLIB) $(O)winapp.res
 
170
        $(link) $(lflags) $(ldebug) name $@ file {$(OBJU)} $(BZ2LNKLIB)
156
171
 
157
 
UnZipSFX.exe:   $(OBDIR) $(OBJX)
158
 
        $(link) $(lflags) $(ldebug) name $@ file {$(OBJX)}
 
172
UnZipSFX.exe:   $(OBDIR) $(OBJX) $(BZIPLIB)
 
173
        $(link) $(lflags) $(ldebug) name $@ file {$(OBJX)} $(BZ2LNKLIB)
159
174
 
160
175
fUnZip.exe:     $(OBDIR) $(OBJF)
161
176
        $(link) $(lflags) $(ldebug) name $@ file {$(OBJF)}
162
177
 
163
 
UnZip32.dll:    $(OBDIR) $(OBJD)
164
 
        $(link) $(lflags_dll) $(ldebug) name $@ file {$(OBJD)}
 
178
UnZip32.dll:    $(OBDIR) $(OBJD) $(BZIPLIB) $(O)windll.res
 
179
        $(link) $(lflags_dll) $(ldebug) name $@ file {$(OBJD)} $(BZ2LNKLIB)
 
180
        $(rc) $(rflags) $(O)windll.res $@
165
181
 
166
182
uzexampl.exe:   $(OBDIR) $(O)uzexampl.obj
167
 
        $(link) $(lflags) $(ldebug) name $@ file {$(O)uzexampl.obj}
 
183
        $(link) $(lflags) $(ldebug) name $@ file {$(O)uzexampl.obj} lib version.lib
168
184
 
169
185
# Source dependencies:
170
186
 
171
187
#       generic (UnZip, fUnZip):
172
188
 
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
 
189
$(O)crc32.obj:    crc32.c $(UNZIP_H) zip.h crc32.h
 
190
$(O)crypt.obj:    crypt.c $(UNZIP_H) zip.h crypt.h crc32.h ttyio.h
176
191
$(O)envargs.obj:  envargs.c $(UNZIP_H)
177
192
$(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
 
193
$(O)extract.obj:  extract.c $(UNZIP_H) crc32.h crypt.h
 
194
$(O)fileio.obj:   fileio.c $(UNZIP_H) crc32.h crypt.h ttyio.h ebcdic.h
 
195
$(O)funzip.obj:   funzip.c $(UNZIP_H) crc32.h crypt.h ttyio.h
181
196
$(O)globals.obj:  globals.c $(UNZIP_H)
182
197
$(O)inflate.obj:  inflate.c inflate.h $(UNZIP_H)
183
198
$(O)list.obj:     list.c $(UNZIP_H)
184
199
$(O)match.obj:    match.c $(UNZIP_H)
185
 
$(O)process.obj:  process.c $(UNZIP_H)
 
200
$(O)process.obj:  process.c $(UNZIP_H) crc32.h
186
201
$(O)timezone.obj: timezone.c $(UNZIP_H) zip.h timezone.h
187
202
$(O)ttyio.obj:    ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h
 
203
$(O)ubz2err.obj:  ubz2err.c $(UNZIP_H)
188
204
$(O)unreduce.obj: unreduce.c $(UNZIP_H)
189
205
$(O)unshrink.obj: unshrink.c $(UNZIP_H)
190
206
$(O)unzip.obj:    unzip.c $(UNZIP_H) crypt.h unzvers.h consts.h
192
208
 
193
209
#       UnZipSFX variants:
194
210
 
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
 
211
$(O)crc32.obx:    crc32.c $(UNZIP_H) zip.h crc32.h
 
212
$(O)crypt.obx:    crypt.c $(UNZIP_H) zip.h crypt.h crc32.h ttyio.h
 
213
$(O)extract.obx:  extract.c $(UNZIP_H) crc32.h crypt.h
 
214
$(O)fileio.obx:   fileio.c $(UNZIP_H) crc32.h crypt.h ttyio.h ebcdic.h
200
215
$(O)globals.obx:  globals.c $(UNZIP_H)
201
216
$(O)inflate.obx:  inflate.c inflate.h $(UNZIP_H)
202
217
$(O)match.obx:    match.c $(UNZIP_H)
203
 
$(O)process.obx:  process.c $(UNZIP_H)
 
218
$(O)process.obx:  process.c $(UNZIP_H) crc32.h
204
219
$(O)timezone.obx: timezone.c $(UNZIP_H) zip.h timezone.h
205
220
$(O)ttyio.obx:    ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h
 
221
$(O)ubz2err.obx:  ubz2err.c $(UNZIP_H)
206
222
$(O)unzip.obx:    unzip.c $(UNZIP_H) crypt.h unzvers.h consts.h
207
223
 
208
224
# Special case object files:
213
229
$(O)win32.obx:    win32\win32.c $(UNZIP_H) win32\nt.h
214
230
        $(cc) $(cdebux) $(cflags) $(cvars) -DSFX win32\win32.c -fo=$@
215
231
 
 
232
$(O)win32i64.obj: win32\win32i64.c $(UNZIP_H)
 
233
        $(cc) $(cdebug) $(cflags) $(cvars) win32\win32i64.c -fo=$@
 
234
 
 
235
$(O)win32i64.obx: win32\win32i64.c $(UNZIP_H)
 
236
        $(cc) $(cdebux) $(cflags) $(cvars) -DSFX win32\win32i64.c -fo=$@
 
237
 
216
238
$(O)nt.obj:    win32\nt.c $(UNZIP_H) win32\nt.h
217
239
        $(cc) $(cdebug) $(cflags) $(cvars) win32\nt.c -fo=$@
218
240
 
222
244
$(O)crc_i386.obj: win32\crc_i386.asm
223
245
        $(asm) $(aflags) $(avars) win32\crc_i386.asm -fo=$@
224
246
 
 
247
$(O)winapp.res: win32\winapp.rc unzvers.h
 
248
        $(rc) $(rflags) /r /fo=$@ /dWIN32 win32\winapp.rc
 
249
 
225
250
# Variant object files for fUnZip:
226
251
 
 
252
$(O)crc32f.obj:   crc32.c $(UNZIP_H) zip.h crc32.h
 
253
        $(cc) $(CFLAGS_FU) crc32.c -fo=$@
 
254
 
227
255
$(O)cryptf.obj:   crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h
228
256
        $(cc) $(CFLAGS_FU) crypt.c -fo=$@
229
257
 
239
267
$(O)win32f.obj:   win32\win32.c $(UNZIP_H)
240
268
        $(cc) $(CFLAGS_FU) win32\win32.c -fo=$@
241
269
 
 
270
$(O)win32i64f.obj: win32\win32i64.c $(UNZIP_H)
 
271
        $(cc) $(CFLAGS_FU) win32\win32i64.c -fo=$@
 
272
 
242
273
# DLL compilation section
243
274
$(O)api.obj:      api.c $(UNZIP_H) $(WINDLL_H) unzvers.h
244
275
        $(cc) $(CFLAGS_DL) api.c -fo=$@
245
 
$(O)crc32l.obj:   crc32.c $(UNZIP_H) zip.h
 
276
$(O)crc32l.obj:   crc32.c $(UNZIP_H) zip.h crc32.h
246
277
        $(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
 
278
$(O)cryptl.obj:   crypt.c $(UNZIP_H) zip.h crypt.h crc32.h ttyio.h
250
279
        $(cc) $(CFLAGS_DL) crypt.c -fo=$@
251
280
$(O)explodel.obj: explode.c $(UNZIP_H)
252
281
        $(cc) $(CFLAGS_DL) explode.c -fo=$@
253
 
$(O)extractl.obj: extract.c $(UNZIP_H) $(WINDLL_H) crypt.h
 
282
$(O)extractl.obj: extract.c $(UNZIP_H) $(WINDLL_H) crc32.h crypt.h
254
283
        $(cc) $(CFLAGS_DL) extract.c -fo=$@
255
 
$(O)fileiol.obj:  fileio.c $(UNZIP_H) $(WINDLL_H) crypt.h ttyio.h ebcdic.h
 
284
$(O)fileiol.obj:  fileio.c $(UNZIP_H) $(WINDLL_H) crc32.h crypt.h ttyio.h ebcdic.h
256
285
        $(cc) $(CFLAGS_DL) fileio.c -fo=$@
257
286
$(O)globalsl.obj: globals.c $(UNZIP_H)
258
287
        $(cc) $(CFLAGS_DL) globals.c -fo=$@
262
291
        $(cc) $(CFLAGS_DL) list.c -fo=$@
263
292
$(O)matchl.obj:   match.c $(UNZIP_H)
264
293
        $(cc) $(CFLAGS_DL) match.c -fo=$@
265
 
$(O)processl.obj: process.c $(UNZIP_H) $(WINDLL_H)
 
294
$(O)processl.obj: process.c $(UNZIP_H) $(WINDLL_H) crc32.h
266
295
        $(cc) $(CFLAGS_DL) process.c -fo=$@
267
296
$(O)timezonl.obj: timezone.c $(UNZIP_H) zip.h timezone.h
268
297
        $(cc) $(CFLAGS_DL) timezone.c -fo=$@
 
298
$(O)ubz2errl.obj: ubz2err.c $(UNZIP_H)
 
299
        $(cc) $(CFLAGS_DL) ubz2err.c -fo=$@
269
300
$(O)unreducl.obj: unreduce.c $(UNZIP_H)
270
301
        $(cc) $(CFLAGS_DL) unreduce.c -fo=$@
271
302
$(O)unshrnkl.obj: unshrink.c $(UNZIP_H)
276
307
$(O)win32l.obj:   win32\win32.c $(UNZIP_H) win32\nt.h
277
308
        $(cc) $(CFLAGS_DL) -I. win32\win32.c -fo=$@
278
309
 
 
310
$(O)win32i64l.obj: win32\win32i64.c $(UNZIP_H)
 
311
        $(cc) $(CFLAGS_DL) -I. win32\win32i64.c -fo=$@
 
312
 
279
313
$(O)ntl.obj:      win32\nt.c $(UNZIP_H) win32\nt.h
280
314
        $(cc) $(CFLAGS_DL) -I. win32\nt.c -fo=$@
281
315
 
283
317
$(O)windll.obj:   crypt.h unzvers.h consts.h
284
318
        $(cc) $(CFLAGS_DL) -I. windll\windll.c -fo=$@
285
319
 
286
 
windll.res:     windll\windll.rc unzvers.h
287
 
        $(rc) /l 0x409 /fo$@ /i windll /d WIN32 windll\windll.rc
 
320
$(O)windll.res: windll\windll.rc unzvers.h
 
321
        $(rc) $(rflags) /r /fo=$@ /i=windll /dWIN32 windll\windll.rc
288
322
 
289
323
# Windll command line example:
290
 
 
291
324
$(O)uzexampl.obj: windll/uzexampl.c windll/uzexampl.h
292
325
        $(cc) $(cdebug) $(cflags) $(cvars) windll\uzexampl.c -fo=$@
293
326
 
 
327
# The bzip2 (de)compression library for BZIP2 support:
 
328
$(IZ_BZIP2)/$(OBDIR)/bz2.lib : .ALWAYS .RECHECK
 
329
        $(MAKE) -h -f $(IZ_BZIP2)/makbz2iz.wat CC=$(cc) AR=lib386 &
 
330
        CFLSYS="$(cdebug) $(cflags)" &
 
331
        BZROOTDIR=$(IZ_BZIP2) BZOBDIR=$(IZ_BZIP2)/$(OBDIR)
 
332
 
294
333
# Creation of subdirectory for intermediate files
295
334
$(OBDIR):
296
335
        -mkdir $@
297
336
 
298
337
# Unwanted file removal:
299
338
 
300
 
clean:     .SYMBOLIC
 
339
clean_bz2_lib: .SYMBOLIC
 
340
        -$(MAKE) -h -f $(IZ_BZIP2)/makbz2iz.wat &
 
341
        BZROOTDIR=$(IZ_BZIP2) BZOBDIR=$(IZ_BZIP2)\$(OBDIR) clean
 
342
 
 
343
clean:     clean_bz2_lib  .SYMBOLIC
301
344
        del $(O)*.ob?
 
345
        del $(O)*.res
302
346
 
303
347
cleaner:   clean  .SYMBOLIC
304
348
        del UnZip.exe
305
349
        del fUnZip.exe
306
350
        del UnZipSFX.exe
307
 
        del UnZip32.dll
 
351
        del UnZip32.dll
 
352
        del uzexampl.exe