~ubuntu-branches/ubuntu/warty/unzip/warty

« back to all changes in this revision

Viewing changes to unix/Makefile

  • Committer: Bazaar Package Importer
  • Author(s): Santiago Vila
  • Date: 2004-06-06 17:57:46 UTC
  • Revision ID: james.westby@ubuntu.com-20040606175746-nl7p2dgp3aobyc2c
Tags: upstream-5.51
ImportĀ upstreamĀ versionĀ 5.51

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#==============================================================================
 
2
# Makefile for UnZip, UnZipSFX and fUnZip:  Unix and MS-DOS ("real" makes only)
 
3
# Version:  5.51                                                    01 Mar 2004
 
4
#==============================================================================
 
5
 
 
6
 
 
7
# INSTRUCTIONS (such as they are):
 
8
#
 
9
# "make sunos"  -- makes UnZip in current directory on a generic SunOS 4.x Sun
 
10
# "make list"   -- lists all supported systems (targets)
 
11
# "make help"   -- provides pointers on what targets to try if problems occur
 
12
# "make wombat" -- chokes and dies if you haven't added the specifics for your
 
13
#                   Wombat 68000 (or whatever) to the systems list
 
14
#
 
15
# CF are flags for the C compiler.  LF are flags for the loader.  LF2 are more
 
16
# flags for the loader, if they need to be at the end of the line instead of at
 
17
# the beginning (for example, some libraries).  FL and FL2 are the corre-
 
18
# sponding flags for fUnZip.  LOCAL_UNZIP is an environment variable that can
 
19
# be used to add default C flags to your compile without editing the Makefile
 
20
# (e.g., -DDEBUG_STRUC, or -FPi87 on PCs using Microsoft C).
 
21
#
 
22
# Some versions of make do not define the macro "$(MAKE)"; this is rare, but
 
23
# if things don't work, try using "make" instead of "$(MAKE)" in your system's
 
24
# makerule.  Or try adding the following line to your .login file:
 
25
#       setenv MAKE "make"
 
26
# (That never works--makes that are too stupid to define MAKE are also too
 
27
# stupid to look in the environment--but try it anyway for kicks. :-) )
 
28
#
 
29
# Memcpy and memset are provided for those systems that don't have them; they
 
30
# are in fileio.c and will be used if -DZMEM is included in CF.  These days
 
31
# almost all systems have them.
 
32
#
 
33
# Be sure to test your new UnZip (and UnZipSFX and fUnZip); successful compila-
 
34
# tion does not always imply a working program.
 
35
 
 
36
 
 
37
#####################
 
38
# MACRO DEFINITIONS #
 
39
#####################
 
40
 
 
41
# Defaults most systems use (use LOCAL_UNZIP in environment to add flags,
 
42
# such as -DDOSWILD).
 
43
 
 
44
# UnZip flags
 
45
CC = cc#        try using "gcc" target rather than changing this (CC and LD
 
46
LD = $(CC)#     must match, else "unresolved symbol:  ___main" is possible)
 
47
AS = as
 
48
LOC = $(LOCAL_UNZIP)
 
49
AF = $(LOC)
 
50
CF = -O -I. -DUNIX $(LOC)
 
51
LF = -o unzip
 
52
LF2 = -s
 
53
 
 
54
# UnZipSFX flags
 
55
SL = -o unzipsfx
 
56
SL2 = $(LF2)
 
57
 
 
58
# fUnZip flags
 
59
FL = -o funzip
 
60
FL2 = $(LF2)
 
61
 
 
62
# general-purpose stuff
 
63
#CP = cp
 
64
CP = ln
 
65
LN = ln
 
66
RM = rm -f
 
67
CHMOD = chmod
 
68
BINPERMS = 755
 
69
MANPERMS = 644
 
70
STRIP = strip
 
71
E =
 
72
O = .o
 
73
M = unix
 
74
SHELL = /bin/sh
 
75
 
 
76
# Version info for unix/unix.c
 
77
HOST_VERSINFO=-DIZ_CC_NAME='\"\$$(CC) \"' -DIZ_OS_NAME='\"`uname -a`\"'
 
78
 
 
79
# defaults for crc32 stuff and system dependent headers
 
80
CRC32 = crc32
 
81
OSDEP_H =
 
82
 
 
83
# object files
 
84
OBJS1 = unzip$O $(CRC32)$O crctab$O crypt$O envargs$O explode$O
 
85
OBJS2 = extract$O fileio$O globals$O inflate$O list$O match$O
 
86
OBJS3 = process$O ttyio$O unreduce$O unshrink$O zipinfo$O
 
87
OBJS = $(OBJS1) $(OBJS2) $(OBJS3) $M$O
 
88
LOBJS = $(OBJS)
 
89
OBJSDLL = $(OBJS:.o=.pic.o) api.pic.o
 
90
OBJX = unzipsfx$O $(CRC32)$O crctab_$O crypt_$O extract_$O fileio_$O \
 
91
        globals_$O inflate_$O match_$O process_$O ttyio_$O $M_$O
 
92
LOBJX = $(OBJX)
 
93
OBJF = funzip$O $(CRC32)$O cryptf$O globalsf$O inflatef$O ttyiof$O
 
94
#OBJS_OS2 = $(OBJS1:.o=.obj) $(OBJS2:.o=.obj) os2.obj
 
95
#OBJF_OS2 = $(OBJF:.o=.obj)
 
96
UNZIP_H = unzip.h unzpriv.h globals.h $(OSDEP_H)
 
97
 
 
98
# installation
 
99
# (probably can change next two to `install' and `install -d' if you have it)
 
100
INSTALL = cp
 
101
INSTALL_PROGRAM = $(INSTALL)
 
102
INSTALL_D = mkdir -p
 
103
# on some systems, manext=l and MANDIR=/usr/man/man$(manext) may be appropriate
 
104
manext = 1
 
105
prefix = /usr/local
 
106
BINDIR = $(prefix)/bin#                 where to install executables
 
107
MANDIR = $(prefix)/man/man$(manext)#    where to install man pages
 
108
INSTALLEDBIN = $(BINDIR)/funzip$E $(BINDIR)/unzip$E $(BINDIR)/unzipsfx$E \
 
109
        $(BINDIR)/zipgrep$E $(BINDIR)/zipinfo$E
 
110
INSTALLEDMAN = $(MANDIR)/funzip.$(manext) $(MANDIR)/unzip.$(manext) \
 
111
        $(MANDIR)/unzipsfx.$(manext) $(MANDIR)/zipgrep.$(manext) \
 
112
        $(MANDIR)/zipinfo.$(manext)
 
113
 
 
114
# Solaris 2.x stuff:
 
115
PKGDIR = IZunzip
 
116
VERSION = Version 5.5
 
117
 
 
118
UNZIPS = unzip$E funzip$E unzipsfx$E
 
119
# this is a little ugly...well, OK, it's a lot ugly:
 
120
MANS = man/funzip.1 man/unzip.1 man/unzipsfx.1 man/zipgrep.1 man/zipinfo.1
 
121
DOCS = funzip.txt unzip.txt unzipsfx.txt zipgrep.txt zipinfo.txt
 
122
 
 
123
# list of supported systems/targets in this version
 
124
SYSTEMSG = generic generic2 generic3 generic_zlib generic_shlib
 
125
SYSTEMS1 = 386i 3Bx 7300 7300_gcc aix aix_rt amdahl amdahl_eft apollo aviion
 
126
SYSTEMS2 = bsd bsdi bsdi_noasm bull coherent convex cray cray_opt cyber_sgi
 
