1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229
|
#==============================================================================
# Makefile for UnZip, UnZipSFX and fUnZip: Atari ST Chris Herborth
# Version: UnZip 5.20+, MiNT, GNU C 25 December 2006
#==============================================================================
# Based on the original unix Makefile and modified by Chris Herborth
# (cherborth@semprini.waterloo-rdp.on.ca), Nov.13/93.
# Be sure to test your new UnZip (and UnZipSFX and fUnZip); successful com-
# pilation does not always imply a working program.
#####################
# MACRO DEFINITIONS #
#####################
# Defaults most systems use (use LOCAL_UNZIP in environment to add flags,
# such as -DDOSWILD).
# UnZip flags
# NOTE: 'cgcc' is my cross-compiler; you'll probably use 'gcc' instead.
CC = cgcc
LD = cgcc
LOC = $(LOCAL_UNZIP) -ansi -D__MINT__ -U__STRICT_ANSI__
CF = -mbaserel -mpcrel -O2 -fomit-frame-pointer -I. $(LOC)
# CF = -O -I. $(LOC)
# CF = -mbaserel -O -I. $(LOC)
LF = -mbaserel -mpcrel -o unzip.ttp
LF2 = -s -lbiio
# UnZipSFX flags
XC = -DSFX
XL = -mbaserel -mpcrel -o unzipsfx.ttp
XL2 = $(LF2)
# fUnZip flags
FC = -DFUNZIP
FL = -mbaserel -mpcrel -o funzip.ttp
FL2 = $(LF2)
# general-purpose stuff
CP = cp
LN = ln -s
RM = rm -f
E = .ttp
O = .o
M = atari
SHELL = /bin/sh
# object files
OBJS1 = unzip$O crc32$O crypt$O envargs$O explode$O
OBJS2 = extract$O fileio$O globals$O inflate$O list$O match$O
OBJS3 = process$O ttyio$O ubz2err$O unreduce$O unshrink$O zipinfo$O
OBJS = $(OBJS1) $(OBJS2) $(OBJS3) $M$O
LOBJS = $(OBJS)
OBJX = unzipsfx$O crc32$O crypt_$O extract_$O fileio_$O \
globals_$O inflate_$O match_$O process_$O ttyio_$O ubz2err_$O $M_$O
OBJF = funzip$O crc32$O cryptf$O globalsf$O inflatef$O ttyiof$O
UNZIP_H = unzip.h unzpriv.h globals.h
# installation
INSTALL = cp# probably can change this to 'install' if you have it
# on some systems, manext=l and MANDIR=/usr/man/man$(manext) may be appropriate
manext = 1
MANDIR = /usr/local/man/man$(manext)# where to install man pages
BINDIR = /usr/local/bin# where to install executables
#
UNZIPS = unzip$E funzip$E unzipsfx$E zipinfo$E
MANS = unzip.$(manext) unzipsfx.$(manext) zipinfo.$(manext) funzip.$(manext)
DOCS = unzip.txt unzipsfx.txt zipinfo.txt funzip.txt
# this is a little ugly...
INSTALLED = $(BINDIR)/unzip$E $(BINDIR)/zipinfo$E $(BINDIR)/funzip$E \
$(BINDIR)/unzipsfx$E $(MANDIR)/unzipsfx.$(manext) \
$(MANDIR)/unzip.$(manext) $(MANDIR)/zipinfo.$(manext) \
$(MANDIR)/funzip.$(manext)
###############################################
# BASIC COMPILE INSTRUCTIONS AND DEPENDENCIES #
###############################################
.c$O:
$(CC) -c $(CF) $*.c
all: unzips
unzips: $(UNZIPS)
docs: $(DOCS)
unzipsman: unzips docs
unzipsdocs: unzips docs
clean:
rm -f $(OBJS) $(OBJF) $(OBJX) $(UNZIPS)
install: $(UNZIPS) $(MANS)
$(INSTALL) $(UNZIPS) $(BINDIR)
$(LN) $(BINDIR)/unzip$E $(BINDIR)/zipinfo$E
$(INSTALL) man/unzip.1 $(MANDIR)/unzip.$(manext)
$(INSTALL) man/unzipsfx.1 $(MANDIR)/unzipsfx.$(manext)
$(INSTALL) man/zipinfo.1 $(MANDIR)/zipinfo.$(manext)
$(INSTALL) man/funzip.1 $(MANDIR)/funzip.$(manext)
# alternatively, could use zip method: -cd $(BINDIR); rm -f $(UNZIPS) [etc.]
uninstall:
rm -f $(INSTALLED)
unzip$E: $(OBJS) # add `&' if parallel makes supported
$(LD) $(LF) $(LOBJS) $(LF2)
unzipsfx$E: $(OBJX) # add `&' if parallel makes supported
$(LD) $(XL) $(OBJX) $(XL2)
funzip$E: $(OBJF) # add `&' if parallel makes supported
$(LD) $(FL) $(OBJF) $(FL2)
zipinfo$E: unzip$E
@echo\
' This is a Unix-inspired target. If your filesystem does not support'
@echo\
' symbolic links, copy unzip.ttp to zipinfo.ttp rather than linking it,'
@echo\
' or else invoke as "unzip -Z".'
$(LN) unzip$E zipinfo$E
crc32$O: crc32.c $(UNZIP_H) zip.h crc32.h
crypt$O: crypt.c $(UNZIP_H) zip.h crypt.h crc32.h ttyio.h
envargs$O: envargs.c $(UNZIP_H)
explode$O: explode.c $(UNZIP_H)
extract$O: extract.c $(UNZIP_H) crc32.h crypt.h
fileio$O: fileio.c $(UNZIP_H) crc32.h crypt.h ttyio.h ebcdic.h
funzip$O: funzip.c $(UNZIP_H) crc32.h crypt.h ttyio.h
globals$O: globals.c $(UNZIP_H)
inflate$O: inflate.c inflate.h $(UNZIP_H)
list$O: list.c $(UNZIP_H)
match$O: match.c $(UNZIP_H)
process$O: process.c $(UNZIP_H) crc32.h
ttyio$O: ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h
ubz2err$O: ubz2err.c $(UNZIP_H)
unreduce$O: unreduce.c $(UNZIP_H)
unshrink$O: unshrink.c $(UNZIP_H)
unzip$O: unzip.c $(UNZIP_H) crypt.h unzvers.h consts.h
zipinfo$O: zipinfo.c $(UNZIP_H)
# unzipsfx only
crypt_$O: crypt.c $(UNZIP_H) zip.h crypt.h crc32.h ttyio.h
$(CP) crypt.c crypt_.c
$(CC) -c $(CF) $(XC) crypt_.c
$(RM) crypt_.c
extract_$O: extract.c $(UNZIP_H) crc32.h crypt.h
$(CP) extract.c extract_.c
$(CC) -c $(CF) $(XC) extract_.c
$(RM) extract_.c
fileio_$O: fileio.c $(UNZIP_H) crc32.h crypt.h ttyio.h ebcdic.h
$(CP) fileio.c fileio_.c
$(CC) -c $(CF) $(XC) fileio_.c
$(RM) fileio_.c
globals_$O: globals.c $(UNZIP_H)
$(CP) globals.c globals_.c
$(CC) -c $(CF) $(XC) globals_.c
$(RM) globals_.c
inflate_$O: inflate.c inflate.h $(UNZIP_H) crypt.h
$(CP) inflate.c inflate_.c
$(CC) -c $(CF) $(XC) inflate_.c
$(RM) inflate_.c
match_$O: match.c $(UNZIP_H)
$(CP) match.c match_.c
$(CC) -c $(CF) $(XC) match_.c
$(RM) match_.c
process_$O: process.c $(UNZIP_H) crc32.h
$(CP) process.c process_.c
$(CC) -c $(CF) $(XC) process_.c
$(RM) process_.c
ttyio_$O: ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h
$(CP) ttyio.c ttyio_.c
$(CC) -c $(CF) $(XC) ttyio_.c
$(RM) ttyio_.c
ubz2err_$O: ubz2err.c $(UNZIP_H)
$(CP) ubz2err.c ubz2err_.c
$(CC) -c $(CF) $(XC) ubz2err_.c
$(RM) ubz2err_.c
unzipsfx$O: unzip.c $(UNZIP_H) crypt.h unzvers.h consts.h
$(CP) unzip.c unzip_.c
$(CC) -c $(CF) $(XC) unzip_.c
$(RM) unzip_.c
# funzip only
cryptf$O: crypt.c $(UNZIP_H) zip.h crypt.h crc32.h ttyio.h
$(CP) crypt.c cryptf.c
$(CC) -c $(CF) $(FC) cryptf.c
$(RM) cryptf.c
globalsf$O: globals.c $(UNZIP_H)
$(CP) globals.c globalsf.c
$(CC) -c $(CF) $(FC) globalsf.c
$(RM) globalsf.c
inflatef$O: inflate.c inflate.h $(UNZIP_H) crypt.h
$(CP) inflate.c inflatef.c
$(CC) -c $(CF) $(FC) inflatef.c
$(RM) inflatef.c
ttyiof$O: ttyio.c $(UNZIP_H) zip.h crypt.h ttyio.h
$(CP) ttyio.c ttyiof.c
$(CC) -c $(CF) $(FC) ttyiof.c
$(RM) ttyiof.c
# system-specific code
atari$O: atari/atari.c $(UNZIP_H) # Atari only
$(CC) -c $(CF) atari/atari.c
atari_$O: atari/atari.c $(UNZIP_H) # unzipsfx only
$(CP) atari/atari.c atari_.c
$(CC) -c $(CF) $(XC) atari_.c
$(RM) atari_.c
|