Subversion Repositories Kolibri OS

Rev

Rev 6727 | Rev 6764 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
6725 siemargl 1
# Makefile for UnZip, fUnZip and UnZipSFX for native Win32-Intel ports of gcc.
2
# Currently supported implementations: Cygnus/Win32 and MinGW32.
3
#
4
# First version: Cosmin Truta, Dec 1997.
5
# Last revision: Christian Spieler, 09-Aug-2008.
6
#
7
# To use, do "make -f win32/makefile.gcc".
8
 
9
# configuration switches supported:
10
#   NOASM=1     disable assembler crc32 code, the generic C source code
11
#               is used instead.
12
#   NOCRC_OPT=1 disable "unfolding CRC tables" optimization.
13
#   OPT_P6=1    add "modern gcc" tuning option for PentiumPro family CPU.
14
#   USEBZ2=1    activate integrated compilation of bzip2 compression support,
15
#               this requires the bzip2 sources present in the bzip2 subfolder.
16
#   USEZLIB=1   replace internal deflate code by externally provided zlib.
17
#   USE_POSIX=1 build posix-style binaries targeted for the CygWin unix
18
#               emulation environment.
19
SDK_DIR:= $(abspath ../../../contrib/sdk)
20
NOASM=1
21
CC_CPU_OPT=-march=pentium
6745 siemargl 22
#USEZLIB=1
6725 siemargl 23
 
24
### Optional section
25
 
26
# The following options allow to override the default assembler code usage
27
ifdef NOASM
28
APPLY_ASMCRC=0
29
endif
30
ifdef USEASM
31
APPLY_ASMCRC=1
32
endif
33
 
34
# The external zlib library supplies its own crc32 implementation...
35
ifdef USEZLIB
36
APPLY_ASMCRC=0
37
endif
38
 
39
# default is ASM CRC code (from .S source) for now...
40
ifndef APPLY_ASMCRC
41
APPLY_ASMCRC=1
42
endif
43
 
44
# optional inclusion of bzip2 decompression
45
IZ_BZIP2 = bzip2
46
ifdef USEBZ2
47
INC_BZ2LIB = -I$(IZ_BZIP2)
48
LOCFLAGS = $(INC_BZ2LIB) -DUSE_BZIP2
49
LD_BZ2LIB = -L$(IZ_BZIP2) -lbz2
50
LIBBZIP2 = $(IZ_BZIP2)/libbz2.a
51
else
52
INC_BZ2LIB =
53
LOCFLAGS =
54
LD_BZ2LIB =
55
LIBBZIP2 =
56
endif
57
LIBBZIP2X = $(LIBBZIP2)
58
 
59
ifndef USEZLIB
60
 
61
# Apply the "CRC unfolding tables" optimization unless explicitly disabled.
62
# (This optimization might have negative effects on old CPU designs with a
63
# small first-level data cache.)
64
ifndef NOCRC_OPT
65
LOCFLAGS += -DIZ_CRCOPTIM_UNFOLDTBL
66
endif
67
 
68
# Optional nonstandard preprocessor flags (as -DUSE_ZLIB or -DUSE_SMITH_CODE)
69
# should be added to the environment via "set LOCAL_UNZIP=-DFOO" or added
70
# to the declaration of LOCFLAGS here:
71
ifneq ($(APPLY_ASMCRC),0)
72
LOCFLAGS += -DASM_CRC
73
endif
74
 
75
else    # ifndef USEZLIB
76
 
77
LOCFLAGS += -DUSE_ZLIB
78
 
79
endif   # ifndef USEZLIB ... else ...
80
 
81
# Finally, append additional externally supplied options.
82
LOCFLAGS += $(LOCAL_UNZIP)
83
 
84
# Some gcc distributions for Win32 (e.g. CygWin) try to emulate a POSIX-
85
# compatible (Unix-style) environment.  This Makefile defaults to a
86
# "native Win32" build.  To build POSIX-mode binaries, it is recommended
87
# to use the Makefile of the Unix port.  However, by defining the variable
88
# "USE_POSIX", building binaries for the POSIX environment can be enabled
89
# here as well.
90
ifdef 0
91
ifdef USE_POSIX
92
CC_ENVIR_OPT = -DUNIX -DFORCE_UNIX_OVER_WIN32
93
else
94
CC_ENVIR_OPT = -DWIN32 -DFORCE_WIN32_OVER_UNIX
95
endif
96
endif
97
### kolibri specific
6745 siemargl 98
INCLUDES= -I $(SDK_DIR)/sources/newlib/libc/include -I $(SDK_DIR)/sources/zlib
6725 siemargl 99
LIBPATH = -L $(SDK_DIR)/lib -L /home/autobuild/tools/win32/mingw32/lib
100
 