127
SYSTEMS3 = cygwin dec dnix encore eta freebsd gcc gould hk68 hp hpux
 
128
SYSTEMS4 = isc isc_gcc isi linux linux_dos linux_noasm linux_shlib linux_shlibz
 
129
SYSTEMS5 = lynx macosx macosx_gcc minix mips mpeix next next10 next2x next3x
 
130
SYSTEMS6 = nextfat osf1 pixel ptx pyramid qnxnto realix regulus rs6000 sco
 
131
SYSTEMS7 = sco_dos sco_sl sco_x286 sequent sgi solaris solaris_pkg stardent
 
132
SYSTEMS8 = stellar sunos3 sunos4 sysv sysv_gcc sysv6300 tahoe ti_sysv ultrix
 
133
SYSTEMS9 = vax v7 wombat xenix xos
 
134
 
 
135
 
 
136
####################
 
137
# DEFAULT HANDLING #
 
138
####################
 
139
 
 
140
# By default, print help on which makefile targets to try.  (The SYSTEM
 
141
# variable is no longer supported; use "make <target>" instead.)
 
142
 
 
143
help:
 
144
        @echo ""
 
145
        @echo\
 
146
 "  If you're not sure about the characteristics of your system, try typing"
 
147
        @echo\
 
148
 '  "make generic".  If the compiler barfs and says something unpleasant about'
 
149
        @echo\
 
150
 '  "timezone redefined," try typing "make clean" followed by "make generic2".'
 
151
        @echo\
 
152
 '  If, on the other hand, it complains about an undefined symbol _ftime, try'
 
153
        @echo\
 
154
 '  typing "make clean" followed by "make generic3".  One of these actions'
 
155
        @echo\
 
156
 '  should produce a working copy of unzip on most Unix systems.  If you know'
 
157
        @echo\
 
158
 '  a bit more about the machine on which you work, you might try "make list"'
 
159
        @echo\
 
160
 '  for a list of the specific systems supported herein.  (Many of them do'
 
161
        @echo\
 
162
 "  exactly the same thing, so don't agonize too much over which to pick if"
 
163
        @echo\
 
164
 '  two or more sound equally likely.)  Also check out the INSTALL file for'
 
165
        @echo\
 
166
 '  notes on compiling various targets.  As a last resort, feel free to read'
 
167
        @echo\
 
168
 '  the numerous comments within the Makefile itself.'
 
169
        @echo\
 
170
 '  Have a mostly pretty good day.'
 
171
        @echo ""
 
172
 
 
173
list:
 
174
        @echo ""
 
175
        @echo\
 
176
 'Type "make <system>", where <system> is one of the following:'
 
177
        @echo ""
 
178
        @echo  "        $(SYSTEMSG)"
 
179
        @echo ""
 
180
        @echo  "        $(SYSTEMS1)"
 
181
        @echo  "        $(SYSTEMS2)"
 
182
        @echo  "        $(SYSTEMS3)"
 
183
        @echo  "        $(SYSTEMS4)"
 
184
        @echo  "        $(SYSTEMS5)"
 
185
        @echo  "        $(SYSTEMS6)"
 
186
        @echo  "        $(SYSTEMS7)"
 
187
        @echo  "        $(SYSTEMS8)"
 
188
        @echo  "        $(SYSTEMS9)"
 
189
#       @echo ""
 
190
#       @echo\
 
191
# 'Targets for related utilities (ZipInfo and fUnZip) include:'
 
192
#       @echo ""
 
193
#       @echo  "        $(SYS_UTIL1)"
 
194
#       @echo  "        $(SYS_UTIL2)"
 
195
        @echo ""
 
196
        @echo\
 
197
 'For further (very useful) information, please read the comments in Makefile.'
 
198
        @echo ""
 
199
 
 
200
generic_msg:
 
201
        @echo ""
 
202
        @echo\
 
203
 '  Attempting "make generic" now.  If this fails for some reason, type'
 
204
        @echo\
 
205
 '  "make help" and/or "make list" for suggestions.'
 
206
        @echo ""
 
207
 
 
208
 
 
209
###############################################
 
210
# BASIC COMPILE INSTRUCTIONS AND DEPENDENCIES #
 
211
###############################################
 
212
 
 
213
# this is for GNU make; comment out and notify zip-bugs if it causes errors
 
214
.SUFFIXES:      .c .o .obj .pic.o
 
215
 
 
216
# yes, we should be able to use the $O macro to combine these two, but it
 
217
# fails on some brain-damaged makes (e.g., AIX's)...no big deal
 
218
.c.o:
 
219
        $(CC) -c $(CF) $*.c
 
220
 
 
221
.c.obj:
 
222
        $(CC) -c $(CF) $*.c
 
223
 
 
224
.c.pic.o:
 
225
        $(CC) -c $(CF) -o $@ $*.c
 
226
 
 
227
# this doesn't work...directories are always a pain with implicit rules
 
228
#.1.txt:                man/$<
 
229
#       nroff -Tman -man $< | col -b | uniq | \
 
230
#        sed 's/Sun Release ..../Info-ZIP        /' > $@
 
231
 
 
232
 
 
233
# these rules may be specific to Linux (or at least the GNU groff package)
 
234
# and are really intended only for the authors' use in creating non-Unix
 
235
# documentation files (which are provided with both source and binary
 
236
# distributions).  We should probably add a ".1.txt" rule for more generic
 
237
# systems...
 
238
 
 
239
funzip.txt:     man/funzip.1
 
240
        nroff -Tascii -man man/funzip.1 | col -b | uniq | expand > $@
 
241
 
 
242
unzip.txt:      man/unzip.1
 
243
        nroff -Tascii -man man/unzip.1 | col -b | uniq | expand > $@
 
244
 
 
245
unzipsfx.txt:   man/unzipsfx.1
 
246
        nroff -Tascii -man man/unzipsfx.1 | col -b | uniq | expand > $@
 
247
 
 
248
zipgrep.txt:    man/zipgrep.1
 
249
        nroff -Tascii -man man/zipgrep.1 | col -b | uniq | expand > $@
 
250
 
 
251
zipinfo.txt:    man/zipinfo.1
 
252
        nroff -Tascii -man man/zipinfo.1 | col -b | uniq | expand > $@
 
253
 
 
254
 
 
255
all:            generic_msg generic
 
256
unzips:         $(UNZIPS)
 
257
objs:           $(OBJS)
 
258
objsdll:        $(OBJSDLL)
 
259
docs:           $(DOCS)
 
260
unzipsman:      unzips docs
 
261
unzipsdocs:     unzips docs
 
262
 
 
263
 
 
264
# EDIT HERE FOR PARALLEL MAKES on Sequent (and others?)--screws up MS-DOS
 
265
# make utilities if default:  change "unzip$E:" to "unzip$E:&"
 
266
 
 
267
unzip$E:        $(OBJS)                 # add `&' for parallel makes
 
268
        $(LD) $(LF) $(LOBJS) $(LF2)
 
269
 
 
270
unzipsfx$E:     $(OBJX)                 # add `&' for parallel makes
 
271
        $(LD) $(SL) $(LOBJX) $(SL2)
 
272
 
 
273
funzip$E:       $(OBJF)                 # add `&' for parallel makes
 
274
        $(LD) $(FL) $(OBJF) $(FL2)
 
275
 
 
276
zipinfo$E:      unzip$E                 # `&' is pointless here...
 
277
        @echo\
 
278
 '  This is a Unix-specific target.  ZipInfo is not enabled in some MS-DOS'
 
279
        @echo\
 
280
 '  versions of UnZip; if it is in yours, copy unzip.exe to zipinfo.exe'
 
281
        @echo\
 
