1
1
# Makefile for Info-ZIP's UnZip, UnZipSFX and fUnZip using DJGPP v2.01 or
2
# higher, by Frank Donahoe. Last updated: 17 Feb 02
2
# higher, by Frank Donahoe. Last updated: 21 Jul 2008
4
4
# This Makefile is specifically tailored for GNU make and GNU C and
5
5
# may not work with a generic Unix-compatible make utility. The latest
10
10
# - pattern rules (%.o : %.c, etc.)
11
11
# - GNU-specific conditionals and functions (ifeq, $(patsubst,,),...)
12
# - simply expanded variables (VAR := text)
13
14
# The stand-alone executable requires DPMI services to run. If running
14
15
# in a DOS window under Windows 3.1 or later, the dpmi server is auto-
111
112
# defaults for crc32 stuff and system dependent headers
113
114
ASMFLG = -DASM_CRC
121
# optional inclusion of bzip2 decompression
124
INC_BZ2LIB = -I$(IZ_BZIP2)
125
LOCAL_UNZIP:=-DUSE_BZIP2 $(LOCAL_UNZIP)
126
LD_BZ2LIB = -L$(IZ_BZIP2) -lbz2
127
LIBBZIP2 = $(IZ_BZIP2)/libbz2.a
121
OBJS1 = unzip$O $(CRC32)$O crctab$O crypt$O envargs$O explode$O
135
OBJS1 = unzip$O crc32$O $(CRCA_O) crypt$O envargs$O explode$O
122
136
OBJS2 = extract$O fileio$O globals$O inflate$O list$O match$O
123
OBJS3 = process$O ttyio$O unreduce$O unshrink$O zipinfo$O
137
OBJS3 = process$O ttyio$O ubz2err$O unreduce$O unshrink$O zipinfo$O
124
138
OBJS = $(OBJS1) $(OBJS2) $(OBJS3) $M$O
126
OBJX = unzipsfx$O $(CRC32)$O crctab_$O crypt_$O extract_$O fileio_$O \
127
globals_$O inflate_$O match_$O process_$O ttyio_$O $M_$O
129
OBJF = funzip$O $(CRC32)$O crypt-$O globals-$O inflate-$O ttyio-$O
131
OBJECTS_ALL = $(sort $(OBJS) $(OBJX) $(OBJF) crc32$O crc_gcc$O)
140
OBJX = unzipsfx$O crc32_$O $(CRCA_O) crypt_$O extract_$O fileio_$O \
141
globals_$O inflate_$O match_$O process_$O ttyio_$O ubz2err_$O $M_$O
143
OBJF = funzip$O crc32-$O $(CRCA_O) crypt-$O globals-$O inflate-$O ttyio-$O
145
OBJECTS_ALL = $(sort $(OBJS) $(OBJX) $(OBJF) crc_gcc$O)
133
147
# Common header files included by all C sources:
134
148
UNZIP_H = unzip.h unzpriv.h globals.h msdos/doscfg.h
169
183
$(LD) $(LDFLAGS) $(OBJX) -o $@
186
# create/update the library for the optional bzip2 support:
187
$(IZ_BZIP2)/libbz2.a:
188
$(MAKE) -C $(IZ_BZIP2) -f Makebz2.iz CC="$(CC)" RM="$(RM)"
172
190
# explicit compilation instructions:
174
192
crc_gcc$O: crc_i386.S # 32bit, GNU AS
175
$(CC) $(ASFLAGS) -x assembler-with-cpp -c -o $@ crc_i386.S
193
$(CC) $(ASFLAGS) -x assembler-with-cpp -c -o $@ $<
177
195
# BIN_PATH may be defined in djgpp.env [make] or defined below. If the
178
196
# installation is to the directory containing gcc.exe etc. place the
203
222
# Source dependencies:
204
223
crc_gcc$O: crc_i386.S
205
crc32$O: crc32.c $(UNZIP_H) zip.h
206
crctab$O: crctab.c $(UNZIP_H) zip.h
207
crctab_$O: crctab.c $(UNZIP_H) zip.h
208
crypt$O: crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h
209
crypt-$O: crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h
210
crypt_$O: crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h
224
crc32$O: crc32.c $(UNZIP_H) zip.h crc32.h
225
crc32-$O: crc32.c $(UNZIP_H) zip.h crc32.h
226
crc32_$O: crc32.c $(UNZIP_H) zip.h crc32.h
227
crypt$O: crypt.c $(UNZIP_H) zip.h crypt.h crc32.h ttyio.h
228
crypt-$O: crypt.c $(UNZIP_H) zip.h crypt.h crc32.h ttyio.h
229
crypt_$O: crypt.c $(UNZIP_H) zip.h crypt.h crc32.h ttyio.h
211
230
envargs$O: envargs.c $(UNZIP_H)
212
231
explode$O: explode.c $(UNZIP_H)
213
extract$O: extract.c $(UNZIP_H) crypt.h
214
extract_$O: extract.c $(UNZIP_H) crypt.h
215
fileio$O: fileio.c $(UNZIP_H) crypt.h ttyio.h ebcdic.h
216
fileio_$O: fileio.c $(UNZIP_H) crypt.h ttyio.h ebcdic.h
217
funzip$O: funzip.c $(UNZIP_H) crypt.h ttyio.h tables.h
232
extract$O: extract.c $(UNZIP_H) crc32.h crypt.h
233
extract_$O: extract.c $(UNZIP_H) crc32.h crypt.h
234
fileio$O: fileio.c $(UNZIP_H) crc32.h crypt.h ttyio.h ebcdic.h
235
fileio_$O: fileio.c $(UNZIP_H) crc32.h crypt.h ttyio.h ebcdic.h
236
funzip$O: funzip.c $(UNZIP_H) crc32.h crypt.h ttyio.h
218
237
globals$O: globals.c $(UNZIP_H)
219
238
globals-$O: globals.c $(UNZIP_H)
220
239
globals_$O: globals.c $(UNZIP_H)
226
245
match_$O: match.c $(UNZIP_H)
227
246
msdos$O: msdos/msdos.c $(UNZIP_H)
228
247
msdos_$O: msdos/msdos.c $(UNZIP_H)
229
process$O: process.c $(UNZIP_H)
230
process_$O: process.c $(UNZIP_H)
248
process$O: process.c $(UNZIP_H) crc32.h
249
process_$O: process.c $(UNZIP_H) crc32.h
231
250
ttyio$O: ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h
232
251
ttyio-$O: ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h
233
252
ttyio_$O: ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h
253
ubz2err$O: ubz2err.c $(UNZIP_H)
254
ubz2err_$O: ubz2err.c $(UNZIP_H)
234
255
unreduce$O: unreduce.c $(UNZIP_H)
235
256
unshrink$O: unshrink.c $(UNZIP_H)
236
257
unzip$O: unzip.c $(UNZIP_H) crypt.h unzvers.h consts.h