101
CC_ENVIR_OPT = -U__WIN32__ -U_Win32 -U_WIN32 -U__MINGW32__ -UWIN32 -DKOS32 \
102
	$(INCLUDES)
103
 
104
### Compiler-specific section
105
 
106
# ------------ GNU C ------------
107
CC = kos32-gcc
108
 
109
#AS = as
110
AS = $(CC)
111
 
112
LD = kos32-ld
113
###LD = $(CC)
114
 
115
AR = ar
116
 
117
###RC = windres
118
 
119
# Quiet
120
CC_QUIET_OPT =
121
AS_QUIET_OPT = $(CC_QUIET_OPT)
122
LD_QUIET_OPT = $(CC_QUIET_OPT)
123
 
124
# Warnings
125
CC_WARN_OPT = -Wall
126
AS_WARN_OPT = $(CC_WARN_OPT)
127
LD_WARN_OPT =
128
 
129
# Debug version
130
CC_DEBUG_OPT = -g
131
AS_DEBUG_OPT = $(CC_DEBUG_OPT)
132
LD_DEBUG_OPT = $(CC_DEBUG_OPT)
133
 
134
# Release version
135
CC_RELEASE_OPT =
136
AS_RELEASE_OPT =
137
LD_RELEASE_OPT = -s
138
 
139
# Prefered target CPU (instruction scheduling optimized for...)
140
ifndef CC_CPU_OPT
141
CC_CPU_OPT = -mcpu=pentiumpro
142
endif
143
 
144
# Smallest code  (-Os is new since EGC 1.1, use -O1 for 2.8.1 and earlier)
145
CC_SIZE_OPT = -Os $(CC_CPU_OPT)
146
 
147
# Fastest code
148
CC_SPEED_OPT = -O2 $(CC_CPU_OPT)
149
 
150
# Output object file name
151
CC_OUT_OPT = -o
152
 
153
# Other specific options
154
CC_SPECIFIC_OPT = -c $(CC_ENVIR_OPT)
155
AS_SPECIFIC_OPT = -c
6745 siemargl 156
LD_SPECIFIC_OPT = -o $@ -static -S -nostdlib -T $(SDK_DIR)/sources/newlib/app-dynamic.lds \
6725 siemargl 157
          --image-base 0 $(LIBPATH)
158
 
159
# Libraries for the debug & release version
160
# (GCC 2.95 and newer does not require the system library specifications)
6745 siemargl 161
# -lapp only for gcc 4.8
6725 siemargl 162
ifdef USEZLIB
6745 siemargl 163
LD_RELEASE_LIBS = -lz -lgcc -ldll -lc.dll -lapp
6725 siemargl 164
else
6745 siemargl 165
LD_RELEASE_LIBS = -lgcc -ldll -lc.dll -lapp
6725 siemargl 166
endif
167
LD_DEBUG_LIBS = $(LD_RELEASE_LIBS)
168
 
169
 
170
### System-specific section
171
 
172
# Suffixes
173
OBJ = .o
6745 siemargl 174
EXE = .
6725 siemargl 175
 
176
.SUFFIXES: .c .S $(OBJ) $(EXE)
177
.PHONY: FORCE
178
 
179
# Commands
180
RM = del /q
181
 
182
 
183
### General section
184
 
185
CFLAGS  = $(CC_SPECIFIC_OPT) $(CC_QUIET_OPT) $(CC_WARN_OPT) $(LOCFLAGS) \
186
 $(CC_OUT_OPT) $@
187
ASFLAGS = $(AS_SPECIFIC_OPT) $(AS_QUIET_OPT) $(AS_WARN_OPT) $(LOCFLAGS)
188
LDFLAGS = $(LD_SPECIFIC_OPT) $(LD_QUIET_OPT) $(LD_WARN_OPT)
189
 