282
 '  or else invoke as "unzip -Z" (in a batch file, for example).'
 
283
        $(LN) unzip$E zipinfo$E
 
284
 
 
285
 
 
286
crc32$O:        crc32.c $(UNZIP_H) zip.h
 
287
crctab$O:       crctab.c $(UNZIP_H) zip.h
 
288
crypt$O:        crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h
 
289
envargs$O:      envargs.c $(UNZIP_H)
 
290
explode$O:      explode.c $(UNZIP_H)
 
291
extract$O:      extract.c $(UNZIP_H) crypt.h
 
292
fileio$O:       fileio.c $(UNZIP_H) crypt.h ttyio.h ebcdic.h
 
293
funzip$O:       funzip.c $(UNZIP_H) crypt.h ttyio.h tables.h
 
294
globals$O:      globals.c $(UNZIP_H)
 
295
inflate$O:      inflate.c inflate.h $(UNZIP_H)
 
296
list$O:         list.c $(UNZIP_H)
 
297
match$O:        match.c $(UNZIP_H)
 
298
process$O:      process.c $(UNZIP_H)
 
299
ttyio$O:        ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h
 
300
unreduce$O:     unreduce.c $(UNZIP_H)
 
301
unshrink$O:     unshrink.c $(UNZIP_H)
 
302
unzip$O:        unzip.c $(UNZIP_H) crypt.h unzvers.h consts.h
 
303
zipinfo$O:      zipinfo.c $(UNZIP_H)
 
304
 
 
305
unzipsfx$O:     unzip.c $(UNZIP_H) crypt.h unzvers.h consts.h   # unzipsfx only
 
306
        -$(CP) unzip.c unzipsfx.c
 
307
        $(CC) -c $(CF) -DSFX unzipsfx.c
 
308
        $(RM) unzipsfx.c
 
309
 
 
310
crctab_$O:      crctab.c $(UNZIP_H) zip.h
 
311
        -$(CP) crctab.c crctab_.c
 
312
        $(CC) -c $(CF) -DSFX crctab_.c
 
313
        $(RM) crctab_.c
 
314
 
 
315
crypt_$O:       crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h        # unzipsfx only
 
316
        -$(CP) crypt.c crypt_.c
 
317
        $(CC) -c $(CF) -DSFX crypt_.c
 
318
        $(RM) crypt_.c
 
319
 
 
320
extract_$O:     extract.c $(UNZIP_H) crypt.h                    # unzipsfx only
 
321
        -$(CP) extract.c extract_.c
 
322
        $(CC) -c $(CF) -DSFX extract_.c
 
323
        $(RM) extract_.c
 
324
 
 
325
fileio_$O:      fileio.c $(UNZIP_H) crypt.h ttyio.h ebcdic.h
 
326
        -$(CP) fileio.c fileio_.c
 
327
        $(CC) -c $(CF) -DSFX fileio_.c
 
328
        $(RM) fileio_.c
 
329
 
 
330
globals_$O:     globals.c $(UNZIP_H)                            # unzipsfx only
 
331
        -$(CP) globals.c globals_.c
 
332
        $(CC) -c $(CF) -DSFX globals_.c
 
333
        $(RM) globals_.c
 
334
 
 
335
inflate_$O:     inflate.c inflate.h $(UNZIP_H) crypt.h          # unzipsfx only
 
336
        -$(CP) inflate.c inflate_.c
 
337
        $(CC) -c $(CF) -DSFX inflate_.c
 
338
        $(RM) inflate_.c
 
339
 
 
340
match_$O:       match.c $(UNZIP_H)                              # unzipsfx only
 
341
        -$(CP) match.c match_.c
 
342
        $(CC) -c $(CF) -DSFX match_.c
 
343
        $(RM) match_.c
 
344
 
 
345
process_$O:     process.c $(UNZIP_H)                            # unzipsfx only
 
346
        -$(CP) process.c process_.c
 
347
        $(CC) -c $(CF) -DSFX process_.c
 
348
        $(RM) process_.c
 
349
 
 
350
ttyio_$O:       ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h        # unzipsfx only
 
351
        -$(CP) ttyio.c ttyio_.c
 
352
        $(CC) -c $(CF) -DSFX ttyio_.c
 
353
        $(RM) ttyio_.c
 
354
 
 
355
 
 
356
cryptf$O:       crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h        # funzip only
 
357
        -$(CP) crypt.c cryptf.c
 
358
        $(CC) -c $(CF) -DFUNZIP cryptf.c
 
359
        $(RM) cryptf.c
 
360
 
 
361
globalsf$O:     globals.c $(UNZIP_H)                            # funzip only
 
362
        -$(CP) globals.c globalsf.c
 
363
        $(CC) -c $(CF) -DFUNZIP globalsf.c
 
364
        $(RM) globalsf.c
 
365
 
 
366
inflatef$O:     inflate.c inflate.h $(UNZIP_H) crypt.h          # funzip only
 
367
        -$(CP) inflate.c inflatef.c
 
368
        $(CC) -c $(CF) -DFUNZIP inflatef.c
 
369
        $(RM) inflatef.c
 
370
 
 
371
ttyiof$O:       ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h        # funzip only
 
372
        -$(CP) ttyio.c ttyiof.c
 
373
        $(CC) -c $(CF) -DFUNZIP ttyiof.c
 
374
        $(RM) ttyiof.c
 
375
 
 
376
 
 
377
# optional assembler replacements
 
378
crc_i86$O:      msdos/crc_i86.asm                               # 16bit only
 
379
        $(AS) $(AF) msdos/crc_i86.asm $(ASEOL)
 
380
 
 
381
crc_gcc$O:      crc_i386.S                                      # 32bit, GNU AS
 
382
        $(AS) $(AF) -x assembler-with-cpp -c -o $@ crc_i386.S
 
383
 
 
384
crc_gcc.pic.o:  crc_i386.S                                      # 32bit, GNU AS
 
385
        $(AS) $(AF) -x assembler-with-cpp -c -o $@ crc_i386.S
 
386
 
 
387
crc_sysv$O:     crc_i386.S                                      # 32bit, SysV AS
 
388
        $(CC) -E $(AF) crc_i386.S > crc_i386s.s
 
389
        $(AS) -o $@ crc_i386s.s
 
390
        $(RM) crc_i386s.s
 
391
 
 
392
msdos$O:        msdos/msdos.c $(UNZIP_H) unzvers.h              # DOS only
 
393
        $(CC) -c $(CF) msdos/msdos.c
 
394
 
 
395
msdos_$O:       msdos/msdos.c $(UNZIP_H)                        # DOS unzipsfx
 
396
        -$(CP) msdos/msdos.c msdos_.c > nul
 
397
        $(CC) -c $(CF) -DSFX msdos_.c
 
398
        $(RM) msdos_.c
 
399
 
 
400
#os2$O:         os2/os2.c $(UNZIP_H)                            # OS/2 only
 
401
#       $(CC) -c $(CF) os2/os2.c
 
402
 
 
403
unix$O:         unix/unix.c $(UNZIP_H) unzvers.h                # Unix only
 
404
        $(CC) -c $(CF) unix/unix.c
 
405
 
 
406
unix_$O:        unix/unix.c $(UNZIP_H)                          # Unix unzipsfx
 
407
        -$(CP) unix/unix.c unix_.c
 
408
        $(CC) -c $(CF) -DSFX unix_.c
 
409
        $(RM) unix_.c
 
410
 
 
411
unix.pic.o:     unix/unix.c $(UNZIP_H) unzvers.h                # Unix shlib
 
412
        $(CC) -c $(CF) -o $@ unix/unix.c
 
