| 1 |
# Makefile for Zip, ZipNote, ZipCloak, ZipSplit for Aztec C 5.2 |
| 2 |
# Also ZipLM, a version of Zip that needs much less free memory |
| 3 |
# -- Paul Kienitz, last updated 07 Jan 2007 |
| 4 |
|
| 5 |
# Make sure platform is defined correctly, and select memory usage options: |
| 6 |
DEFINES = -d AMIGA -d DYN_ALLOC -d ASM_CRC |
| 7 |
|
| 8 |
CC = cc |
| 9 |
AS = as |
| 10 |
LD = ln |
| 11 |
LDLIBS = -lc16 |
| 12 |
|
| 13 |
|
| 14 |
# -------- RELEASE VERSION: |
| 15 |
CFLAGS = -psb0e -sabfmnpu -wcr0u $(DEFINES) |
| 16 |
# -pbs means unsigned chars and short ints, -sabfmnpu is various small |
| 17 |
# optimizations, -wcr0u adjusts type checking strictness |
| 18 |
ASOPTS = -n -eAMIGA -eDYN_ALLOC -eCPUTEST -eINT16 |
| 19 |
LDFLAGS = -m +q |
| 20 |
|
| 21 |
# -------- DEBUG VERSION: |
| 22 |
CFLAGD = -bs -psb0e -s0f0n -wcr0u $(DEFINES) |
| 23 |
# -bs is include source debugging info, -s0f0n is avoid hard-to-debug |
| 24 |
# optimizations |
| 25 |
LDFLAGD = -m +q -g -w |
| 26 |
|
| 27 |
# -------- MINIMUM MEMORY USAGE RELEASE VERSION: |
| 28 |
WSIZ = WSIZE=4096 |
| 29 |
LOWFLAGS = $(CFLAGS) -d $(WSIZ) -d SMALL_MEM |
| 30 |
LOWASOPTS = $(ASOPTS) -e$(WSIZ) -eSMALL_MEM |
| 31 |
# Options used for assembling amiga/deflate.a; must generally match the |
| 32 |
# settings in DEFINES. |
| 33 |
|
| 34 |
# -------- MINIMUM MEMORY USAGE DEBUG VERSION: |
| 35 |
LOWFLAGD = $(CFLAGD) -d $(WSIZ) -d SMALL_MEM |
| 36 |
|
| 37 |
# the directory where we stick all the object files: |
| 38 |
O = obA/ |
| 39 |
|
| 40 |
|
| 41 |
# default C rules |
| 42 |
.c.o : |
| 43 |
$(CC) $(CFLAGS) -o $@ $*.c |
| 44 |
|
| 45 |
# rules for routines containing entries needed by utilities |
| 46 |
.c.oo : |
| 47 |
$(CC) $(CFLAGS) -d UTIL -o $@ $*.c |
| 48 |
|
| 49 |
# rules for the low-memory version: |
| 50 |
|
| 51 |
.c.ol : |
| 52 |
$(CC) $(LOWFLAGS) -o $@ $*.c |
| 53 |
|
| 54 |
# default C rules for debugging |
| 55 |
.c.od : |
| 56 |
$(CC) $(CFLAGD) -o $@ $*.c |
| 57 |
|
| 58 |
# debugging rules for routines containing entries needed by utilities |
| 59 |
.c.dd : |
| 60 |
$(CC) $(CFLAGD) -d UTIL -o $@ $*.c |
| 61 |
|
| 62 |
# rules for the debugging low-memory version: |
| 63 |
|
| 64 |
.c.dl : |
| 65 |
$(CC) $(LOWFLAGD) -o $@ $*.c |
| 66 |
|
| 67 |
|
| 68 |
# object file lists |
| 69 |
|
| 70 |
ZIP_H = zip.h ziperr.h tailor.h amiga/osdep.h amiga/z-stat.h |
| 71 |
|
| 72 |
|
| 73 |
OBJZ = $(O)zip.o $(O)deflate.o \ |
| 74 |
$(O)trees.o $(O)zipfile.o $(O)zipup.o $(O)util.o $(O)timezone.o \ |
| 75 |
$(O)fileio.o $(O)globals.o $(O)crc32.o $(O)crypt.o $(O)ttyio.o \ |
| 76 |
$(O)amiga.o $(O)amigazip.o $(O)crc_68.o |
| 77 |
|
| 78 |
OBJL = $(O)zip.ol $(O)deflate.ol \ |
| 79 |
$(O)trees.ol $(O)zipfile.ol $(O)zipup.ol $(O)util.ol $(O)timezone.ol \ |
| 80 |
$(O)fileio.ol $(O)globals.ol $(O)crc32.ol $(O)crypt.ol $(O)ttyio.ol \ |
| 81 |
$(O)amiga.ol $(O)amigazip.ol $(O)crc_68.o |
| 82 |
|
| 83 |
OBJU = $(O)zipfile.oo $(O)fileio.oo \ |
| 84 |
$(O)util.oo $(O)globals.o $(O)amiga.oo $(O)amigazip.oo |
| 85 |
OBJN = $(O)zipnote.o $(OBJU) |
| 86 |
OBJC = $(O)zipcloak.o $(OBJU) $(O)crc32.oo \ |
| 87 |
$(O)crypt.oo $(O)ttyio.o |
| 88 |
OBJS = $(O)zipsplit.o $(OBJU) |
| 89 |
|
| 90 |
# These are the debuggable versions: |
| 91 |
|
| 92 |
DBJZ = $(O)zip.od $(O)deflate.od \ |
| 93 |
$(O)trees.od $(O)zipfile.od $(O)zipup.od $(O)util.od $(O)timezone.od \ |
| 94 |
$(O)fileio.od $(O)globals.od $(O)crc32.od $(O)crypt.od $(O)ttyio.od \ |
| 95 |
$(O)amiga.od $(O)amigazip.od $(O)crc_68.o |
| 96 |
|
| 97 |
DBJL = $(O)zip.dl $(O)deflate.dl \ |
| 98 |
$(O)trees.dl $(O)zipfile.dl $(O)zipup.dl $(O)util.dl $(O)timezone.dl \ |
| 99 |
$(O)fileio.dl $(O)globals.dl $(O)crc32.dl $(O)crypt.dl $(O)ttyio.dl \ |
| 100 |
$(O)amiga.dl $(O)amigazip.dl $(O)crc_68.o |
| 101 |
|
| 102 |
DBJU = $(O)zipfile.dd $(O)fileio.dd \ |
| 103 |
$(O)util.dd $(O)globals.od $(O)amiga.dd $(O)amigazip.dd |
| 104 |
DBJN = $(O)zipnote.od $(DBJU) |
| 105 |
DBJC = $(O)zipcloak.od $(DBJU) $(O)crc32.dd \ |
| 106 |
$(O)crypt.dd $(O)ttyio.od |
| 107 |
DBJS = $(O)zipsplit.od $(DBJU) |
| 108 |
|
| 109 |
|
| 110 |
# HERE WE GO: |
| 111 |
|
| 112 |
all : Zip ZipNote ZipSplit ZipCloak ZipLM |
| 113 |
|
| 114 |
z : Zip |
| 115 |
|
| 116 |
n : ZipNote |
| 117 |
|
| 118 |
s : ZipSplit |
| 119 |
|
| 120 |
c : ZipCloak |
| 121 |
|
| 122 |
l : ZipLM |
| 123 |
|
| 124 |
# Debug versions: |
| 125 |
|
| 126 |
dall : Zip.dbg ZipNote.dbg ZipSplit.dbg ZipCloak.dbg ZipLM.dbg |
| 127 |
|
| 128 |
dz : Zip.dbg |
| 129 |
|
| 130 |
dn : ZipNote.dbg |
| 131 |
|
| 132 |
ds : ZipSplit.dbg |
| 133 |
|
| 134 |
dc : ZipCloak.dbg |
| 135 |
|
| 136 |
dl : ZipLM.dbg |
| 137 |
|
| 138 |
|
| 139 |
Zip : $(OBJZ) $(ZIP_H) |
| 140 |
$(LD) $(LDFLAGS) -o $@ $(OBJZ) $(LDLIBS) |
| 141 |
-@delete Zip.dbg |
| 142 |
|
| 143 |
ZipNote : $(OBJN) $(ZIP_H) |
| 144 |
$(LD) $(LDFLAGS) -o $@ $(OBJN) $(LDLIBS) |
| 145 |
-@delete ZipNote.dbg |
| 146 |
|
| 147 |
ZipSplit : $(OBJS) $(ZIP_H) |
| 148 |
$(LD) $(LDFLAGS) -o $@ $(OBJS) $(LDLIBS) |
| 149 |
-@delete ZipSplit.dbg |
| 150 |
|
| 151 |
ZipCloak : $(OBJC) $(ZIP_H) |
| 152 |
$(LD) $(LDFLAGS) -o $@ $(OBJC) $(LDLIBS) |
| 153 |
-@delete ZipCloak.dbg |
| 154 |
|
| 155 |
ZipLM : $(OBJL) $(ZIP_H) |
| 156 |
$(LD) $(LDFLAGS) -o $@ $(OBJL) $(LDLIBS) |
| 157 |
-@delete ZipLM.dbg |
| 158 |
|
| 159 |
|
| 160 |
Zip.dbg : $(DBJZ) $(ZIP_H) |
| 161 |
$(LD) $(LDFLAGD) -o Zip $(DBJZ) $(LDLIBS) |
| 162 |
|
| 163 |
ZipNote.dbg : $(DBJN) $(ZIP_H) |
| 164 |
$(LD) $(LDFLAGD) -o ZipNote $(DBJN) $(LDLIBS) |
| 165 |
|
| 166 |
ZipSplit.dbg : $(DBJS) $(ZIP_H) |
| 167 |
$(LD) $(LDFLAGD) -o ZipSplit $(DBJS) $(LDLIBS) |
| 168 |
|
| 169 |
ZipCloak.dbg : $(DBJC) $(ZIP_H) |
| 170 |
$(LD) $(LDFLAGD) -o ZipCloak $(DBJC) $(LDLIBS) |
| 171 |
|
| 172 |
ZipLM.dbg : $(DBJL) $(ZIP_H) |
| 173 |
$(LD) $(LDFLAGD) -o ZipLM $(DBJL) $(LDLIBS) |
| 174 |
|
| 175 |
|
| 176 |
clean : bugclean |
| 177 |
-delete quiet $(OBJZ) |
| 178 |
-delete quiet $(OBJL) |
| 179 |
-delete quiet $(O)zipnote.o $(O)zipcloak.o $(O)zipsplit.o \ |
| 180 |
$(O)crypt.oo $(OBJU) |
| 181 |
|
| 182 |
bugclean : |
| 183 |
-delete quiet $(DBJZ) |
| 184 |
-delete quiet $(DBJL) |
| 185 |
-delete quiet $(O)zipnote.od $(O)zipcloak.od $(O)zipsplit.od \ |
| 186 |
$(O)crypt.dd $(DBJU) |
| 187 |
|
| 188 |
cleaner : clean |
| 189 |
-delete quiet Zip ZipNote ZipSplit ZipCloak ZipLM |
| 190 |
-delete quiet Zip.dbg ZipNote.dbg ZipSplit.dbg ZipCloak.dbg ZipLM.dbg |
| 191 |
|
| 192 |
|
| 193 |
# header dependencies: |
| 194 |
|
| 195 |
$(O)zip.o $(O)zipnote.o $(O)zipcloak.o $(O)zipsplit.o $(O)crypt.o $(O)ttyio.o \ |
| 196 |
$(O)deflate.o $(O)trees.o $(O)zipfile.o $(O)zipup.o $(O)fileio.o $(O)util.o \ |
| 197 |
$(O)timezone.o $(O)crc32.o $(O)globals.o $(O)amiga.o : $(ZIP_H) |
| 198 |
|
| 199 |
$(O)zip.ol $(O)zipnote.ol $(O)zipcloak.ol $(O)zipsplit.ol $(O)crypt.ol \ |
| 200 |
$(O)ttyio.ol $(O)deflate.ol $(O)trees.ol $(O)zipfile.ol $(O)zipup.ol \ |
| 201 |
$(O)fileio.ol $(O)util.ol $(O)timezone.ol $(O)crc32.ol $(O)globals.ol \ |
| 202 |
$(O)amiga.ol : $(ZIP_H) |
| 203 |
|
| 204 |
$(O)crc32.oo $(O)crypt.oo $(O)zipfile.oo $(O)fileio.oo $(O)util.oo : $(ZIP_H) |
| 205 |
|
| 206 |
$(O)amigazip.o $(O)amigazip.ol $(O)amigazip.oo : amiga/amiga.h $(ZIP_H) |
| 207 |
|
| 208 |
$(O)zip.o $(O)zipnote.o $(O)zipcloak.o $(O)zipsplit.o $(O)zipup.o \ |
| 209 |
$(O)zip.ol $(O)zipnote.ol $(O)zipcloak.ol $(O)zipsplit.ol \ |
| 210 |
$(O)zipup.ol : revision.h |
| 211 |
|
| 212 |
$(O)amiga.o $(O)amiga.ol : crypt.h |
| 213 |
|
| 214 |
$(O)crc32.o $(O)crc32.oo $(O)crc32.ol $(O)crypt.o $(O)crypt.oo $(O)crypt.ol \ |
| 215 |
$(O)zipcloak.o $(O)zipcloak.ol $(O)zip.o $(O)zip.ol \ |
| 216 |
$(O)zipup.o $(O)zipup.ol \ |
| 217 |
$(O)zipfile.o $(O)zipfile.oo $(O)zipfile.ol \ |
| 218 |
$(O)fileio.o $(O)fileio.oo $(O)fileio.ol : crc32.h |
| 219 |
|
| 220 |
$(O)crypt.o $(O)crypt.oo $(O)crypt.ol $(O)ttyio.o $(O)ttyio.ol \ |
| 221 |
$(O)zipcloak.o $(O)zipcloak.ol $(O)zip.o $(O)zip.ol \ |
| 222 |
$(O)zipup.o $(O)zipup.ol : crypt.h ttyio.h |
| 223 |
|
| 224 |
$(O)timezone.o $(O)timezone.ol $(O)timezone.od $(O)timezone.dl \ |
| 225 |
$(O)amiga.o $(O)amiga.ol $(O)amiga.oo : timezone.h |
| 226 |
|
| 227 |
$(O)zipup.o $(O)zipup.ol : amiga/zipup.h |
| 228 |
|
| 229 |
|
| 230 |
# SPECIAL CASES: |
| 231 |
|
| 232 |
# -mr changes expression parsing; avoids a bogus "expression too complex" error: |
| 233 |
$(O)trees.o : trees.c |
| 234 |
$(CC) $(CFLAGS) -mr -o $@ trees.c |
| 235 |
|
| 236 |
$(O)trees.ol : trees.c |
| 237 |
$(CC) $(LOWFLAGS) -mr -o $@ trees.c |
| 238 |
|
| 239 |
$(O)trees.od : trees.c |
| 240 |
$(CC) $(CFLAGD) -mr -o $@ trees.c |
| 241 |
|
| 242 |
$(O)trees.ld : trees.c |
| 243 |
$(CC) $(LOWFLAGD) -mr -o $@ trees.c |
| 244 |
|
| 245 |
# Substitute the assembly version of deflate.c: (but not in debug version) |
| 246 |
$(O)deflate.o : amiga/deflate.a |
| 247 |
$(AS) $(ASOPTS) -o $@ amiga/deflate.a |
| 248 |
|
| 249 |
$(O)deflate.ol : amiga/deflate.a |
| 250 |
$(AS) $(LOWASOPTS) -o $@ amiga/deflate.a |
| 251 |
|
| 252 |
# The assembly CRC function: |
| 253 |
$(O)crc_68.o : amiga/crc_68.a |
| 254 |
$(AS) -n -o $@ amiga/crc_68.a |
| 255 |
|
| 256 |
# Put the Amiga internal version data with today's date into amiga.c: |
| 257 |
$(O)amiga.o : amiga/amiga.c amiga/filedate.c amiga/stat.c |
| 258 |
rx > env:VersionDate "say '""'translate(date('E'), '.', '/')'""'" |
| 259 |
$(CC) $(CFLAGS) -o $@ amiga/amiga.c |
| 260 |
delete env:VersionDate |
| 261 |
|
| 262 |
$(O)amiga.ol : amiga/amiga.c amiga/filedate.c amiga/stat.c |
| 263 |
rx > env:VersionDate "say '""'translate(date('E'), '.', '/')'""'" |
| 264 |
$(CC) $(LOWFLAGS) -o $@ amiga/amiga.c |
| 265 |
delete env:VersionDate |
| 266 |
|
| 267 |
$(O)amiga.od : amiga/amiga.c amiga/filedate.c amiga/stat.c |
| 268 |
rx > env:VersionDate "say '""'translate(date('E'), '.', '/')'""'" |
| 269 |
$(CC) $(CFLAGD) -o $@ amiga/amiga.c |
| 270 |
delete env:VersionDate |
| 271 |
|
| 272 |
$(O)amiga.ld : amiga/amiga.c amiga/filedate.c amiga/stat.c |
| 273 |
rx > env:VersionDate "say '""'translate(date('E'), '.', '/')'""'" |
| 274 |
$(CC) $(LOWFLAGD) -o $@ amiga/amiga.c |
| 275 |
delete env:VersionDate |
| 276 |
|
| 277 |
$(O)amiga.oo : amiga/amiga.c amiga/filedate.c amiga/stat.c |
| 278 |
rx > env:VersionDate "say '""'translate(date('E'), '.', '/')'""'" |
| 279 |
$(CC) $(CFLAGS) -d UTIL -o $@ amiga/amiga.c |
| 280 |
delete env:VersionDate |
| 281 |
|
| 282 |
$(O)amiga.dd : amiga/amiga.c amiga/filedate.c amiga/stat.c |
| 283 |
rx > env:VersionDate "say '""'translate(date('E'), '.', '/')'""'" |
| 284 |
$(CC) $(CFLAGD) -d UTIL -o $@ amiga/amiga.c |
| 285 |
delete env:VersionDate |
| 286 |
|
| 287 |
# Put the compiler version number into amigazip.c: |
| 288 |
$(O)amigazip.o : amiga/amigazip.c |
| 289 |
$(CC) $(CFLAGS) -o $@ -d __VERSION__=5 -d __REVISION__=2 amiga/amigazip.c |
| 290 |
|
| 291 |
$(O)amigazip.ol : amiga/amigazip.c |
| 292 |
$(CC) $(LOWFLAGS) -o $@ -d __VERSION__=5 -d __REVISION__=2 amiga/amigazip.c |
| 293 |
|
| 294 |
$(O)amigazip.od : amiga/amigazip.c |
| 295 |
$(CC) $(CFLAGD) -o $@ -d __VERSION__=5 -d __REVISION__=2 amiga/amigazip.c |
| 296 |
|
| 297 |
$(O)amigazip.ld : amiga/amigazip.c |
| 298 |
$(CC) $(LOWFLAGD) -o $@ -d __VERSION__=5 -d __REVISION__=2 amiga/amigazip.c |
| 299 |
|
| 300 |
$(O)amigazip.oo : amiga/amigazip.c |
| 301 |
$(CC) $(CFLAGS) -d UTIL -o $@ -d __VERSION__=5 -d __REVISION__=2 amiga/amigazip.c |
| 302 |
|
| 303 |
$(O)amigazip.dd : amiga/amigazip.c |
| 304 |
$(CC) $(CFLAGD) -d UTIL -o $@ -d __VERSION__=5 -d __REVISION__=2 amiga/amigazip.c |