190
# To build with debug info, use 'make DEBUG=1'.
191
ifdef DEBUG
192
CVER     = $(CC_DEBUG_OPT)
193
ASVER    = $(AS_DEBUG_OPT)
194
LDVER    = $(LD_DEBUG_OPT)
195
GENFLAGS =
196
FFLAGS   = -DFUNZIP
197
SFXFLAGS = -DSFX
198
GENDLLFL = -DDLL -DWINDLL
199
GENGUILB = -DSFX -DDLL -DWINDLL -DUNZIPLIB
200
GENGUISX = -DSFX
201
GENLIBFL = -DDLL -DWINDLL -DUNZIPLIB
202
LDLIBS   = $(LD_DEBUG_LIBS)
203
else
204
CVER     = $(CC_RELEASE_OPT)
205
ASVER    = $(AS_RELEASE_OPT)
206
LDVER    = $(LD_RELEASE_OPT)
207
GENFLAGS = $(CC_SPEED_OPT)
208
FFLAGS   = $(CC_SPEED_OPT) -DFUNZIP
209
SFXFLAGS = $(CC_SIZE_OPT) -DSFX
210
GENDLLFL = $(CC_SPEED_OPT) -DDLL -DWINDLL
211
GENGUILB = $(CC_SIZE_OPT) -DSFX -DDLL -DWINDLL -DUNZIPLIB
212
GENGUISX = $(CC_SIZE_OPT) -DSFX
213
GENLIBFL = $(CC_SPEED_OPT) -DDLL -DWINDLL -DUNZIPLIB
214
LDLIBS   = $(LD_RELEASE_LIBS)
215
endif
216
GUILDFLAG=-mwindows
217
 
218
# Object files
219
ifneq ($(APPLY_ASMCRC),0)
220
OBJA  = crc_i386$(OBJ)
221
else
222
OBJA  =
223
endif
224
OBJU1 = unzip$(OBJ) crc32$(OBJ) crypt$(OBJ) envargs$(OBJ)
225
OBJU2 = explode$(OBJ) extract$(OBJ) fileio$(OBJ) globals$(OBJ) inflate$(OBJ)
226
OBJU3 = list$(OBJ) match$(OBJ) process$(OBJ) ttyio$(OBJ) ubz2err$(OBJ)
227
OBJU4 = unreduce$(OBJ) unshrink$(OBJ) zipinfo$(OBJ)
228
OBJUS= kos32$(OBJ) dirent$(OBJ)
229
###OBJUS = win32$(OBJ) win32i64$(OBJ) nt$(OBJ) winapprc$(OBJ)
230
OBJU  = $(OBJU1) $(OBJU2) $(OBJU3) $(OBJU4) $(OBJA) $(OBJUS)
231
OBJX1 = unzipsfx$(OBJ) crc32x$(OBJ) cryptx$(OBJ) extractx$(OBJ)
232
OBJX2 = fileiox$(OBJ) globalsx$(OBJ) inflatex$(OBJ) matchx$(OBJ) processx$(OBJ)
233
OBJX3 = ttyiox$(OBJ) ubz2errx$(OBJ)
234
###OBJXS = win32x$(OBJ) win32i64x$(OBJ) ntx$(OBJ)
235
OBJX  = $(OBJX1) $(OBJX2) $(OBJX3) $(OBJA) $(OBJXS)
236
OBJF1 = funzip$(OBJ) crc32$(OBJ) cryptf$(OBJ) globalsf$(OBJ) inflatef$(OBJ)
237
OBJF2 = ttyiof$(OBJ)
238
###OBJFS = win32f$(OBJ) win32i64f$(OBJ)
239
OBJF  = $(OBJF1) $(OBJF2) $(OBJA) $(OBJFS)
240
OBJDLL = windll$(OBJ) windllrc$(OBJ) api$(OBJ)
241
OBJD1 = crc32l$(OBJ) cryptl$(OBJ)
242
OBJD2 = explodel$(OBJ) extractl$(OBJ) fileiol$(OBJ) globalsl$(OBJ)
243
OBJD3 = inflatel$(OBJ) listl$(OBJ) matchl$(OBJ) processl$(OBJ) ubz2errl$(OBJ)
244
OBJD4 = unreducl$(OBJ) unshrnkl$(OBJ) zipinfol$(OBJ)
245
###OBJDS = win32l$(OBJ) win32i64l$(OBJ) ntl$(OBJ)
246
OBJD  = $(OBJDLL) $(OBJD1) $(OBJD2) $(OBJD3) $(OBJD4) $(OBJA) $(OBJDS)
247
OBLX1 = apig$(OBJ) crc32g$(OBJ) cryptg$(OBJ)
248
OBLX2 = extractg$(OBJ) fileiog$(OBJ) globalsg$(OBJ) inflateg$(OBJ)
249
OBLX3 = matchg$(OBJ) processg$(OBJ) ubz2errg$(OBJ)
250
###OBLXS = win32g$(OBJ) win32i64g$(OBJ) ntg$(OBJ) windllg$(OBJ)
251
OBLX  = $(OBLX1) $(OBLX2) $(OBLX3) $(OBJA) $(OBLXS)
252
OBGX  = sfxwiz$(OBJ) sfxwizrc$(OBJ)
253
OBJLIB = windllb$(OBJ) apib$(OBJ)
254
OBJB1 = crc32b$(OBJ) cryptb$(OBJ)
255
OBJB2 = explodeb$(OBJ) extractb$(OBJ) fileiob$(OBJ) globalsb$(OBJ)
256
OBJB3 = inflateb$(OBJ) listb$(OBJ) matchb$(OBJ) processb$(OBJ) ubz2errb$(OBJ)
257
OBJB4 = unreducb$(OBJ) unshrnkb$(OBJ) zipinfob$(OBJ)
258
###OBJBS = win32b$(OBJ) win32i64b$(OBJ) ntb$(OBJ)
259
OBJB  = $(OBJLIB) $(OBJB1) $(OBJB2) $(OBJB3) $(OBJB4) $(OBJA) $(OBJBS)
260
 