413
 
 
414
 
 
415
unix_make:
 
416
#       @echo\
 
417
# '(Ignore any errors from `make'"' due to the following command; it's harmless.)"
 
418
        -@2>&1 $(LN) unix/Makefile . > /dev/null || echo > /dev/null
 
419
 
 
420
# this really only works for Unix targets, unless E and O specified on cmd line
 
421
clean:
 
422
        @echo ""
 
423
        @echo '         This is a Unix-specific target.  (Just so you know.)'
 
424
        @echo ""
 
425
        rm -f $(UNZIPS) $(OBJS) $(OBJF) $(OBJX) api$O apihelp$O crc_gcc$O \
 
426
          crc_sysv$O unzipstb$O crypt_.c extract_.c globals_.c inflate_.c \
 
427
          ttyio_.c crc_i386s.s msdos_.c process_.c unix_.c unzipsfx.c
 
428
        rm -rf ./$(PKGDIR)
 
429
 
 
430
# Package generation interface (by J.Bush).  Originally tested under Sun
 
431
# Solaris 2.x.  Other SVr4s may be very similar and could possibly use this.
 
432
# Note:  expects version info to be stored in VERSION macro variable.
 
433
# See "README" under ./unix/Packaging
 
434
#
 
435
svr4package:    unzips
 
436
        @echo "Creating SVR4 package for Unix ..."
 
437
        -@rm -rf ./$(PKGDIR) ./$(PKGDIR)_`uname -p`.pkg
 
438
        -@sed -e "s/.VERSION./$(VERSION)/g" \
 
439
              -e "s/.PSTAMP./$(LOGNAME)_`date | tr  ' ' '_'`/g" \
 
440
              -e "s/.ARCH./Solaris_`uname -rp | tr ' ' ','`/g" \
 
441
              ./unix/Packaging/pkginfo.in > ./unix/Packaging/pkginfo
 
442
        -@sed -e "s/.ARCH./`uname -p`/g" \
 
443
              ./unix/Packaging/preinstall.in > ./unix/Packaging/preinstall
 
444
        /usr/bin/pkgmk -d . -b . -r . -f ./unix/Packaging/prototype $(PKGDIR)
 
445
        /usr/bin/pkgtrans -o -s . $(PKGDIR)_`uname -p`.pkg $(PKGDIR)
 
446
        @echo " "
 
447
        @echo "To install, copy $(PKGDIR)_`uname -p`.pkg to the target system, and"
 
448
        @echo "issue the command (as root):  pkgadd -d $(PKGDIR)_`uname -p`.pkg"
 
449
        @echo " "
 
450
 
 
451
install:        $(MANS)
 
452
        -$(INSTALL_D) $(BINDIR)
 
453
        $(INSTALL_PROGRAM) $(UNZIPS) $(BINDIR)
 
454
        $(INSTALL) unix/zipgrep $(BINDIR)
 
455
        $(RM) $(BINDIR)/zipinfo$E
 
456
        $(LN) $(BINDIR)/unzip$E $(BINDIR)/zipinfo$E
 
457
        -$(INSTALL_D) $(MANDIR)
 
458
        $(INSTALL) man/funzip.1 $(MANDIR)/funzip.$(manext)
 
459
        $(INSTALL) man/unzip.1 $(MANDIR)/unzip.$(manext)
 
460
        $(INSTALL) man/unzipsfx.1 $(MANDIR)/unzipsfx.$(manext)
 
461
        $(INSTALL) man/zipgrep.1 $(MANDIR)/zipgrep.$(manext)
 
462
        $(INSTALL) man/zipinfo.1 $(MANDIR)/zipinfo.$(manext)
 
463
        $(CHMOD) $(BINPERMS) $(INSTALLEDBIN)
 
464
        $(CHMOD) $(MANPERMS) $(INSTALLEDMAN)
 
465
 
 
466
uninstall:
 
467
        $(RM) $(INSTALLEDBIN) $(INSTALLEDMAN)
 
468
 
 
469
 
 
470
# the test zipfile
 
471
TESTZIP = testmake.zip
 
472
 
 
473
# test some basic features of the build
 
474
test:           check
 
475
 
 
476
check:
 
477
        @echo '#####  This is a Unix-specific target.  (Just so you know.)'
 
478
        @echo '#####     Make sure unzip, funzip and unzipsfx are compiled and'
 
479
        @echo '#####     in this directory.'
 
480
        @if test ! -f ./unzip; then \
 
481
            echo "#####  ERROR:  can't find ./unzip"; exit 1; fi
 
482
        @if test ! -f ./funzip; then \
 
483
            echo "#####  ERROR:  can't find ./funzip"; exit 1; fi
 
484
        @if test ! -f ./unzipsfx; then \
 
485
            echo "#####  ERROR:  can't find ./unzipsfx"; exit 1; fi
 
486
#
 
487
        @if test ! -f $(TESTZIP); then \
 
488
            echo "#####  ERROR:  can't find test file $(TESTZIP)"; exit 1; fi
 
489
#
 
490
        @echo "#####  testing extraction"
 
491
        @./unzip -bo $(TESTZIP) testmake.zipinfo
 
492
        @if test ! -f testmake.zipinfo ; then \
 
493
            echo "#####  ERROR:  file extraction from $(TESTZIP) failed"; \
 
494
            exit 1; fi
 
495
#
 
496
        @echo '#####  testing zipinfo (unzip -Z)'
 
497
        @./unzip -Z $(TESTZIP) > testmake.unzip-Z
 
498
        @if diff testmake.unzip-Z testmake.zipinfo; then echo "OK."; else \
 
499
            echo "#####  WARNING:  zipinfo output doesn't match stored version"; \
 
500
            echo '#####     (If the only difference is the file times, compare your'; \
 
501
            echo '#####      timezone with the Central European timezone, which is one'; \
 
502
            echo '#####      hour east of Greenwich but effectively 2 hours east'; \
 
503
            echo '#####      during summer Daylight Savings Time.  The upper two'; \
 
504
            echo '#####      lines should correspond to your local time when the'; \
 
505
            echo '#####      files were created, on 19 November 1998 at 10:46pm CET.'; \
 
506
            echo '#####      If the times are consistent, please ignore this warning.)'; \
 
507
            fi
 
508
        @$(RM) testmake.unzip-Z testmake.zipinfo
 
509
#
 
510
        @echo '#####  testing unzip -d exdir option'
 
511
        @./unzip -bo $(TESTZIP) -d testun notes
 
512
        @cat testun/notes
 
513
#
 
514
        @echo '#####  testing unzip -o and funzip (ignore funzip warning)'
 
515
        @./unzip -boq $(TESTZIP) notes -d testun
 
516
        @./funzip < $(TESTZIP) > testun/notes2
 
517
        @if diff testun/notes testun/notes2; then true; else \
 
518
            echo '#####  ERROR:  funzip output disagrees with unzip'; fi
 
519
#
 
520
        @echo '#####  testing unzipsfx (self-extractor)'
 
521
        @cat unzipsfx $(TESTZIP) > testsfx
 
522
        @$(CHMOD) 0700 testsfx
 
523
        @./testsfx -bo notes
 
524
        @if diff notes testun/notes; then true; else \
 
525
            echo '#####  ERROR:  unzipsfx file disagrees with unzip'; fi
 
526
        @$(RM) testsfx notes testun/notes testun/notes2
 
527
        @rmdir testun
 
528
#
 
529
        @echo '#####  testing complete.'
 
530
 
 
531
 
 
532
################################
 
533
# INDIVIDUAL MACHINE MAKERULES #
 
534
################################
 
