Subversion Repositories Kolibri OS

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
6725 siemargl 1
# NMAKE Makefile for Windows NT/2K/XP/... and Windows 95/98/Me
2
#   D. Feinleib 7/92 
3
#   H. Gessau 9/93 
4
#   J. Lee 8/95 (johnnyl@microsoft.com)
5
#   C. Spieler 03/99
6
#
7
# Last revised:  06 Jan 2009
8
#
9
# Tested with VC++ 2.0 for NT for MIPS and Alpha, Visual C++ 2.2 for Intel CPUs
10
# Revision tested with VC++ 5.0, 6.0, 8.0 and 9.0 for Intel CPUs
11
#
12
# Option switches
13
# (specify OPTFLAG as "OPTFLAG={1|0}" on the nmake command line)
14
#   USEBZ2DLL=1         : bzip2 support, link against externally supplied dll
15
#   USEBZ2STAT=1        : bzip2 support by static library created during build
16
#   USEBZ2=1            : alias for USEBZ2STAT=1
17
#
18
#   USEZLIBDLL=1        : replace built-in inflate by external zlib dll
19
#   USEZLIBSTAT=1       : replace built-in inflate by external zlib static lib
20
#   USEZLIB=1           : alias for USEZLIBSTAT=1
21
#
22
#   USE_DLLRUNTIME      : link executables against C runtime dll
23
#                         (default: executables are linked against static lib)
24
#                         USEBZ2DLL or USEZLIBDLL imply USE_DLLRUNTIME !
25
#   DLLSTANDALONE       : unzip32.dll is linked against static MT runtime lib
26
#                         (default: unzip32.dll linked against C runtime dll)
27
#
28
#   USE_UTF8            : =0 no unicode names support
29
#                         =1 force recognition of UTF8 extra fields and
30
#                            "UTF8 name" attrib (default)
31
#
32
#   USEASM              : use assembler code for crc32 function (default)
33
#   NOASM               : use C implementation for crc32 function
34
#   USEMASM             : use MS macro assembler (MASM) to assemble crc32 code
35
#   USEML               : use MS macro assembler (ML driver) to create crc32
36
#                         (default: use C inline assembler code for crc32)
37
#
38
#   NOCRC_OPT=1         : disable "unfolding CRC tables" optimization
39
#
40
#   USEIZTIMEZONE       : =0 (default) timezone setup by built-in C RTL
41
#                         =1 apply InfoZip replacement code for timezone setup
42
#                            (recognizes extended syntax when timezone setup
43
#                            is overridden by environment variable)
44
 
45
# Nmake macros for building Win32 applications
46
# To build with debug info use 'nmake debug=1'
47
!IFNDEF debug
48
NODEBUG=1
49
!ENDIF
50
 
51
!ifdef NOASM
52
APPLY_ASMCRC=0
53
!else
54
!ifdef USEASM
55
APPLY_ASMCRC=1
56
!endif
57
!endif
58
 
59
# Options to decide whether using zlib as decompression library.
60
# Specify USEZLIBDLL or USEZLIBSTAT to replace UnZip's built-in inflation code
61
# by the inflate service of the zlib library.
62
# (The option USEZLIB is currently set as a synonym for USEZLIBSTAT.)
63
!if defined(USEZLIBSTAT) || defined(USEZLIBDLL)
64
USEZLIB=1
65
!endif
66
 
67
!ifdef USEZLIB
68
!if defined(USEZLIBSTAT) && defined(USEZLIBDLL)
69
!ERROR Conflicting options USEZLIBSTAT and USEZLIBDLL requested!
70
!endif
71
# Set static zlib linkage as default in case nothing is specified.
72
!if !defined(USEZLIBSTAT) && !defined(USEZLIBDLL)
73
USEZLIBSTAT=1
74
!endif
75
!undef USEASM
76
APPLY_ASMCRC=0
77
NOCRC_OPT=1
78
ZLIBLIB=zlib.lib
79
ZLIBLIBDLL=zdll.lib
80
!else # !USEZLIB
81
ZLIBLIB=
82
ZLIBLIBDLL=
83
!endif # ?USEZLIB
84
 
85
 
86
# Options to include optional support for bzip2 decompression
87
!if defined(USEBZ2STAT) || defined(USEBZ2DLL)
88
USEBZ2=1
89
!endif
90
 
91
IZ_BZIP2 = bzip2
92
# Subfolder containing bz2 objects/lib for UnZip program target(s).
93
OBEXE = obexe
94
# Subfolder containing bz2 objects/lib for UnZip DLL target(s).
95
OBDLL = obdll
96
!ifdef USEBZ2
97
!if defined(USEBZ2STAT) && defined(USEBZ2DLL)
98
!ERROR Conflicting options USEBZ2STAT and USEBZ2DLL requested!
99
!endif
100
INC_BZ2LIB=-I$(IZ_BZIP2)
101
# Set static bzip2 linkage as default in case nothing is specified.
102
!if !defined(USEBZ2STAT) && !defined(USEBZ2DLL)
103
USEBZ2STAT=1
104
!endif
105
!IFNDEF debug
106
!ifdef USEBZ2STAT
107
BZIPLIBEXE=$(IZ_BZIP2)/$(OBEXE)/bz2.lib
108
BZIPLIBDLL=$(IZ_BZIP2)/$(OBDLL)/bz2.lib
109
!else
110
BZIPLIBEXE=bz2.lib
111
BZIPLIBDLL=bz2.lib
112
!endif
113
!ELSE
114
BZIPLIBEXE=bz2d.lib
115
BZIPLIBDLL=bz2d.lib
116
!ENDIF
117
!else # !USEBZ2
118
INC_BZ2LIB=
119
BZIPLIBEXE=
120
BZIPLIBDLL=
121
!endif # ?USEBZ2
122
 