261
UNZIP_H = unzip.h unzpriv.h globals.h
262
###win32/w32cfg.h
263
###WINDLL_H = windll/windll.h windll/structs.h windll/decs.h
264
###DLLDEF = windll/windllgcc.def
265
###WINDLL_IMP_H = windll/decs.h windll/structs.h
266
 
267
 
268
# Default target is all the executables
269
###unzips: unzip$(EXE) funzip$(EXE) unzipsfx$(EXE)
270
###dll:    unzip32.dll
271
###dllsample: uzexampl$(EXE)
272
###guisfx: SFXWiz32$(EXE)
273
#lib:    libunzip32.a
274
###all:    unzips dll dllsample guisfx lib
275
all:    unzip$(EXE)
276
 
277
unzip$(EXE): $(OBJU) $(LIBBZIP2)
6745 siemargl 278
	$(LD) $(LDFLAGS) $(LDVER) $(OBJU) $(LD_BZ2LIB) $(LDLIBS) -Map=unzip.map
6725 siemargl 279
	kos32-objcopy $@ -O binary
280
 
281
unzipsfx$(EXE): $(OBJX) $(LIBBZIP2X)
282
	$(LD) $(LDFLAGS) $(LDVER) $(OBJX) $(LDLIBS)
283
 
284
funzip$(EXE): $(OBJF)
285
	$(LD) $(LDFLAGS) $(LDVER) $(OBJF) $(LDLIBS)
286
 
287
unzip32.dll: $(DLLDEF) $(OBJD) $(LIBBZIP2)
288
	dllwrap --driver-name $(CC) --def $(DLLDEF) $(LDFLAGS) $(LDVER) $(OBJD) $(LD_BZ2LIB) $(LDLIBS)
289
 
290
libunzsfx32.a: $(OBLX)
291
	$(AR) -rus $@ $(OBLX)
292
 
293
SFXWiz32$(EXE): $(OBGX) libunzsfx32.a $(LIBBZIP2X)
294
	$(LD) $(GUILDFLAG) $(LDFLAGS) $(LDVER) $(OBGX) -L. -lunzsfx32 $(LDLIBS)
295
 
296
uzexampl$(EXE): uzexampl$(OBJ)
297
	$(CC) $(LDFLAGS) $(LDVER) uzexampl$(OBJ) -lversion $(LDLIBS)
298
 
299
libunzip32.a: $(OBJB)
300
	$(AR) -rus $@ $(OBJB)
301
 
302
 
303
# create/update the library for the optional bzip2 support:
304
$(IZ_BZIP2)/libbz2.a: FORCE
305
	$(subst /,\,$(MAKE)) -C $(IZ_BZIP2) -f Makebz2.iz CC="$(CC)" RM="$(RM)"
306
FORCE:
307
 
308
# How to compile sources
309
.c$(OBJ):
310
	$(CC) $(CFLAGS) $(CVER) $(GENFLAGS) $<
311
.S$(OBJ):
312
	$(AS) $(ASFLAGS) $(ASVER) $(GENFLAGS) $<
313
 