535
 
 
536
#----------------------------------------------------------------------------
 
537
#  Generic targets (can't assume make utility groks "$(MAKE)")
 
538
#----------------------------------------------------------------------------
 
539
 
 
540
generic:        unzips     # first try if unknown
 
541
 
 
542
generic2:       unix_make  # second try if unknown:  hope make is called "make"
 
543
        make -f unix/Makefile unzips CF="$(CF) -DBSD"
 
544
 
 
545
generic3:       unix_make  # third try if unknown:  hope make is called "make"
 
546
        make -f unix/Makefile unzips CF="$(CF) -DSYSV"
 
547
 
 
548
# Generic unzip and funzip target using either shared or static zlib for
 
549
# inflate rather than the original UnZip version.  (libz was libgz prior
 
550
# to 0.94)  Need to figure out how to force unzipsfx to use static libz.
 
551
 
 
552
generic_zlib:   unix_make
 
553
        @echo\
 
554
 "This target assumes zlib (libz.a or libz.so.*) is already installed."
 
555
        $(MAKE) unzip funzip CF="$(CF) -DUSE_ZLIB" LF2="-lz $(LF2)"
 
556
 
 
557
# Generic GNU C shared library.  This is an example of how to compile UnZip as
 
558
# a shared library.  (Doing so as a static library would be similar.)  See also
 
559
# the linux_shlib target.
 
560
 
 
561
generic_shlib:  unix_make
 
562
        @echo\
 
563
 'This target requires GNU C.  When done, do "setenv LD_LIBRARY_PATH `pwd`"'
 
564
        @echo\
 
565
 'or similar in order to test the shared library in place (with ./unzip_shlib ,'
 
566
        @echo\
 
567
 'which is UnZip linked with the DLL).  This target is an example only.'
 
568
        @echo ""
 
569
        $(MAKE) objsdll CC=gcc CF="-O3 -Wall -I. -fPIC -DDLL -DUNIX $(LOC)"
 
570
        gcc -shared -Wl,-soname,libunzip.so.0 -o libunzip.so.0.4 $(OBJSDLL)
 
571
        $(RM) libunzip.so.0 libunzip.so
 
572
        $(LN) -s libunzip.so.0.4 libunzip.so.0
 
573
        $(LN) -s libunzip.so.0 libunzip.so
 
574
        gcc -c -O unzipstb.c
 
575
        gcc -o unzip_shlib unzipstb.o -L. -lunzip
 
576
 
 
577
#----------------------------------------------------------------------------
 
578
#  "Normal" group (BSD vs. SysV may be set in unzip.h via predefined macros):
 
579
#----------------------------------------------------------------------------
 
580
 
 
581
386i:           unzips  # sun386i, SunOS 4.0.2
 
582
#3Bx:           unzips  # AT&T 3B2/1000-80; should work on any WE32XXX machine
 
583
#aix_rt:                unzips  # IBM RT 6150 under AIX 2.2.1
 
584
bull:           unzips  # Bull DPX/2, BOS 2.00.45 (doesn't require -Xk switch)
 
585
convex:         unzips  # Convex C-120 and C-210 (-O is enough; -ext is default)
 
586
cray:           unzips  # Cray-2 and Y-MP, using default (possibly old) compiler
 
587
dec:            unzips  # DEC 5820 (MIPS RISC), test version of Ultrix v4.0
 
588
encore:         unzips  # Multimax
 
589
eta:            unzips  # ETA-10P*, hybrid SysV with BSD 4.3 enhancements
 
590
gould:          unzips  # Gould PN9000 running UTX/32 2.1Bu01
 
591
hp:             unzips  # HP 9000 series (68020), 4.3BSD or HP-UX A.B3.10 Ver D
 
592
hpux:           unzips  # (to match zip's makefile entry)
 
593
mips:           unzips  # MIPS M120-5(?), SysV.3 [error in sys/param.h file?]
 
594
next10:         unzips  # NeXT (generic; use next2x or next3x for better opt.)
 
595
osf1:           unzips  # DECstation, including Alpha-based; DEC OSF/1 v1.x
 
596
pyr_:           unzips  # [failsafe target for pyramid target below]
 
597
pyr_ucb:        unzips  # Pyramids running BSD universe by default (see below)
 
598
realix:         unzips  # Modcomp Real/IX (SysV.3); note "gcc" = GLS C, not GNU
 
599
sco:            unzips  # Xenix/386 (tested on 2.3.1); SCO Unix 3.2.0.
 
600
sgi:            unzips  # Silicon Graphics; Irix 3.3.2, 4.0.x, 5.2, etc.
 
601
stellar:        unzips  # gs-2000
 
602
sun:            unzips  # old target; no good with solaris...use "sunos" now
 
603
sunos:          unzips  # no good with SunOS 3.x...use "sunos3" or "sunos4" now
 
604
sunos4:         unzips  # Sun 3, 4; SunOS 4.x (SOME SYSTEMS ARE SYSTEM V!)
 
605
tahoe:          unzips  # tahoe (CCI Power6/32), 4.3BSD
 
606
ultrix:         unzips  # VAXen, DEC 58x0 (MIPS guts), DECstation 2100; v4.x
 
607
vax:            unzips  # general-purpose VAX target (not counting VMS)
 
608
 
 
609
#----------------------------------------------------------------------------
 
610
#  BSD group (for timezone structs [struct timeb]):
 
611
#----------------------------------------------------------------------------
 
612
 
 
613
bsd:            _bsd    # generic BSD (BSD 4.2 & Ultrix handled in unzip.h)
 
614
 
 
615
_bsd:           unix_make
 
616
        $(MAKE) unzips CF="$(CF) -DBSD"
 
617
 
 
618
#----------------------------------------------------------------------------
 
619
#  SysV group (for extern long timezone and ioctl.h instead of sgtty.h):
 
620
#----------------------------------------------------------------------------
 
621
 
 
622
aix_rt:         _sysv   # IBM RT 6150 under AIX 2.2.1
 
623
aviion:         _sysv   # Data General AViiONs, DG/UX 4.3x
 
624
pyr_att:        _sysv   # Pyramids running AT&T (SysV) universe by default
 
625
solaris:        _sysv   # Sun SPARC & x86, Solaris 2.x
 
626
solaris_pkg:    _sysvp  # Sun SPARC & x86, Solaris 2.x; make package when done
 
627
stardent:       _sysv   # Stardent ...
 
628
sysv:           _sysv   # generic System V Unix (Xenix handled in unzip.h)
 
629
xos:            _sysv   # Olivetti LSX-3005..3045, X/OS 2.3 and 2.4
 
630
 
 
631
_sysv:          unix_make
 
632
        $(MAKE) unzips CF="$(CF) -DSYSV"
 
633
 
 
634
# extension to perform SVR4 package-creation after compilation
 
635
_sysvp:         _sysv svr4package
 
636
 
 
637
#----------------------------------------------------------------------------
 
638
#  Version 7 group (old/obsolescent):
 
639
#----------------------------------------------------------------------------
 
640
 
 
641
pixel:          _v7     # Pixel 80, 100 (68000-based, V7/mostly BSD4.1 compat.)
 
642
v7:             _v7     # generic Unix Version 7 box (prob. only Pixel...)
 
643
 
 
644
_v7:
 
645
        make -f unix/Makefile unzips \
 
646
         CF="$(CF) -DV7 -DNO_PARAM_H -DSHORT_NAMES -DBSD -DZMEM"
 
647
 
 
648
#----------------------------------------------------------------------------
 
649
#  "Unique" group (require non-standard options):
 
650
#----------------------------------------------------------------------------
 