123
!ifndef APPLY_ASMCRC
124
#default ASM CRC code (inline asm in C source) for now...
125
APPLY_ASMCRC=1
126
!endif
127
 
128
!ifndef USE_IZTIMEZONE
129
#default: do not use the IZ timezone replacement
130
USE_IZTIMEZONE=0
131
!endif
132
 
133
!ifndef USE_UTF8
134
#default for now: include support for UTF8 paths
135
USE_UTF8=1
136
!endif
137
 
138
!IF "$(CPU)" == ""  &&  "$(PROCESSOR_ARCHITECTURE)" == "x86"
139
CPU = i386
140
!ENDIF
141
!IF "$(CPU)" == ""  &&  "$(PROCESSOR_ARCHITECTURE)" == "MIPS"
142
CPU = $(PROCESSOR_ARCHITECTURE)
143
!ENDIF
144
!IF "$(CPU)" == ""  &&  "$(PROCESSOR_ARCHITECTURE)" == "ALPHA"
145
CPU = $(PROCESSOR_ARCHITECTURE)
146
!ENDIF
147
!IF "$(CPU)" == ""  &&  "$(PROCESSOR_ARCHITECTURE)" == "PPC"
148
CPU = $(PROCESSOR_ARCHITECTURE)
149
!ENDIF
150
!IF "$(CPU)" == ""
151
CPU = i386
152
!ENDIF
153
 
154
# special subdirectory for the static library binaries, to separate them
155
# from other binaries (including dll import library file)
156
OBDIR = ow32lib
157
OB = $(OBDIR)/
158
 
159
# object files
160
OBJU1 = unzip.obj crc32.obj $(CRCA_O) crypt.obj envargs.obj explode.obj
161
OBJU2 = extract.obj fileio.obj globals.obj inflate.obj list.obj match.obj
162
OBJU3 = process.obj ttyio.obj ubz2err.obj unreduce.obj unshrink.obj zipinfo.obj
163
OBJUS = win32.obj win32i64.obj nt.obj $(TIMEZONE_OBJU)
164
OBJU  = $(OBJU1) $(OBJU2) $(OBJU3) $(OBJUS)
165
OBJX1 = unzipsfx.obj crc32_.obj $(CRCA_OX) crypt_.obj
166
OBJX2 = extract_.obj fileio_.obj globals_.obj inflate_.obj
167
OBJX3 = match_.obj process_.obj ttyio_.obj ubz2err_.obj
168
OBJXS = win32_.obj win32i64_.obj nt_.obj $(TIMEZONE_OBJX)
169
OBJX  = $(OBJX1) $(OBJX2) $(OBJX3) $(OBJXS)
170
OBJF1 = funzip.obj crc32f.obj $(CRCA_OF) cryptf.obj globalsf.obj
171
OBJF2 = inflatef.obj ttyiof.obj
172
OBJFS = win32f.obj win32i64f.obj
173
OBJF  = $(OBJF1) $(OBJF2) $(OBJFS)
174
OBJD1 = api.obj crc32l.obj $(CRCA_OL) cryptl.obj explodel.obj
175
OBJD2 = extractl.obj fileiol.obj globalsl.obj inflatel.obj
176
OBJD3 = listl.obj matchl.obj processl.obj
177
OBJD4 = ubz2errl.obj unreducl.obj unshrnkl.obj zipinfol.obj
178
OBJDS = win32l.obj win32i64l.obj ntl.obj windll.obj $(TIMEZONE_OBJD)
179
OBJD  = $(OBJD1) $(OBJD2) $(OBJD3) $(OBJD4) $(OBJDS)
180
OBLX1 = apig.obj crc32g.obj $(CRCA_OG) cryptg.obj
181
OBLX2 = extractg.obj fileiog.obj globalsg.obj inflateg.obj
182
OBLX3 = matchg.obj processg.obj
183
OBLXS = win32g.obj win32i64g.obj ntg.obj windllg.obj $(TIMEZONE_OBLX)
184
OBLX  = $(OBLX1) $(OBLX2) $(OBLX3) $(OBLXS)
185
OBGX  = sfxwiz.obj
186
OBJB1 = $(OB)apib.obj $(OB)crc32b.obj $(CRCA_OB) $(OB)cryptb.obj
187
OBJB2 = $(OB)explodeb.obj $(OB)extractb.obj $(OB)fileiob.obj $(OB)globalsb.obj
188
OBJB3 = $(OB)inflateb.obj $(OB)listb.obj $(OB)matchb.obj $(OB)processb.obj
189
OBJB4 = $(OB)ubz2errb.obj $(OB)unreducb.obj $(OB)unshrnkb.obj $(OB)zipinfob.obj
190
OBJBS = $(OB)win32b.obj $(OB)win32i64b.obj $(OB)ntb.obj $(OB)windllb.obj $(TIMEZONE_OBJB)
191
OBJB  = $(OBJB1) $(OBJB2) $(OBJB3) $(OBJB4) $(OBJBS)
192
 
193
UNZIP_H = unzip.h unzpriv.h globals.h win32/w32cfg.h
194
WINDLL_H = windll/windll.h windll/decs.h windll/structs.h
195
WINDLL_DEF = windll/windll32.def
196
WINDLL_IMP_H = windll/decs.h windll/structs.h
197
 
198
!if $(APPLY_ASMCRC) != 0
199
CFVARS_ASM = -DASM_CRC
200
!else
201
CFVARS_ASM = -DNO_ASM
202
!endif
203
 
