1
#==============================================================================
2
# Makefile for UnZip, UnZipSFX & fUnZip: Atari ST Chris Herborth
3
# Version: UnZip 5.20+, MiNT, GNU C 13 February 2001
4
#==============================================================================
6
# Based on the original unix Makefile and modified by Chris Herborth
7
# (cherborth@semprini.waterloo-rdp.on.ca), Nov.13/93.
9
# Be sure to test your new UnZip (and UnZipSFX and fUnZip); successful com-
10
# pilation does not always imply a working program.
17
# Defaults most systems use (use LOCAL_UNZIP in environment to add flags,
21
# NOTE: 'cgcc' is my cross-compiler; you'll probably use 'gcc' instead.
24
LOC = $(LOCAL_UNZIP) -ansi -D__MINT__ -U__STRICT_ANSI__
26
CF = -mbaserel -mpcrel -O2 -fomit-frame-pointer -I. $(LOC)
28
# CF = -mbaserel -O -I. $(LOC)
29
LF = -mbaserel -mpcrel -o unzip.ttp
34
XL = -mbaserel -mpcrel -o unzipsfx.ttp
39
FL = -mbaserel -mpcrel -o funzip.ttp
42
# general-purpose stuff
52
OBJS1 = unzip$O crc32$O crctab$O crypt$O envargs$O explode$O
53
OBJS2 = extract$O fileio$O globals$O inflate$O list$O match$O
54
OBJS3 = process$O ttyio$O unreduce$O unshrink$O zipinfo$O
55
OBJS = $(OBJS1) $(OBJS2) $(OBJS3) $M$O
57
OBJX = unzipsfx$O crc32$O crctab_$O crypt_$O extract_$O fileio_$O \
58
globals_$O inflate_$O match_$O process_$O ttyio_$O $M_$O
59
OBJF = funzip$O crc32$O cryptf$O globalsf$O inflatef$O ttyiof$O
61
UNZIP_H = unzip.h unzpriv.h globals.h
64
INSTALL = cp# probably can change this to 'install' if you have it
65
# on some systems, manext=l and MANDIR=/usr/man/man$(manext) may be appropriate
67
MANDIR = /usr/local/man/man$(manext)# where to install man pages
68
BINDIR = /usr/local/bin# where to install executables
70
UNZIPS = unzip$E funzip$E unzipsfx$E zipinfo$E
71
MANS = unzip.$(manext) unzipsfx.$(manext) zipinfo.$(manext) funzip.$(manext)
72
DOCS = unzip.txt unzipsfx.txt zipinfo.txt funzip.txt
73
# this is a little ugly...
74
INSTALLED = $(BINDIR)/unzip$E $(BINDIR)/zipinfo$E $(BINDIR)/funzip$E \
75
$(BINDIR)/unzipsfx$E $(MANDIR)/unzipsfx.$(manext) \
76
$(MANDIR)/unzip.$(manext) $(MANDIR)/zipinfo.$(manext) \
77
$(MANDIR)/funzip.$(manext)
79
###############################################
80
# BASIC COMPILE INSTRUCTIONS AND DEPENDENCIES #
81
###############################################
90
unzipsman: unzips docs
91
unzipsdocs: unzips docs
95
rm -f $(OBJS) $(OBJF) $(OBJX) $(UNZIPS)
97
install: $(UNZIPS) $(MANS)
98
$(INSTALL) $(UNZIPS) $(BINDIR)
99
$(LN) $(BINDIR)/unzip$E $(BINDIR)/zipinfo$E
100
$(INSTALL) man/unzip.1 $(MANDIR)/unzip.$(manext)
101
$(INSTALL) man/unzipsfx.1 $(MANDIR)/unzipsfx.$(manext)
102
$(INSTALL) man/zipinfo.1 $(MANDIR)/zipinfo.$(manext)
103
$(INSTALL) man/funzip.1 $(MANDIR)/funzip.$(manext)
105
# alternatively, could use zip method: -cd $(BINDIR); rm -f $(UNZIPS) [etc.]
110
unzip$E: $(OBJS) # add `&' if parallel makes supported
111
$(LD) $(LF) $(LOBJS) $(LF2)
113
unzipsfx$E: $(OBJX) # add `&' if parallel makes supported
114
$(LD) $(XL) $(OBJX) $(XL2)
116
funzip$E: $(OBJF) # add `&' if parallel makes supported
117
$(LD) $(FL) $(OBJF) $(FL2)
121
' This is a Unix-inspired target. If your filesystem does not support'
123
' symbolic links, copy unzip.ttp to zipinfo.ttp rather than linking it,'
125
' or else invoke as "unzip -Z".'
126
$(LN) unzip$E zipinfo$E
129
crc32$O: crc32.c $(UNZIP_H) zip.h
130
crctab$O: crctab.c $(UNZIP_H) zip.h
131
crypt$O: crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h
132
envargs$O: envargs.c $(UNZIP_H)
133
explode$O: explode.c $(UNZIP_H)
134
extract$O: extract.c $(UNZIP_H) crypt.h
135
fileio$O: fileio.c $(UNZIP_H) crypt.h ttyio.h ebcdic.h
136
funzip$O: funzip.c $(UNZIP_H) crypt.h ttyio.h tables.h
137
globals$O: globals.c $(UNZIP_H)
138
inflate$O: inflate.c inflate.h $(UNZIP_H)
139
list$O: list.c $(UNZIP_H)
140
match$O: match.c $(UNZIP_H)
141
process$O: process.c $(UNZIP_H)
142
ttyio$O: ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h
143
unreduce$O: unreduce.c $(UNZIP_H)
144
unshrink$O: unshrink.c $(UNZIP_H)
145
unzip$O: unzip.c $(UNZIP_H) crypt.h unzvers.h consts.h
146
zipinfo$O: zipinfo.c $(UNZIP_H)
148
crctab_$O: crctab.c $(UNZIP_H) zip.h
149
$(CP) crctab.c crctab_.c
150
$(CC) -c $(CF) $(XC) crctab_.c
153
crypt_$O: crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h # unzipsfx only
154
$(CP) crypt.c crypt_.c
155
$(CC) -c $(CF) $(XC) crypt_.c
158
extract_$O: extract.c $(UNZIP_H) crypt.h # unzipsfx only
159
$(CP) extract.c extract_.c
160
$(CC) -c $(CF) $(XC) extract_.c
163
fileio_$O: fileio.c $(UNZIP_H) crypt.h ttyio.h ebcdic.h
164
$(CP) fileio.c fileio_.c
165
$(CC) -c $(CF) $(XC) fileio_.c
168
globals_$O: globals.c $(UNZIP_H)
169
$(CP) globals.c globals_.c
170
$(CC) -c $(CF) $(XC) globals_.c
173
inflate_$O: inflate.c inflate.h $(UNZIP_H) crypt.h # unzipsfx only
174
$(CP) inflate.c inflate_.c
175
$(CC) -c $(CF) $(XC) inflate_.c
178
match_$O: match.c $(UNZIP_H)
179
$(CP) match.c match_.c
180
$(CC) -c $(CF) $(XC) match_.c
183
process_$O: process.c $(UNZIP_H) # unzipsfx only
184
$(CP) process.c process_.c
185
$(CC) -c $(CF) $(XC) process_.c
188
ttyio_$O: ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h # unzipsfx only
189
$(CP) ttyio.c ttyio_.c
190
$(CC) -c $(CF) $(XC) ttyio_.c
193
unzipsfx$O: unzip.c $(UNZIP_H) crypt.h unzvers.h consts.h # unzipsfx only
194
$(CP) unzip.c unzip_.c
195
$(CC) -c $(CF) $(XC) unzip_.c
199
cryptf$O: crypt.c $(UNZIP_H) zip.h crypt.h ttyio.h # funzip only
200
$(CP) crypt.c cryptf.c
201
$(CC) -c $(CF) $(FC) cryptf.c
204
globalsf$O: globals.c $(UNZIP_H) # funzip only
205
$(CP) globals.c globalsf.c
206
$(CC) -c $(CF) $(FC) globalsf.c
209
inflatef$O: inflate.c inflate.h $(UNZIP_H) crypt.h # funzip only
210
$(CP) inflate.c inflatef.c
211
$(CC) -c $(CF) $(FC) inflatef.c
214
ttyiof$O: ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h # funzip only
215
$(CP) ttyio.c ttyiof.c
216
$(CC) -c $(CF) $(FC) ttyiof.c
219
# atari$O: atari/atari.c $(UNZIP_H) # Atari only
220
# $(CC) -c $(CF) atari/atari.c
222
atari$O: atari.c $(UNZIP_H)
224
atari_$O: atari.c $(UNZIP_H) # unzipsfx only
225
$(CP) atari.c atari_.c
226
$(CC) -c $(CF) $(XC) atari_.c