651
 
 
652
# AT&T 3B2/1000-80; should work on any WE32XXX machine
 
653
3Bx:            unix_make
 
654
        $(MAKE) unzips CF="$(CF) -DCBREAK=2"
 
655
 
 
656
# AT&T 7300 (M68000/SysV.3) (add -DSYSV? -DNO_LIMITS?)
 
657
7300:           unix_make
 
658
        $(MAKE) unzips CF="$(CF) -DNO_DIR -DNO_MKDIR -DNO_STRNICMP -DNO_UID_GID -DCBREAK=2"
 
659
 
 
660
7300_gcc:       unix_make
 
661
        $(MAKE) unzips CC=gcc LD=gcc LF2="" \
 
662
         CF="-O2 -I. -DNO_DIR -DNO_MKDIR -DNO_STDLIB_H -DNO_STRNICMP -DNO_UID_GID -DCBREAK=2 $(LOC)"
 
663
        $(STRIP) $(UNZIPS)
 
664
 
 
665
# IBM AIX 3.x on an RS/6000:  see rs6000 target below
 
666
aix:            rs6000
 
667
 
 
668
# Amdahl (IBMish) mainframe, UTS (SysV) 1.2.4, 2.0.1, 3.x
 
669
amdahl:         unix_make
 
670
        $(MAKE) unzips CF="$(CF) -DSYSV -DNO_UID_GID"
 
671
 
 
672
# Amdahl UTS 2.1.4 with "extended file types" filesystem (aarrrggghhhh...)
 
673
amdahl_eft:     unix_make
 
674
        $(MAKE) unzips CF="$(CF) -eft -DSYSV -DNO_UID_GID"
 
675
 
 
676
# Apollo Domain/OS machines (added -D...SOURCE options) [Gordon Fox, 960810]
 
677
apollo:         unix_make
 
678
        $(MAKE) unzips CF="$(CF) -D_INCLUDE_BSD_SOURCE -D_INCLUDE_XOPEN_SOURCE"
 
679
 
 
680
# BSDI BSD/OS on 386 platform, using the assembler replacement for crc32.c
 
681
bsdi:           unix_make
 
682
        @echo 'NOTE:  use bsdi_noasm target for non-Intel BSD/OS compiles.'
 
683
        $(MAKE) unzips CC=gcc2 LD=shlicc2 AS=gcc2\
 
684
         CF="-O3 -Wall -I. -DASM_CRC -DUNIX -DBSD $(LOC)" CRC32=crc_gcc
 
685
 
 
686
# BSDI BSD/OS
 
687
bsdi_noasm:     unix_make
 
688
#       @echo 'NOTE:  use bsd target for non-Intel BSD/OS compiles.'
 
689
        $(MAKE) unzips CC=gcc2 LD=shlicc2 AS=gcc2\
 
690
         CF="-O3 -Wall -I. -DUNIX -DBSD $(LOC)"
 
691
 
 
692
# Coherent 3.x/4.x, Mark Williams C.  ``For Coherent's CC, it needs either
 
693
# -T0 or -T150000 (or bigger) added to the CFLAGS, otherwise the compiler
 
694
# runs out of memory and dies in zipinfo.c.'' [Fred "Fredex" Smith, 940719]
 
695
coherent:       unix_make
 
696
        $(MAKE) unzips CF="$(CF) -T0"
 
697
 
 
698
# Cray-2, Y-MP or C90, running Unicos 5.x to 8.x (SysV + BSD enhancements)
 
699
# and Standard (ANSI) C compiler 3.0 or later.
 
700
cray_opt:       unix_make
 
701
        $(MAKE) unzips CF="$(CF) -h scalar3 -h vector3"
 
702
 
 
703
# The unzip41 build on a Cyber 910/SGI running Irix v3.3.3 was successful
 
704
# with the following change to Makefile:
 
705
cyber_sgi:      unix_make
 
706
        $(MAKE) unzips CF="$(CF) -I/usr/include/bsd"\
 
707
         LF="-lbsd $(LF)" SL="-lbsd $(SL)"
 
708
 
 
709
# The Cygwin environment on a Win32 system, treated as an UNIX emulator.
 
710
# This port does not offer full access to the Windows file system.
 
711
# Info-ZIP recommends using "win32/Makefile.gcc" instead.
 
712
cygwin:         unix_make
 
713
        $(MAKE) unzips CC=gcc LD=gcc AS=gcc\
 
714
         CF="-O3 -I. -DUNIX -DFORCE_UNIX_OVER_WIN32 -DASM_CRC $(LOC)"\
 
715
         AF="-Di386 $(AF)" CRC32=crc_gcc\
 
716
         E=".exe" CP="cp" LN="ln -s"
 
717
 
 
718
# 680x0, DIAB dnix 5.2/5.3 (a Swedish System V clone)
 
719
#
 
720
# Options for the dnix cc:
 
721
#  -X7 = cc is strict ANSI C
 
722
#  -X9 = warnings if a function is used without a declaration
 
723
#
 
724
dnix:           unix_make
 
725
        $(MAKE) unzips CF="$(CF) -X7 -X9 -DDNIX"
 
726
 
 
727
# FreeBSD on Intel:
 
728
freebsd:                unix_make
 
729
        @echo 'NOTE:  use bsd target for non-Intel FreeBSD compiles (if any).'
 
730
        $(MAKE) unzips CC=gcc LD=gcc AS=gcc\
 
731
         CF="-O3 -Wall -I. -DASM_CRC -DUNIX -DBSD $(LOC)"\
 
732
         AF="-Di386 $(AF)" CRC32=crc_gcc
 
733
 
 
734
# Generic BSDish Unix gcc.  ``The -O3 only works with later versions of gcc;
 
735
# you may have to use -O2 or -O for earlier versions.  I have no idea why
 
736
# -s causes this bug in gcc.''  [Bug:  "nm: unzip: no name list", "collect:
 
737
# /usr/bin/nm returned 1 exit status".]  If you don't have strip, don't
 
738
# worry about it (it just makes the executable smaller and can be replaced
 
739
# with "echo" instead).
 
740
#
 
741
gcc:            unix_make
 
742
        $(MAKE) unzips CC=gcc LD=gcc CF="-O3 -I. $(LOC)" LF2=""
 
743
        $(STRIP) $(UNZIPS)
 
744
 
 
745
# Heurikon HK68 (68010), UniPlus+ System V 5.0, Green Hills C-68000
 
746
hk68:           unix_make
 
747
        $(MAKE) unzips CC="gcc" LD="gcc"\
 
748
         LF="-n $(LF)" SL="-n $(SL)" FL="-n $(FL)"\
 
749
         CF="-ga -X138 -I. $(LOC) -Dlocaltime=localti -Dtimezone=timezon"
 
750
 
 
751
# ISC Unix on 386 platform
 
752
isc:            unix_make
 
753
        $(MAKE) unzips LF2="-lc_s $(LF2)" CRC32=crc_sysv \
 
754
         CF="-O -I. -DASM_CRC -DSYSV -DNO_UID_GID -DNEED_PTEM $(LOC)" \
 
755
         AF="-DNO_UNDERLINE -Djecxz=jcxz -DALIGNMENT='.align 16' $(AF)"
 
756
 
 
757
isc_gcc:        unix_make
 
758
        $(MAKE) unzips AS=gcc CC=gcc LD=gcc CRC32=crc_gcc LF="-shlib $(LF)" \
 
759
         SL="-shlib $(SL)" FL="-shlib $(FL)" \
 
760
         LF2="" CF="-O3 -I. -DSYSV -DASM_CRC -DNO_UID_GID -DNEED_PTEM $(LOC)" \
 