204
!if $(USE_IZTIMEZONE) != 0
205
LOCAL_UNZIP = -DW32_USE_IZ_TIMEZONE $(LOCAL_UNZIP)
206
!endif
207
 
208
!if $(USE_UTF8) != 0
209
LOCAL_UNZIP = -DUNICODE_SUPPORT $(LOCAL_UNZIP)
210
!else
211
LOCAL_UNZIP = -DNO_UNICODE_SUPPORT $(LOCAL_UNZIP)
212
!endif
213
 
214
!ifndef NOCRC_OPT
215
LOCAL_UNZIP = -DIZ_CRCOPTIM_UNFOLDTBL $(LOCAL_UNZIP)
216
!endif
217
 
218
!ifdef USEZLIB
219
LOCAL_UNZIP = -DUSE_ZLIB $(LOCAL_UNZIP)
220
!endif
221
!ifdef USEBZ2
222
LOCAL_UNZIP = -DUSE_BZIP2 $(LOCAL_UNZIP)
223
!endif
224
 
225
#CF_LOC = -nologo -J -D_MBCS $(CFVARS_ASM) -DREENTRANT
226
CF_LOC = -nologo -J -D_MBCS $(CFVARS_ASM) $(LOCAL_UNZIP)
227
 
228
!if $(APPLY_ASMCRC) != 0
229
CRCA_O = crc_i386.obj
230
CRCA_OX = $(CRCA_O)
231
CRCA_OF = $(CRCA_O)
232
CRCA_OL = crci386l.obj
233
CRCA_OG = crci386g.obj
234
CRCA_OB = $(OB)crci386b.obj
235
!else
236
CRCA_O =
237
CRCA_OX =
238
CRCA_OF =
239
CRCA_OL =
240
CRCA_OG =
241
CRCA_OB =
242
!endif
243
 
244
!if $(USE_IZTIMEZONE) != 0
245
TIMEZONE_OBJU = timezone.obj
246
TIMEZONE_OBJX = timezon_.obj
247
TIMEZONE_OBJD = timezonl.obj
248
TIMEZONE_OBLX = timezolx.obj
249
TIMEZONE_OBJB = $(OB)timezonb.obj
250
!else
251
TIMEZONE_OBJU =
252
TIMEZONE_OBJX =
253
TIMEZONE_OBJD =
254
TIMEZONE_OBLX =
255
TIMEZONE_OBJB =
256
!endif
257
 
258
# binary declarations common to all platforms
259
cc     = cl
260
rc     = rc
261
link   = link
262
implib = lib
263
hc     = hcrtf -xn
264
 
265
# declarations common to all compiler options
266
cflags = -c -W3 -DCRTAPI1=_cdecl -DCRTAPI2=_cdecl -nologo
267
!IF "$(CPU)" == "i386"
268
cflags = $(cflags) -D_X86_=1
269
!ELSE
270
!IF "$(CPU)" == "ALPHA"
271
cflags = $(cflags) -D_ALPHA_=1
272
!ENDIF
273
!ENDIF
274
 
275
# for Windows applications that use the C Run-Time libraries
276
cvars      = -DWIN32 -D_WIN32
277
cvarsmt    = $(cvars) -MT
278
cvarsdll   = $(cvars) -MD
279
 
280
## The CRT library, depending on Compiler version and target configuration.
281
## This Makefile version has been changed to rely on the 'default library'
282
## notations in the compiled object files, to work around differences between
283
## MS Visual C++ releases concerning libraries support.
284
#libc = libc.lib oldnames.lib
285
#libcmt = libcmt.lib oldnames.lib
286
#libcdll = msvcrt.lib oldnames.lib
287
 
288
# optional profiling and tuning libraries
289
!IFDEF PROFILE
290
optlibs =  cap.lib
291
!ELSE
292
!IFDEF TUNE
293
optlibs = wst.lib
294
!ELSE
295
optlibs =
296
!ENDIF
297
!ENDIF
298
 
299
# USER32.LIB is needed for OemToChar and related routines
300
baselibs = kernel32.lib $(optlibs) advapi32.lib user32.lib
301
winlibs  = $(baselibs) gdi32.lib comdlg32.lib winspool.lib
302
conlibs = $(baselibs)
303
conlibsmt = $(baselibs)
304
conlibsdll = $(baselibs)
305
guilibs = $(winlibs)
306
guilibsdll = $(winlibs)
307
 
308
# Some optimization (if not debugging)
309
!IFDEF NODEBUG
310
cdebug = -O2
311
cdbgsz = -O1
312
!ELSE
313
!IFDEF PROFILE
314
cdebug = -Gh -Zd -Ox
315
!ELSE
316
!IFDEF TUNE
317
cdebug = -Gh -Zd -Ox
318
!ELSE
319
cdebug = -Z7 -Od
320
!ENDIF
321
!ENDIF
322
cdbgsz = $(cdebug)
323
!ENDIF
324
 
325
# declarations common to all linker options
326
lflags  = /INCREMENTAL:NO /PDB:NONE /NOLOGO
327
 
328
# for Windows applications that use the C Run-Time libraries
329
conlflags = $(lflags) /subsystem:console
330
guilflags = $(lflags) /subsystem:windows
331
dlllflags = $(lflags) /DLL
332
 
333
# -------------------------------------------------------------------------
334
# Target Module Dependent Link Debug Flags - must be specified after $(link)
335
#
336
# These switches allow the inclusion of the necessary symbolic information
337
# for source level debugging with WinDebug, profiling and/or performance
338
# tuning.
339
#
340
# Note: Debug switches are on by default.
341
# -------------------------------------------------------------------------
342
!IFDEF NODEBUG
343
ldebug = /RELEASE
344
!ELSE
345
!IFDEF PROFILE
346
ldebug = -debug:mapped,partial -debugtype:coff
347
!ELSE
348
!IFDEF TUNE
349
ldebug = -debug:mapped,partial -debugtype:coff
350
!ELSE
351
ldebug = -debug:full -debugtype:cv
352
!ENDIF
353
!ENDIF
354
!ENDIF
355
 