314
# Dependencies
315
crc32$(OBJ):    crc32.c $(UNZIP_H) zip.h crc32.h
316
crypt$(OBJ):    crypt.c $(UNZIP_H) zip.h crypt.h crc32.h ttyio.h
317
envargs$(OBJ):  envargs.c $(UNZIP_H)
318
explode$(OBJ):  explode.c $(UNZIP_H)
319
extract$(OBJ):  extract.c $(UNZIP_H) crc32.h crypt.h
320
fileio$(OBJ):   fileio.c $(UNZIP_H) crc32.h crypt.h ttyio.h ebcdic.h
321
funzip$(OBJ):   funzip.c $(UNZIP_H) crc32.h crypt.h ttyio.h
322
globals$(OBJ):  globals.c $(UNZIP_H)
323
inflate$(OBJ):  inflate.c inflate.h $(UNZIP_H)
324
list$(OBJ):     list.c $(UNZIP_H)
325
match$(OBJ):    match.c $(UNZIP_H)
326
process$(OBJ):  process.c $(UNZIP_H) crc32.h
327
ttyio$(OBJ):    ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h
328
ubz2err$(OBJ): ubz2err.c $(UNZIP_H)
329
unreduce$(OBJ): unreduce.c $(UNZIP_H)
330
unshrink$(OBJ): unshrink.c $(UNZIP_H)
331
unzip$(OBJ):    unzip.c $(UNZIP_H) crypt.h unzvers.h consts.h
332
zipinfo$(OBJ):  zipinfo.c $(UNZIP_H)
333
crc_i386$(OBJ): crc_i386.S
334
 
335
 
336
kos32$(OBJ): kolibri/kos32.c kolibri/kos32sys1.h
337
	$(CC) $(CFLAGS) $(CVER) $(GENFLAGS) -I. $<
338
dirent$(OBJ): kolibri/dirent.c kolibri/kos32sys1.h
339
	$(CC) $(CFLAGS) $(CVER) $(GENFLAGS) -I. $<
340
###win32$(OBJ): win32/win32.c $(UNZIP_H) win32/nt.h
341
###	$(CC) $(CFLAGS) $(CVER) $(GENFLAGS) -I. $<
342
 
343
###win32i64$(OBJ): win32/win32i64.c $(UNZIP_H)
344
###	$(CC) $(CFLAGS) $(CVER) $(GENFLAGS) -I. $<
345
 
346
###nt$(OBJ): win32/nt.c $(UNZIP_H) win32/nt.h
347
###	$(CC) $(CFLAGS) $(CVER) $(GENFLAGS) -I. $<
348
 
349
###winapprc$(OBJ):	win32/winapp.rc unzvers.h
350
###	- $(RC) -o $@ $<
351
 
352
# UnZipSFX compilation section
353
crc32x$(OBJ): crc32.c $(UNZIP_H) zip.h crc32.h
354
	$(CC) $(CFLAGS) $(CVER) $(SFXFLAGS) $<
355
 
356
cryptx$(OBJ): crypt.c $(UNZIP_H) zip.h crypt.h crc32.h ttyio.h
357
	$(CC) $(CFLAGS) $(CVER) $(SFXFLAGS) $<
358
 
359
extractx$(OBJ): extract.c $(UNZIP_H) crc32.h crypt.h
360
	$(CC) $(CFLAGS) $(CVER) $(SFXFLAGS) $<
361
 
362
fileiox$(OBJ):   fileio.c $(UNZIP_H) crc32.h crypt.h ttyio.h ebcdic.h
363
	$(CC) $(CFLAGS) $(CVER) $(SFXFLAGS) $<
364
 
365
globalsx$(OBJ): globals.c $(UNZIP_H)
366
	$(CC) $(CFLAGS) $(CVER) $(SFXFLAGS) $<
367
 
368
inflatex$(OBJ): inflate.c inflate.h $(UNZIP_H) crypt.h
369
	$(CC) $(CFLAGS) $(CVER) $(SFXFLAGS) $<
370
 
371
matchx$(OBJ): match.c $(UNZIP_H)
372
	$(CC) $(CFLAGS) $(CVER) $(SFXFLAGS) $<
373
 
374
processx$(OBJ): process.c $(UNZIP_H) crc32.h
375
	$(CC) $(CFLAGS) $(CVER) $(SFXFLAGS) $<
376
 
377
ttyiox$(OBJ): ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h
378
	$(CC) $(CFLAGS) $(CVER) $(SFXFLAGS) $<
379
 
380
ubz2errx$(OBJ): ubz2err.c $(UNZIP_H)
381
	$(CC) $(CFLAGS) $(CVER) $(SFXFLAGS) $<
382
 
383
unzipsfx$(OBJ): unzip.c $(UNZIP_H) crypt.h unzvers.h consts.h
384
	$(CC) $(CFLAGS) $(CVER) $(SFXFLAGS) $<