761
         AF="-DNO_UNDERLINE -Djecxz=jcxz -DALIGNMENT='.align 16' $(AF)"
 
762
        $(STRIP) $(UNZIPS)
 
763
 
 
764
# "ISI machine (68025 CPU)" (based on e-mail from Rob White <rsw@tfs.com>;
 
765
# no further information).  May also need DIRENT defined.
 
766
isi:            unix_make
 
767
        $(MAKE) unzips CF="$(CF) -DDECLARE_ERRNO"
 
768
 
 
769
# Linux on 386 platform, using the assembler replacement for crc32.c. (-O4 and
 
770
# -fno-strength-reduce have virtually no effect beyond -O3.  Add "-m486
 
771
# -malign-functions=2 -malign-jumps=2 -malign-loops=2" for Pentium [Pro]
 
772
# systems.)
 
773
linux:          unix_make
 
774
        @echo 'NOTE:  use linux_noasm target for non-Intel Linux compiles.'
 
775
        $(MAKE) unzips CC=gcc LD=gcc AS=gcc\
 
776
         CF="-O3 -Wall -I. -DASM_CRC $(LOC)"\
 
777
         AF="-Di386 $(AF)" CRC32=crc_gcc
 
778
# GRR:  this echo is pointless; if user gets this far, no difference to install
 
779
#       @echo 'Be sure to use the install_asm target rather than the install target'
 
780
 
 
781
linux_asm:      linux
 
782
 
 
783
# Linux (Posix, approximately SysV):  virtually any version since before 0.96,
 
784
# for any platform.  Change "-O" to "-O3" or whatever, as desired...
 
785
linux_noasm:    unix_make
 
786
        $(MAKE) unzips CC=gcc LD=gcc CF="-O -Wall -I. $(LOC)"
 
787
 
 
788
# Linux with lcc compiler:  __inline__ (stat.h) not recognized, and must edit
 
789
# /usr/include/gnu/types.h to get rid of "long long" if __LCC__ defined.  -O3
 
790
# (or -O2 or -O) is ignored.  [GRR 960828: test target only]
 
791
#
 
792
linux_lcc:      unix_make
 
793
        $(MAKE) unzips CC=lcc LD=lcc CF="-O3 -Wall -I. -D__inline__= $(LOC)"
 
794
 
 
795
# Linux host with go32 (djgpp) cross-compiler (go32crs.tgz) for 32-bit DOS.
 
796
linux_dos:      unix_make
 
797
        $(MAKE) unzips CC=go32gcc LD=go32gcc M=msdos CF="-O2 -Wall -I. $(LOC)"
 
798
#       go32-strip unzip
 
799
#       Due to limitations of the cross-compiling package, this has to be
 
800
#       done manually:
 
801
        @echo Copy $(UNZIPS) to your DOS partition and use coff2exe.
 
802
 
 
803
# Linux ELF shared library (ooo, it's so easy).  This is a test target for
 
804
# now, and it only makes the UnZip/ZipInfo stuff (not fUnZip or UnZipSFX).
 
805
# The version number may eventually change to match the UnZip version.  Or
 
806
# not.  Whatever.  Also do "setenv LD_LIBRARY_PATH `pwd`" or similar to test
 
807
# the DLL in place (with unzip_shlib, which is UnZip linked with the shared
 
808
# library).
 
809
#
 
810
linux_shlib:    unix_make
 
811
#       $(MAKE) objsdll CC=gcc CF="-O3 -Wall -I. -fPIC -DDLL $(LOC)"
 
812
        $(MAKE) objsdll CC=gcc CF="-O3 -Wall -I. -fPIC -DDLL -DASM_CRC $(LOC)"\
 
813
         AS=gcc AF="-fPIC -Di386 $(AF)" CRC32=crc_gcc
 
814
        ln -sf crc_gcc.pic.o crc32.pic.o
 
815
        gcc -shared -Wl,-soname,libunzip.so.0 -o libunzip.so.0.4 $(OBJSDLL)
 
816
        ln -sf libunzip.so.0.4 libunzip.so.0
 
817
        ln -sf libunzip.so.0 libunzip.so
 
818
        gcc -c -O unzipstb.c
 
819
        gcc -o unzip_shlib unzipstb.o -L. -lunzip
 
820
 
 
821
# Linux ELF shared library, as above, but using inflate() from zlib (libz.so)
 
822
# instead of the original UnZip version.  (libz was libgz prior to 0.94)
 
823
linux_shlibz:   unix_make
 
824
#       $(MAKE) objsdll CC=gcc CF="-O3 -Wall -I. -fPIC -DDLL -DUSE_ZLIB $(LOC)"
 
825
        $(MAKE) objsdll CC=gcc AS=gcc AF="-fPIC -Di386 $(AF)" CRC32=crc_gcc\
 
826
         CF="-O3 -Wall -I. -fPIC -DDLL -DUSE_ZLIB -DASM_CRC $(LOC)"
 
827
        ln -sf crc_gcc.pic.o crc32.pic.o
 
828
        gcc -shared -Wl,-soname,libunzip.so.0 -o libunzip.so.0.4 $(OBJSDLL)
 
829
        ln -sf libunzip.so.0.4 libunzip.so.0
 
830
        gcc -c -O unzipstb.c
 
831
        gcc -o unzip unzipstb.o -L. -lunzip -lz
 
832
 
 
833
# LynxOS-x86 2.3.0 and newer, a real-time BSD-like OS; uses gcc.
 
834
lynx:           unix_make
 
835
        $(MAKE) unzips CC=gcc CF="$(CF) -DLynx -DLYNX -DBSD"
 
836
 
 
837
# Macintosh MacOS X (Unix-compatible enviroment), using standard compiler
 
838
macosx: unix_make
 
839
        $(MAKE) unzips CF="-O3 -Wall -I. -DBSD -DUNIX $(LOC)" LF2=""
 
840
        $(STRIP) $(UNZIPS)
 
841
 
 
842
# Macintosh MacOS X (Unix-compatible enviroment), using gcc
 
843
macosx_gcc:     unix_make
 
844
        $(MAKE) unzips CC=gcc CF="-O3 -Wall -I. -DBSD -DUNIX $(LOC)" LF2=""
 
845
        $(STRIP) $(UNZIPS)
 
846
 
 
847
# Minix 1.5 PC for the 386.  Invoke as is to use default cc, or as "make
 
848
# minix CC=gcc" to use gcc.  Try "make linux" if you have a working termios.h.
 
849
minix:          unix_make
 
850
        $(MAKE) unzips CF="$(CF) -DMINIX -DSHORT_NAMES" CC=$(CC) LD=$(CC)
 
851
 
 
852
# MPE/iX, the Unix variant for HP 3000 systems.
 
853
mpeix:          unix_make
 
854
        $(MAKE) unzips CC=c89\
 
855
         CF="$(CF) -D_POSIX_SOURCE -DHAVE_TERMIOS_H -DPASSWD_FROM_STDIN -DNO_PARAM_H"\
 
856
         LF2=-lbsd CP=cp LN="ln -s"
 
857
 
 
858
# NeXT info.
 
859
next:
 
860
        @echo
 
861
        @echo\
 
862
 '  Please pick a specific NeXT target:  "make next10" will create a generic'
 
863
        @echo\
 
864
 '  NeXT executable; "make next2x" will create a smaller executable (for'
 
865
        @echo\
 
866
 '  NeXTstep 2.0 and higher); "make next3x" will create a small executable'
 
867
        @echo\
 
868
 '  with significantly better optimization (NeXTstep 3.0 and higher only);'
 
869
        @echo\
 