356
!ifdef PROFILEINFO
357
ldebug = $(ldebug) /PROFILE
358
!endif
359
 
360
!ifdef SYM
361
ldebug = $(ldebug) /DEBUG:FULL /DEBUGTYPE:CV
362
cdebug = $(cdebug) -Zi
363
cdbgsz = $(cdbgsz) -Zi
364
!endif
365
 
366
# When using zlib and/or bzip2 external decompression code DLLs, we want
367
# to link against the dll version of the C runtime library.
368
!IF defined(USEZLIBDLL) || defined(USEBZ2DLL) || defined(USE_DLLRUNTIME)
369
LINK_CRTDLL=1
370
!UNDEF DLLSTANDALONE
371
!ELSE
372
LINK_CRTDLL=0
373
!ENDIF
374
 
375
!IF $(LINK_CRTDLL) == 1
376
# Using zlib DLL as decompression core (and/or bzip2 decompression dll)
377
# implies linking all executables against the DLL version of the C RTL.
378
cvars_iz = $(cvarsdll) $(CF_LOC)
379
cvars_izdll = $(cvarsdll) $(CF_LOC)
380
conlibs_iz = $(conlibsdll) $(ZLIBLIBDLL) $(BZIPLIBEXE)
381
conlibs_izdll = $(conlibsdll) $(ZLIBLIBDLL) $(BZIPLIBDLL)
382
guilibs_iz = $(guilibsdll) $(ZLIBLIBDLL) $(BZIPLIBEXE)
383
!ELSE
384
# With the default setup (using Info-ZIP's own inflate code and/or static
385
# external decompression code), the executables are linked against the
386
# single-thread static C-RTL library to get self-contained programs.
387
cvars_iz = $(cvars) $(CF_LOC)
388
conlibs_iz = $(conlibs) $(ZLIBLIB) $(BZIPLIBEXE)
389
guilibs_iz = $(guilibs) $(ZLIBLIB) $(BZIPLIBEXE)
390
 
391
!IFDEF DLLSTANDALONE
392
# The standalone variant of unzip32.dll is linked against the
393
# multithread-safe static C runtime library.
394
cvars_izdll = $(cvarsmt) $(CF_LOC)
395
conlibs_izdll = $(conlibsmt) $(ZLIBLIB) $(BZIPLIBDLL)
396
!ELSE
397
# The (normal) variant of unzip32.dll is linked against the import library
398
# of the multithread-safe C runtime dll.
399
# -> smaller dll size; efficient use of shared resources,
400
#    but requires the C RTL DLL msvcrt.dll to be installed at runtime
401
cvars_izdll = $(cvarsdll) $(CF_LOC)
402
conlibs_izdll = $(conlibsdll) $(ZLIBLIBDLL) $(BZIPLIBDLL)
403
!ENDIF
404
!ENDIF # ?(LINK_CRTDLL == 1)
405
 
406
CFLAGS_UN = $(cdebug) $(cflags) $(INC_BZ2LIB) $(cvars_iz)
407
CFLAGS_SX = $(cdbgsz) $(cflags) $(INC_BZ2LIB) $(cvars_iz) -DSFX
408
CFLAGS_FU = $(cdebug) $(cflags) $(cvars_iz) -DFUNZIP
409
CFLAGS_DL = $(cdebug) $(cflags) $(INC_BZ2LIB) $(cvars_izdll) -DWINDLL -DDLL
410
CFLAGS_DX = $(cdebug) $(cflags) $(INC_BZ2LIB) $(cvars_izdll)
411
CFLAGS_SL = $(cdbgsz) $(cflags) $(INC_BZ2LIB) $(cvars_iz) -DWINDLL -DDLL -DUNZIPLIB -DSFX
412
CFLAGS_GX = $(cdbgsz) $(cflags) $(cvars_iz) -DSFX
413
CFLAGS_LB = $(cdebug) $(cflags) $(INC_BZ2LIB) $(cvars_iz) -DWINDLL -DDLL -DUNZIPLIB
414
 
415
# You may define VC6LINK if your linker recognizes "-opt:nowin98" alignment
416
# qualifier. (VC6 or newer). This option reduces the executable size of the
417
# SFX stubs (Instead, you might apply the free executable compressor "upx"
418
# which is far more efficient in reducing the stub's file size.)
419
!IFDEF VC6LINK
420
LINKOPT_SIZE = -opt:nowin98
421
!ENDIF
422
 
423
# How to compile sources
424
.c.obj:
425
	$(cc) $(CFLAGS_UN) -Fo$@ $<
426
 
427
# How to link
428
.obj.exe:
429
	$(link) $(ldebug) $(conlflags) $(conlibs_iz) $** -out:$@
430
 
431
 
432
# Default target is all command-line executables
433
unzips: unzip.exe funzip.exe unzipsfx.exe
434
guisfx: SFXWiz32.exe
435
dll: unzip32.dll
436
dllsample: uzexampl.exe
437
lib: $(OBDIR) $(OB)unzip32.lib
438
all: unzips guisfx dll dllsample lib
439
 
440
 
441
unzip.exe:	$(OBJU) $(BZIPLIBEXE) winapp.res
442
	$(link) $(ldebug) $(conlflags) $(conlibs_iz) $** -out:$@