385
 
386
win32x$(OBJ): win32/win32.c $(UNZIP_H) win32/nt.h
387
	$(CC) $(CFLAGS) $(CVER) $(SFXFLAGS) -I. $<
388
 
389
win32i64x$(OBJ): win32/win32i64.c $(UNZIP_H)
390
	$(CC) $(CFLAGS) $(CVER) $(SFXFLAGS) -I. $<
391
 
392
ntx$(OBJ): win32/nt.c $(UNZIP_H) win32/nt.h
393
	$(CC) $(CFLAGS) $(CVER) $(SFXFLAGS) -I. $<
394
 
395
# fUnZip compilation section
396
cryptf$(OBJ): crypt.c $(UNZIP_H) zip.h crypt.h crc32.h ttyio.h
397
	$(CC) $(CFLAGS) $(CVER) $(FFLAGS) $<
398
 
399
globalsf$(OBJ): globals.c $(UNZIP_H)
400
	$(CC) $(CFLAGS) $(CVER) $(FFLAGS) $<
401
 
402
inflatef$(OBJ): inflate.c inflate.h $(UNZIP_H) crypt.h
403
	$(CC) $(CFLAGS) $(CVER) $(FFLAGS) $<
404
 
405
ttyiof$(OBJ): ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h
406
	$(CC) $(CFLAGS) $(CVER) $(FFLAGS) $<
407
 
408
win32f$(OBJ): win32/win32.c $(UNZIP_H) win32/nt.h
409
	$(CC) $(CFLAGS) $(CVER) $(FFLAGS) -I. $<
410
 
411
win32i64f$(OBJ): win32/win32i64.c $(UNZIP_H)
412
	$(CC) $(CFLAGS) $(CVER) $(FFLAGS) -I. $<
413
 
414
# WINDLL sample
415
uzexampl$(OBJ):	windll/uzexampl.c windll/uzexampl.h
416
	$(CC) $(CFLAGS) $(CVER) $(GENFLAGS) -I. $<
417
 
418
# DLL compilation section
419
api$(OBJ): api.c $(UNZIP_H) $(WINDLL_H) unzvers.h
420
	$(CC) $(CFLAGS) $(CVER) $(GENDLLFL) $<
421
 
422
crc32l$(OBJ):	crc32.c $(UNZIP_H) zip.h crc32.h
423
	$(CC) $(CFLAGS) $(CVER) $(GENDLLFL) $<
424
 
425
cryptl$(OBJ):	crypt.c $(UNZIP_H) zip.h crypt.h crc32.h ttyio.h
426
	$(CC) $(CFLAGS) $(CVER) $(GENDLLFL) $<
427
 
428
explodel$(OBJ):	explode.c $(UNZIP_H)
429
	$(CC) $(CFLAGS) $(CVER) $(GENDLLFL) $<
430
 
431
extractl$(OBJ):	extract.c $(UNZIP_H) $(WINDLL_H) crc32.h crypt.h
432
	$(CC) $(CFLAGS) $(CVER) $(GENDLLFL) $<
433
 
434
fileiol$(OBJ):	fileio.c $(UNZIP_H) $(WINDLL_H) crc32.h crypt.h ttyio.h ebcdic.h
435
	$(CC) $(CFLAGS) $(CVER) $(GENDLLFL) $<
436
 
437
globalsl$(OBJ):	globals.c $(UNZIP_H)
438
	$(CC) $(CFLAGS) $(CVER) $(GENDLLFL) $<
439
 
440
inflatel$(OBJ):	inflate.c inflate.h $(UNZIP_H) crypt.h
441
	$(CC) $(CFLAGS) $(CVER) $(GENDLLFL) $<
442
 
443
listl$(OBJ):	list.c $(UNZIP_H) $(WINDLL_H)
444
	$(CC) $(CFLAGS) $(CVER) $(GENDLLFL) $<
445
 
446
matchl$(OBJ):	match.c $(UNZIP_H)
447
	$(CC) $(CFLAGS) $(CVER) $(GENDLLFL) $<
448
 
449
processl$(OBJ):	process.c $(UNZIP_H) $(WINDLL_H) crc32.h
450
	$(CC) $(CFLAGS) $(CVER) $(GENDLLFL) $<
451
 
452
ubz2errl$(OBJ): ubz2err.c $(UNZIP_H)
453
	$(CC) $(CFLAGS) $(CVER) $(GENDLLFL) $<
454
 