870
 '  "make nextfat" will create a fat, multi-architecture (NeXT plus Intel)'
 
871
        @echo\
 
872
 '  executable (NeXTstep 3.1 and higher only).'
 
873
        @echo
 
874
 
 
875
# 68030 BSD 4.3+Mach.  NeXT 2.x: make the executable smaller.
 
876
next2x:         unix_make
 
877
        $(MAKE) unzips LF2="-object -s"
 
878
 
 
879
# NeXT 3.x: as above, plus better optimization.
 
880
next3x:         unix_make
 
881
        $(MAKE) unzips CF="-O2 -I. $(LOC)" LF2="-object -s"
 
882
 
 
883
# NeXT 3.1+: make the executable fat (multi-architecture binary [MAB],
 
884
# for "black" [NeXT] and "white" [x86] hardware, so far).
 
885
nextfat:        unix_make
 
886
        $(MAKE) unzips CF="-O2 -I. $(LOC) -arch i386 -arch m68k" \
 
887
         LF2="-arch i386 -arch m68k -object -s"
 
888
 
 
889
# IBM OS/390 (formerly MVS) compiled under "OpenEdition" shell
 
890
os390:          unix_make
 
891
        set -x; \
 
892
        $(MAKE) -f unix/Makefile unzips \
 
893
         CC=c89 LD="\$$(CC) -Wl,EDIT=NO" \
 
894
         CF="$(CF) -DSYSV -DOS390 -DEBCDIC -DNO_PARAM_H \
 
895
         -D_ALL_SOURCE $(HOST_VERSINFO)" LF2=""
 
896
 
 
897
# Sequent Symmetry running Dynix/ptx (sort of SysV.3):  needs to link
 
898
# with libseq to get symlink().
 
899
ptx:            unix_make
 
900
        $(MAKE) unzips CF="$(CF) -DSYSV -DTERMIO -DPTX" LF2="$(LF2) -lseq"
 
901
 
 
902
# Pyramid 90X (probably all) under >= OSx4.1, either universe.  (This is an
 
903
# experimental target!  If it fails, use either pyr_ucb or pyr_att instead.)
 
904
# The make in the BSD half is too stupid to understand $(MAKE), sigh...
 
905
pyramid:        unix_make
 
906
        -make -f unix/Makefile pyr_`universe`
 
907
 
 
908
# QNX/Neutrino is "special" because you don't have any native development
 
909
# tools yet.  Set ARCH to "x86", "ppcbe", "ppcle", "mipsbe", or "mipsle"
 
910
# to produce x86, PowerPC (big- or little-endian) and MIPS (big-
 
911
# or little-endian) using gcc. [cjh]
 
912
qnxnto:         unix_make
 
913
        @if [ "$(ARCH)" = "" ] ; then \
 
914
                echo "You didn't set ARCH; I'll assume you meant ARCH=x86..." ; \
 
915
                echo "" ; \
 
916
                $(MAKE) -f unix/Makefile CC="qcc -Vgcc_ntox86" unzips ; \
 
917
        else \
 
918
                echo "Making unzip for $(ARCH)..." ; \
 
919
                echo "" ; \
 
920
                $(MAKE) -f unix/Makefile CC="qcc -Vgcc_nto$(ARCH)" unzips ; \
 
921
        fi
 
922
 
 
923
# REGULUS:  68040-based, "real-time" SysV.3 mutant; uses gcc, with "REGULUS"
 
924
# predefined.
 
925
regulus:        unix_make
 
926
        $(MAKE) unzips CF="$(CF) -traditional -DSYSV -DNO_MKDIR"
 
927
 
 
928
# IBM RS/6000 under AIX 3.2
 
929
rs6000:         unix_make
 
930
        $(MAKE) unzips CF="$(CF) -DBSD -D_BSD" LF2="-lbsd"
 
931
 
 
932
# SCO cross compile from Unix to DOS. Tested with Xenix/386 and OpenDeskTop.
 
933
# Should work with Xenix/286 as well. (davidsen)  Note that you *must* remove
 
934
# the Unix objects and executable before doing this!  (Piet Plomp:  gcc won't
 
935
# recognize the -M0 flag that forces 8086 code.)  (GRR:  may need to reduce
 
936
# stack to 0c00h if using 286/small-model code...?)
 
937
sco_dos:        unix_make
 
938
        $(MAKE) unzips CF="-O -I. $(LOC) -dos -M0" M=msdos \
 
939
         LF="-dos -F 2000" LF2="-o unzip.exe" \
 
940
         FL="-dos" FL2="-o funzip.exe" SL="-dos" SL2="-o unzipsfx.exe"
 
941
 
 
942
# SCO UNIX with shared libraries and no international support.  If you are
 
943
# not using a USA-style keyboard and display, you may want to remove -nointl
 
944
# to get support.  It adds quite a bit to the size of the executable.
 
945
sco_sl:         unix_make
 
946
        $(MAKE) unzips LF="$(LF) -nointl" LF2="$(LF2) -lc_s"\
 
947
         SL="$(SL) -nointl" FL="$(FL) -nointl"
 
948
 
 
949
# SCO Xenix/286 2.2.3 or later with development system 2.2.1 or later
 
950
sco_x286:       unix_make
 
951
        $(MAKE) unzips CF="$(CF) -Mel2 -LARGE -DNO_MKDIR" \
 
952
         LF="$(LF) -Mel2 -LARGE -lx" SL="$(SL) -Mel2 -LARGE" \
 
953
         FL="$(FL) -Mel2 -LARGE"
 
954
 
 
955
# Sequent Symmetry with Dynix.  (386, but needs -DZMEM)
 
956
# This should also work on Balance but I can't test it just yet.
 
957
sequent:        unix_make
 
958
        $(MAKE) unzips CF="$(CF) -DBSD -DZMEM"
 
959
 
 
960
# Sun 2, 3, 4 running SunOS 3.x
 
961
sunos3:         unix_make
 
962
        $(MAKE) unzips CF="$(CF) -DNO_UID_GID -DUID_USHORT"
 
963
 
 
964
# Generic System V + GNU C
 
965
sysv_gcc:       unix_make
 
966
        $(MAKE) unzips CC=gcc LD=gcc CF="-O2 -I. -DUNIX -DSYSV $(LOC)" LF2=""
 
967
        $(STRIP) $(UNZIPS)
 
968
 
 
969
# AT&T 6300+, System V.2 Unix:  run-time out-of-memory error if don't use -Ml;
 
970
# also compile-time error if work arrays dimensioned at HSIZE+2 (>32K)
 
971
sysv6300:       unix_make
 
972
        $(MAKE) unzips CF="$(CF) -Ml -DSYSV" LF="$(LF) -Ml"\
 
973
         SL="$(SL) -Ml" FL="$(FL) -Ml"
 
974
 
 
975
# Texas Instruments System V.3 (running on HP 9000-1500)
 
976
ti_sysv:        unix_make
 
977
        $(MAKE) unzips CF="$(CF) -DSYSV -DNO_UID_GID -DUID_USHORT"
 
978
 
 
979
# SCO Xenix (Joe Foster 950508:  "unzip needs to be linked with -lx [for the
 
980
# opendir(), readdir(), telldir(), rewinddir(), and closedir() calls]")
 
981
xenix:           unix_make
 
982
        $(MAKE) unzips LF2="$(LF2) -lx"
 
983
 
 
984
# Wombat 68000 (or whatever).
 
985
# I didn't do this.  I swear.  No, really.
 
986
wombat:         unix_make
 
987
        @echo
 
988
        @echo  '        Ha ha!  Just kidding.'
 
989
        @echo