443
unzipsfx.exe:	$(OBJX) $(BZIPLIBEXE)
444
	$(link) $(ldebug) $(conlflags) $(conlibs_iz) $** $(LINKOPT_SIZE) -out:$@
445
funzip.exe:	$(OBJF)
446
unzip32.dll:	$(OBJD) $(BZIPLIBDLL) windll.res $(WINDLL_DEF)
447
	$(link) $(ldebug) $(dlllflags) $(conlibs_izdll) -def:$(WINDLL_DEF) \
448
		$(OBJD) $(BZIPLIBDLL) windll.res -out:$@
449
unzsfx32.lib:	$(OBLX)
450
	$(link) -lib $** -out:$@
451
SFXWiz32.exe:	$(OBGX) sfxwiz.res unzsfx32.lib $(BZIPLIBEXE)
452
	$(link) $(ldebug) $(guilflags) $(guilibs_iz) \
453
		$(OBGX) sfxwiz.res unzsfx32.lib $(LINKOPT_SIZE) -out:$@
454
uzexampl.exe:	uzexampl.obj
455
	$(link) $(ldebug) $(conlflags) $(conlibs) version.lib $** -out:$@
456
$(OB)unzip32.lib:	$(OBJB)
457
	$(link) -lib $** -out:$@
458
 
459
$(IZ_BZIP2)/$(OBEXE)/bz2.lib:
460
	$(MAKE) -f $(IZ_BZIP2)/makbz2iz.msc \
461
	CFLSYS="$(cdebug) $(cflags) $(cvars_iz)" \
462
	BZROOTDIR=$(IZ_BZIP2) BZOBDIR=$(IZ_BZIP2)\$(OBEXE)
463
 
464
$(IZ_BZIP2)/$(OBDLL)/bz2.lib:
465
	$(MAKE) -f $(IZ_BZIP2)/makbz2iz.msc \
466
	CFLSYS="$(cdebug) $(cflags) $(cvars_izdll)" \
467
	BZROOTDIR=$(IZ_BZIP2) BZOBDIR=$(IZ_BZIP2)\$(OBDLL)
468
 
469
crc32.obj:	crc32.c $(UNZIP_H) zip.h crc32.h
470
crypt.obj:	crypt.c $(UNZIP_H) zip.h crypt.h crc32.h ttyio.h
471
envargs.obj:	envargs.c $(UNZIP_H)
472
explode.obj:	explode.c $(UNZIP_H)
473
extract.obj:	extract.c $(UNZIP_H) crc32.h crypt.h
474
fileio.obj:	fileio.c $(UNZIP_H) crc32.h crypt.h ttyio.h ebcdic.h
475
funzip.obj:	funzip.c $(UNZIP_H) crc32.h crypt.h ttyio.h
476
globals.obj:	globals.c $(UNZIP_H)
477
inflate.obj:	inflate.c inflate.h $(UNZIP_H)
478
list.obj:	list.c $(UNZIP_H)
479
match.obj:	match.c $(UNZIP_H)
480
process.obj:	process.c $(UNZIP_H) crc32.h
481
timezone.obj:	timezone.c $(UNZIP_H) zip.h timezone.h
482
ttyio.obj:	ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h
483
ubz2err.obj:	ubz2err.c $(UNZIP_H)
484
unreduce.obj:	unreduce.c $(UNZIP_H)
485
unshrink.obj:	unshrink.c $(UNZIP_H)
486
unzip.obj:	unzip.c $(UNZIP_H) crypt.h unzvers.h consts.h
487
zipinfo.obj:	zipinfo.c $(UNZIP_H)
488
 
489
win32.obj:	win32/win32.c $(UNZIP_H) win32/nt.h
490
	$(cc) $(CFLAGS_UN) -I. win32/win32.c -Fo$@
491
 
492
win32i64.obj:	win32/win32i64.c $(UNZIP_H)
493
	$(cc) $(CFLAGS_UN) -I. win32/win32i64.c -Fo$@
494
 
495
nt.obj:		win32/nt.c $(UNZIP_H) win32/nt.h
496
	$(cc) $(CFLAGS_UN) -I. win32/nt.c -Fo$@
497
 
498
!ifdef USEMASM
499
crc_i386.obj:	win32/crc_i386.asm
500
	masm -ml win32/crc_i386.asm,$@;
501
!else
502
!ifdef USEML
503
crc_i386.obj:	win32/crc_i386.asm
504
	ml -c -Cp -coff -Fo$@ win32/crc_i386.asm
505
!else
506
crc_i386.obj:	win32/crc_i386.c
507
	$(cc) $(CFLAGS_UN) -I. win32/crc_i386.c -Fo$@
508
!endif
509
!endif
510
 
511
# UnZipSFX compilation section
512
crc32_.obj:	crc32.c $(UNZIP_H) zip.h crc32.h
513
	$(cc) $(CFLAGS_SX) crc32.c -Fo$@
514
crypt_.obj:	crypt.c $(UNZIP_H) zip.h crypt.h crc32.h ttyio.h
515
	$(cc) $(CFLAGS_SX) crypt.c -Fo$@
516
extract_.obj:	extract.c $(UNZIP_H) crc32.h crypt.h
517
	$(cc) $(CFLAGS_SX) extract.c -Fo$@
518
fileio_.obj:	fileio.c $(UNZIP_H) crc32.h crypt.h ttyio.h ebcdic.h
519
	$(cc) $(CFLAGS_SX) fileio.c -Fo$@
520
globals_.obj:	globals.c $(UNZIP_H)
521
	$(cc) $(CFLAGS_SX) globals.c -Fo$@