455
unreducl$(OBJ):	unreduce.c $(UNZIP_H)
456
	$(CC) $(CFLAGS) $(CVER) $(GENDLLFL) $<
457
 
458
unshrnkl$(OBJ):	unshrink.c $(UNZIP_H)
459
	$(CC) $(CFLAGS) $(CVER) $(GENDLLFL) $<
460
 
461
zipinfol$(OBJ):	zipinfo.c $(UNZIP_H)
462
	$(CC) $(CFLAGS) $(CVER) $(GENDLLFL) $<
463
 
464
win32l$(OBJ): win32/win32.c $(UNZIP_H) win32/nt.h
465
	$(CC) $(CFLAGS) $(CVER) $(GENDLLFL) -I. $<
466
 
467
win32i64l$(OBJ): win32/win32i64.c $(UNZIP_H)
468
	$(CC) $(CFLAGS) $(CVER) $(GENDLLFL) -I. $<
469
 
470
ntl$(OBJ): win32/nt.c $(UNZIP_H) win32/nt.h
471
	$(CC) $(CFLAGS) $(CVER) $(GENDLLFL) -I. $<
472
 
473
windll$(OBJ): windll/windll.c $(UNZIP_H) $(WINDLL_H) crypt.h unzvers.h consts.h
474
	$(CC) $(CFLAGS) $(CVER) $(GENDLLFL) -I. $<
475
 
476
windllrc$(OBJ):	windll/windll.rc unzvers.h
477
	- $(RC) -o $@ $<
478
 
479
# SFX Lib compilation section
480
apig$(OBJ):	api.c $(UNZIP_H) $(WINDLL_H) unzvers.h
481
	$(CC) $(CFLAGS) $(CVER) $(GENGUILB) $<
482
 
483
crc32g$(OBJ):	crc32.c $(UNZIP_H) zip.h crc32.h
484
	$(CC) $(CFLAGS) $(CVER) $(GENGUILB) $<
485
 
486
cryptg$(OBJ):	crypt.c $(UNZIP_H) zip.h crypt.h crc32.h ttyio.h
487
	$(CC) $(CFLAGS) $(CVER) $(GENGUILB) $<
488
 
489
extractg$(OBJ):	extract.c $(UNZIP_H) $(WINDLL_H) crc32.h crypt.h
490
	$(CC) $(CFLAGS) $(CVER) $(GENGUILB) $<
491
 
492
fileiog$(OBJ):	fileio.c $(UNZIP_H) $(WINDLL_H) crc32.h crypt.h ttyio.h ebcdic.h
493
	$(CC) $(CFLAGS) $(CVER) $(GENGUILB) $<
494
 
495
globalsg$(OBJ):	globals.c $(UNZIP_H)
496
	$(CC) $(CFLAGS) $(CVER) $(GENGUILB) $<
497
 
498
inflateg$(OBJ):	inflate.c inflate.h $(UNZIP_H)
499
	$(CC) $(CFLAGS) $(CVER) $(GENGUILB) $<
500
 
501
matchg$(OBJ):	match.c $(UNZIP_H)
502
	$(CC) $(CFLAGS) $(CVER) $(GENGUILB) $<
503
 
504
processg$(OBJ):	process.c $(UNZIP_H) $(WINDLL_H) crc32.h
505
	$(CC) $(CFLAGS) $(CVER) $(GENGUILB) $<
506
 
507
ubz2errg$(OBJ): ubz2err.c $(UNZIP_H)
508
	$(CC) $(CFLAGS) $(CVER) $(GENGUILB) $<
509
 
510
win32g$(OBJ):	win32/win32.c $(UNZIP_H) win32/nt.h
511
	$(CC) $(CFLAGS) $(CVER) $(GENGUILB) -I. $<
512
 
513
win32i64g$(OBJ):	win32/win32i64.c $(UNZIP_H)
514
	$(CC) $(CFLAGS) $(CVER) $(GENGUILB) -I. $<
515
 
516
ntg$(OBJ):	win32/nt.c $(UNZIP_H) win32/nt.h
517
	$(CC) $(CFLAGS) $(CVER) $(GENGUILB) -I. $<
518
 
519
windllg$(OBJ):  windll/windll.c $(UNZIP_H) $(WINDLL_H) crypt.h unzvers.h consts.h
520
	$(CC) $(CFLAGS) $(CVER) $(GENGUILB) -I. $<
521
 
522
sfxwiz$(OBJ):	windll/guisfx/sfxwiz.c windll/guisfx/dialog.h $(WINDLL_IMP_H)
523
	$(CC) $(CFLAGS) $(CVER) $(GENGUISX) -I. $<