522
inflate_.obj:	inflate.c inflate.h $(UNZIP_H) crypt.h
523
	$(cc) $(CFLAGS_SX) inflate.c -Fo$@
524
match_.obj:	match.c $(UNZIP_H)
525
	$(cc) $(CFLAGS_SX) match.c -Fo$@
526
process_.obj:	process.c $(UNZIP_H) crc32.h
527
	$(cc) $(CFLAGS_SX) process.c -Fo$@
528
timezon_.obj:	timezone.c $(UNZIP_H) zip.h timezone.h
529
	$(cc) $(CFLAGS_SX) timezone.c -Fo$@
530
ttyio_.obj:	ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h
531
	$(cc) $(CFLAGS_SX) ttyio.c -Fo$@
532
ubz2err_.obj:	ubz2err.c $(UNZIP_H)
533
	$(cc) $(CFLAGS_SX) ubz2err.c -Fo$@
534
unzipsfx.obj:	unzip.c $(UNZIP_H) crypt.h unzvers.h consts.h
535
	$(cc) $(CFLAGS_SX) unzip.c -Fo$@
536
 
537
win32_.obj:	win32/win32.c $(UNZIP_H) win32/nt.h
538
	$(cc) $(CFLAGS_SX) -I. win32/win32.c -Fo$@
539
 
540
win32i64_.obj:	win32/win32i64.c $(UNZIP_H)
541
	$(cc) $(CFLAGS_SX) -I. win32/win32i64.c -Fo$@
542
 
543
nt_.obj:	win32/nt.c $(UNZIP_H) win32/nt.h
544
	$(cc) $(CFLAGS_SX) -I. win32/nt.c -Fo$@
545
 
546
# fUnZip compilation section
547
crc32f.obj:	crc32.c $(UNZIP_H) zip.h crc32.h
548
	$(cc) $(CFLAGS_FU) crc32.c -Fo$@
549
cryptf.obj:	crypt.c $(UNZIP_H) zip.h crypt.h crc32.h ttyio.h
550
	$(cc) $(CFLAGS_FU) crypt.c -Fo$@
551
globalsf.obj:	globals.c $(UNZIP_H)
552
	$(cc) $(CFLAGS_FU) globals.c -Fo$@
553
inflatef.obj:	inflate.c inflate.h $(UNZIP_H) crypt.h
554
	$(cc) $(CFLAGS_FU) inflate.c -Fo$@
555
ttyiof.obj:	ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h
556
	$(cc) $(CFLAGS_FU) ttyio.c -Fo$@
557
 
558
win32f.obj:	win32/win32.c $(UNZIP_H) win32/nt.h
559
	$(cc) $(CFLAGS_FU) -I. win32/win32.c -Fo$@
560
 
561
win32i64f.obj:	win32/win32i64.c $(UNZIP_H)
562
	$(cc) $(CFLAGS_FU) -I. win32/win32i64.c -Fo$@
563
 
564
# DLL compilation section
565
api.obj:	api.c $(UNZIP_H) $(WINDLL_H) unzvers.h
566
	$(cc) $(CFLAGS_DL) api.c -Fo$@
567
crc32l.obj:	crc32.c $(UNZIP_H) zip.h crc32.h
568
	$(cc) $(CFLAGS_DL) crc32.c -Fo$@
569
cryptl.obj:	crypt.c $(UNZIP_H) zip.h crypt.h crc32.h ttyio.h
570
	$(cc) $(CFLAGS_DL) crypt.c -Fo$@
571
explodel.obj:	explode.c $(UNZIP_H)
572
	$(cc) $(CFLAGS_DL) explode.c -Fo$@
573
extractl.obj:	extract.c $(UNZIP_H) $(WINDLL_H) crc32.h crypt.h
574
	$(cc) $(CFLAGS_DL) extract.c -Fo$@
575
fileiol.obj:	fileio.c $(UNZIP_H) $(WINDLL_H) crc32.h crypt.h ttyio.h ebcdic.h
576
	$(cc) $(CFLAGS_DL) fileio.c -Fo$@
577
globalsl.obj:	globals.c $(UNZIP_H)
578
	$(cc) $(CFLAGS_DL) globals.c -Fo$@
579
inflatel.obj:	inflate.c inflate.h $(UNZIP_H)
580
	$(cc) $(CFLAGS_DL) inflate.c -Fo$@
581
listl.obj:	list.c $(UNZIP_H) $(WINDLL_H)
582
	$(cc) $(CFLAGS_DL) list.c -Fo$@
583
matchl.obj:	match.c $(UNZIP_H)
584
	$(cc) $(CFLAGS_DL) match.c -Fo$@
585
processl.obj:	process.c $(UNZIP_H) $(WINDLL_H) crc32.h
586
	$(cc) $(CFLAGS_DL) process.c -Fo$@
587
timezonl.obj:	timezone.c $(UNZIP_H) zip.h timezone.h
588
	$(cc) $(CFLAGS_DL) timezone.c -Fo$@
589
ubz2errl.obj:	ubz2err.c $(UNZIP_H)
590
	$(cc) $(CFLAGS_DL) ubz2err.c -Fo$@
591
unreducl.obj:	unreduce.c $(UNZIP_H)
592
	$(cc) $(CFLAGS_DL) unreduce.c -Fo$@
593
unshrnkl.obj:	unshrink.c $(UNZIP_H)
594
	$(cc) $(CFLAGS_DL) unshrink.c -Fo$@
595
zipinfol.obj:	zipinfo.c $(UNZIP_H)
596
	$(cc) $(CFLAGS_DL) zipinfo.c -Fo$@
597
 
598
win32l.obj:	win32/win32.c $(UNZIP_H) win32/nt.h
599
	$(cc) $(CFLAGS_DL) -I. win32/win32.c -Fo$@
600
 
601
win32i64l.obj:	win32/win32i64.c $(UNZIP_H)
602
	$(cc) $(CFLAGS_DL) -I. win32/win32i64.c -Fo$@
603
 
604
ntl.obj:	win32/nt.c $(UNZIP_H) win32/nt.h
605
	$(cc) $(CFLAGS_DL) -I. win32/nt.c -Fo$@
606
 
607
windll.obj:  windll/windll.c $(UNZIP_H) $(WINDLL_H) crypt.h unzvers.h consts.h
608
	$(cc) $(CFLAGS_DL) -I. windll/windll.c -Fo$@
609
 
610
!ifdef USEMASM
611
crci386l.obj:	win32/crc_i386.asm
612
	masm -ml win32/crc_i386.asm,$@;
613
!else
614
!ifdef USEML
615
crci386l.obj:	win32/crc_i386.asm
616
	ml -c -Cp -coff -Fo$@ win32/crc_i386.asm
617
!else
618
crci386l.obj:	win32/crc_i386.c
619
	$(cc) $(CFLAGS_DL) -I. win32/crc_i386.c -Fo$@
620
!endif
621
!endif
622
 
623
winapp.res:	win32/winapp.rc unzvers.h
624
	$(rc) /l 0x409 /fo$@ /i win32 /d WIN32 win32/winapp.rc
625
 
626
windll.res:	windll/windll.rc unzvers.h
627
	$(rc) /l 0x409 /fo$@ /i windll /d WIN32 windll/windll.rc
628
 
629
uzexampl.obj:	windll/uzexampl.c windll/uzexampl.h
630
	$(cc) $(CFLAGS_DX) -I. windll/uzexampl.c -Fo$@
631
 
632
# SFX Lib compilation section
633
apig.obj:	api.c $(UNZIP_H) $(WINDLL_H) unzvers.h
634
	$(cc) $(CFLAGS_SL) api.c -Fo$@
635
crc32g.obj:	crc32.c $(UNZIP_H) zip.h crc32.h
636
	$(cc) $(CFLAGS_SL) crc32.c -Fo$@
637
cryptg.obj:	crypt.c $(UNZIP_H) zip.h crypt.h crc32.h ttyio.h
638
	$(cc) $(CFLAGS_SL) crypt.c -Fo$@
639
extractg.obj:	extract.c $(UNZIP_H) $(WINDLL_H) crc32.h crypt.h
640
	$(cc) $(CFLAGS_SL) extract.c -Fo$@
641
fileiog.obj:	fileio.c $(UNZIP_H) $(WINDLL_H) crc32.h crypt.h ttyio.h ebcdic.h
642
	$(cc) $(CFLAGS_SL) fileio.c -Fo$@
643
globalsg.obj:	globals.c $(UNZIP_H)
644
	$(cc) $(CFLAGS_SL) globals.c -Fo$@
645
inflateg.obj:	inflate.c inflate.h $(UNZIP_H)
646
	$(cc) $(CFLAGS_SL) inflate.c -Fo$@
647
matchg.obj:	match.c $(UNZIP_H)
648
	$(cc) $(CFLAGS_SL) match.c -Fo$@
649
processg.obj:	process.c $(UNZIP_H) $(WINDLL_H) crc32.h
650
	$(cc) $(CFLAGS_SL) process.c -Fo$@
651
timezong.obj:	timezone.c $(UNZIP_H) zip.h timezone.h
652
	$(cc) $(CFLAGS_SL) timezone.c -Fo$@
653
ubz2errg.obj:	ubz2err.c $(UNZIP_H)
654
	$(cc) $(CFLAGS_SL) ubz2err.c -Fo$@
655
 
656
win32g.obj:	win32/win32.c $(UNZIP_H) win32/nt.h
657
	$(cc) $(CFLAGS_SL) -I. win32/win32.c -Fo$@
658
 
659
win32i64g.obj:	win32/win32i64.c $(UNZIP_H)
660
	$(cc) $(CFLAGS_SL) -I. win32/win32i64.c -Fo$@
661
 
662
ntg.obj:	win32/nt.c $(UNZIP_H) win32/nt.h
663
	$(cc) $(CFLAGS_SL) -I. win32/nt.c -Fo$@
664
 
665
windllg.obj:  windll/windll.c $(UNZIP_H) $(WINDLL_H) crypt.h unzvers.h consts.h
666
	$(cc) $(CFLAGS_SL) -I. windll/windll.c -Fo$@
667
 
668
!ifdef USEMASM
669
crci386g.obj:	win32/crc_i386.asm
670
	masm -ml win32/crc_i386.asm,$@;
671
!else
672
!ifdef USEML
673
crci386g.obj:	win32/crc_i386.asm
674
	ml -c -Cp -coff -Fo$@ win32/crc_i386.asm
675
!else
676
crci386g.obj:	win32/crc_i386.c
677
	$(cc) $(CFLAGS_SL) -I. win32/crc_i386.c -Fo$@
678
!endif
679
!endif
680
 
681
sfxwiz.obj:	windll/guisfx/sfxwiz.c windll/guisfx/dialog.h $(WINDLL_IMP_H)
682
	$(cc) $(CFLAGS_GX) windll/guisfx/sfxwiz.c -Fo$@
683
 
684
sfxwiz.res:	windll/guisfx/sfxwiz.rc
685
	$(rc) /l 0x409 /fo$@ /i windll/guisfx /d WIN32 windll/guisfx/sfxwiz.rc
686
 
687
# static LIB compilation section
688
$(OB)apib.obj:	api.c $(UNZIP_H) $(WINDLL_H) unzvers.h
689
	$(cc) $(CFLAGS_LB) api.c -Fo$@