524
 
525
sfxwizrc$(OBJ):	windll/guisfx/sfxwiz.rc
526
	- $(RC)  --include-dir windll/guisfx --define WIN32 -o$@ $<
527
 
528
# Static LIB compilation section
529
apib$(OBJ): api.c $(UNZIP_H) $(WINDLL_H) unzvers.h
530
	$(CC) $(CFLAGS) $(CVER) $(GENLIBFL) $<
531
 
532
crc32b$(OBJ):	crc32.c $(UNZIP_H) zip.h crc32.h
533
	$(CC) $(CFLAGS) $(CVER) $(GENLIBFL) $<
534
 
535
cryptb$(OBJ):	crypt.c $(UNZIP_H) zip.h crypt.h crc32.h ttyio.h
536
	$(CC) $(CFLAGS) $(CVER) $(GENLIBFL) $<
537
 
538
explodeb$(OBJ):	explode.c $(UNZIP_H)
539
	$(CC) $(CFLAGS) $(CVER) $(GENLIBFL) $<
540
 
541
extractb$(OBJ):	extract.c $(UNZIP_H) crc32.h crypt.h
542
	$(CC) $(CFLAGS) $(CVER) $(GENLIBFL) $<
543
 
544
fileiob$(OBJ):	fileio.c $(UNZIP_H) crc32.h crypt.h ttyio.h ebcdic.h
545
	$(CC) $(CFLAGS) $(CVER) $(GENLIBFL) $<
546
 
547
globalsb$(OBJ):	globals.c $(UNZIP_H)
548
	$(CC) $(CFLAGS) $(CVER) $(GENLIBFL) $<
549
 
550
inflateb$(OBJ):	inflate.c inflate.h $(UNZIP_H) crypt.h
551
	$(CC) $(CFLAGS) $(CVER) $(GENLIBFL) $<
552
 
553
listb$(OBJ):	list.c $(UNZIP_H) $(WINDLL_H)
554
	$(CC) $(CFLAGS) $(CVER) $(GENLIBFL) $<
555
 
556
matchb$(OBJ):	match.c $(UNZIP_H)
557
	$(CC) $(CFLAGS) $(CVER) $(GENLIBFL) $<
558
 
559
processb$(OBJ):	process.c $(UNZIP_H) crc32.h
560
	$(CC) $(CFLAGS) $(CVER) $(GENLIBFL) $<
561
 
562
ubz2errb$(OBJ): ubz2err.c $(UNZIP_H)
563
	$(CC) $(CFLAGS) $(CVER) $(GENLIBFL) $<
564
 
565
unreducb$(OBJ):	unreduce.c $(UNZIP_H)
566
	$(CC) $(CFLAGS) $(CVER) $(GENLIBFL) $<
567
 
568
unshrnkb$(OBJ):	unshrink.c $(UNZIP_H)
569
	$(CC) $(CFLAGS) $(CVER) $(GENLIBFL) $<
570
 
571
zipinfob$(OBJ):	zipinfo.c $(UNZIP_H)
572
	$(CC) $(CFLAGS) $(CVER) $(GENLIBFL) $<
573
 
574
win32b$(OBJ): win32/win32.c $(UNZIP_H) win32/nt.h
575
	$(CC) $(CFLAGS) $(CVER) $(GENLIBFL) -I. $<
576
 
577
win32i64b$(OBJ): win32/win32i64.c $(UNZIP_H)
578
	$(CC) $(CFLAGS) $(CVER) $(GENLIBFL) -I. $<
579
 
580
ntb$(OBJ): win32/nt.c $(UNZIP_H) win32/nt.h
581
	$(CC) $(CFLAGS) $(CVER) $(GENLIBFL) -I. $<
582
 
583
windllb$(OBJ): windll/windll.c $(UNZIP_H) $(WINDLL_H) crypt.h unzvers.h consts.h
584
	$(CC) $(CFLAGS) $(CVER) $(GENLIBFL) -I. $<
585
 
586
clean:
587
	-$(subst /,\,$(MAKE)) -C $(IZ_BZIP2) -f Makebz2.iz RM="$(RM)" clean
588
	-$(RM) *$(OBJ)
589
	-$(RM) unzip$(EXE) funzip$(EXE) unzipsfx$(EXE)
590
	-$(RM) unzip32.dll uzexampl$(EXE) SFXWiz32$(EXE)
591
	-$(RM) libunzip32.a libunzsfx32.a