690
$(OB)crc32b.obj:	crc32.c $(UNZIP_H) zip.h crc32.h
691
	$(cc) $(CFLAGS_LB) crc32.c -Fo$@
692
$(OB)cryptb.obj:	crypt.c $(UNZIP_H) zip.h crypt.h crc32.h ttyio.h
693
	$(cc) $(CFLAGS_LB) crypt.c -Fo$@
694
$(OB)explodeb.obj:	explode.c $(UNZIP_H)
695
	$(cc) $(CFLAGS_LB) explode.c -Fo$@
696
$(OB)extractb.obj:	extract.c $(UNZIP_H) $(WINDLL_H) crc32.h crypt.h
697
	$(cc) $(CFLAGS_LB) extract.c -Fo$@
698
$(OB)fileiob.obj:	fileio.c $(UNZIP_H) $(WINDLL_H) crc32.h crypt.h ttyio.h ebcdic.h
699
	$(cc) $(CFLAGS_LB) fileio.c -Fo$@
700
$(OB)globalsb.obj:	globals.c $(UNZIP_H)
701
	$(cc) $(CFLAGS_LB) globals.c -Fo$@
702
$(OB)inflateb.obj:	inflate.c inflate.h $(UNZIP_H)
703
	$(cc) $(CFLAGS_LB) inflate.c -Fo$@
704
$(OB)listb.obj:	list.c $(UNZIP_H) $(WINDLL_H)
705
	$(cc) $(CFLAGS_LB) list.c -Fo$@
706
$(OB)matchb.obj:	match.c $(UNZIP_H)
707
	$(cc) $(CFLAGS_LB) match.c -Fo$@
708
$(OB)processb.obj:	process.c $(UNZIP_H) $(WINDLL_H) crc32.h
709
	$(cc) $(CFLAGS_LB) process.c -Fo$@
710
$(OB)timezonb.obj:	timezone.c $(UNZIP_H) zip.h timezone.h
711
	$(cc) $(CFLAGS_LB) timezone.c -Fo$@
712
$(OB)ubz2errb.obj:	ubz2err.c $(UNZIP_H)
713
	$(cc) $(CFLAGS_LB) ubz2err.c -Fo$@
714
$(OB)unreducb.obj:	unreduce.c $(UNZIP_H)
715
	$(cc) $(CFLAGS_LB) unreduce.c -Fo$@
716
$(OB)unshrnkb.obj:	unshrink.c $(UNZIP_H)
717
	$(cc) $(CFLAGS_LB) unshrink.c -Fo$@
718
$(OB)zipinfob.obj:	zipinfo.c $(UNZIP_H)
719
	$(cc) $(CFLAGS_LB) zipinfo.c -Fo$@
720
 
721
$(OB)win32b.obj:	win32/win32.c $(UNZIP_H) win32/nt.h
722
	$(cc) $(CFLAGS_LB) -I. win32/win32.c -Fo$@
723
 
724
$(OB)win32i64b.obj:	win32/win32i64.c $(UNZIP_H)
725
	$(cc) $(CFLAGS_LB) -I. win32/win32i64.c -Fo$@
726
 
727
$(OB)ntb.obj:	win32/nt.c $(UNZIP_H) win32/nt.h
728
	$(cc) $(CFLAGS_LB) -I. win32/nt.c -Fo$@
729
 
730
$(OB)windllb.obj:  windll/windll.c $(UNZIP_H) $(WINDLL_H) crypt.h unzvers.h consts.h
731
	$(cc) $(CFLAGS_LB) -I. windll/windll.c -Fo$@
732
 
733
!ifdef USEMASM
734
$(OB)crci386b.obj:	win32/crc_i386.asm
735
	masm -ml win32/crc_i386.asm,$@;
736
!else
737
!ifdef USEML
738
$(OB)crci386b.obj:	win32/crc_i386.asm
739
	ml -c -Cp -coff -Fo$@ win32/crc_i386.asm
740
!else
741
$(OB)crci386b.obj:	win32/crc_i386.c
742
	$(cc) $(CFLAGS_LB) -I. win32/crc_i386.c -Fo$@
743
!endif
744
!endif
745
 
746
$(OBDIR):
747
	-mkdir $@
748
 
749
clean:	clean_bz2exe_lib clean_bz2dll_lib
750
	-del *.obj
751
	-del winapp.res
752
	-del unzip.exe
753
	-del unzip.pdb
754
	-del funzip.exe
755
	-del funzip.pdb
756
	-del unzipsfx.exe
757
	-del unzipsfx.pdb
758
	-del vc60.pdb
759
	-del sfxwiz.res
760
	-del SFXWiz32.exe
761
	-del windll.res
762
	-del unzip32.dll
763
	-del unzip32.lib
764
	-del unzip32.exp
765
	-del unzip32.dll.manifest
766
	-del uzexampl.exe
767
	-del unzsfx32.lib
768
	-del $(OBDIR)\*.obj
769
	-del $(OBDIR)\unzip32.lib
770
	-rmdir $(OBDIR)
771
 
772
clean_bz2exe_lib:
773
	-$(MAKE) -f $(IZ_BZIP2)/makbz2iz.msc \
774
	BZROOTDIR=$(IZ_BZIP2) BZOBDIR=$(IZ_BZIP2)\$(OBEXE) clean
775
 
776
clean_bz2dll_lib:
777
	-$(MAKE) -f $(IZ_BZIP2)/makbz2iz.msc \
778
	BZROOTDIR=$(IZ_BZIP2) BZOBDIR=$(IZ_BZIP2)\$(OBDLL) clean