# Makefile for Zip, ZipNote, ZipCloak and ZipSplit, Amiga SAS/C 5.10b
# See the master Makefile under the top level Zip/Unzip source directory
# for more information on compiler macros and flags for this version.
# Last update: Jun 25, 1998
# -John Bush, <J.Bush@MD-B.Prime.COM>, <JBush@BIX.COM>


#######################
# MACROBE DEFINITIONS #
#######################

# Compiler and loader debug flags.  Omit comments as req'd.
# Do not set when building production version.
# CDBG = -d3
# LDBG = ADDSYM

DEFINES = -DNO_MKTEMP
CC = lc
OPT = -O
CFLAGS = $(OPT) $(DEFINES) $(CDBG) -v -mat -cuisf -b0 -j85i86i87i100i

LD = blink
LDSTART = LIB:c.o
LDFLAGS = LIB LIB:lc.lib+LIB:amiga.lib

TMPFILE = ram:MakeZip.tmp

###############################################
# BASIC COMPILE INSTRUCTIONS AND DEPENDENCIES #
###############################################

# default C rules
.c.o:
        $(CC) $(CFLAGS) -o$@ $*.c

# Alternate rules for routines containing entries needed by utilities
.c.oo:
        $(CC) $(CFLAGS) -DUTIL -o$*.oo $*.c

# object file macrough lists

HFILES = zip.h ziperr.h tailor.h revision.h crypt.h ttyio.h amiga/amiga.h \
         amiga/zipup.h amiga/osdep.h

OBJA = zipfile.o zipup.o fileio.o util.o globals.o crc32.o crctab.o crypt.o \
       ttyio.o amiga.o amigazip.o time_lib.o
OBJI = deflate.o trees.o
OBJU = zipfile.oo fileio.oo util.oo globals.o amiga.o amigazip.oo time_lib.o

OBJZ = zip.o $(OBJA) $(OBJI)

OBJN = zipnote.o  $(OBJU)
OBJC = zipcloak.o $(OBJU) crctab.o crypt.oo ttyio.o
OBJS = zipsplit.o $(OBJU)

ZIPS = zip zipnote zipcloak zipsplit

all:      Message $(ZIPS)

Message:
       -echo " "
       -echo "WARNING: Lattice 5.x HAS NOT BEEN TESTED WITH THIS ZIP VERSION"
       -echo "Report problems to <zip-bugs@lists.wku.edu>"
       -echo " "

zip: $(OBJZ) $(HFILES)
        -echo "$(OBJZ)" > $(TMPFILE)
	$(LD) TO Zip      FROM $(LDSTART) WITH $(TMPFILE) $(LDFLAGS) $(LDBG)
        -delete $(TMPFILE) Zip.info

zipnote: $(OBJN) $(HFILES)
        -echo "$(OBJN)" > $(TMPFILE)
	$(LD) TO ZipNote  FROM $(LDSTART) WITH $(TMPFILE) $(LDFLAGS) $(LDBG)
        -delete $(TMPFILE) ZipNote.info

zipcloak: $(OBJC) $(HFILES)
        -echo "$(OBJC)" > $(TMPFILE)
	$(LD) TO ZipCloak FROM $(LDSTART) WITH $(TMPFILE) $(LDFLAGS) $(LDBG)
        -delete $(TMPFILE) ZipCloak.info

zipsplit: $(OBJS) $(HFILES)
        -echo "$(OBJS)" > $(TMPFILE)
	$(LD) TO ZipSplit FROM $(LDSTART) WITH $(TMPFILE) $(LDFLAGS) $(LDBG)
        -delete $(TMPFILE) ZipSplit.info

clean:
       -delete $(OBJZ) all quiet force >nil:
       -delete $(OBJU) all quiet force >nil:
       -delete $(OBJA) all quiet force >nil:
       -delete $(OBJI) all quiet force >nil:
       -delete $(OBJN) all quiet force >nil:
       -delete $(OBJC) all quiet force >nil:
       -delete $(OBJS) all quiet force >nil:

zip.o:      zip.c      $(HFILES)
zipnote.o:  zipnote.c  $(HFILES)
zipcloak.o: zipcloak.c $(HFILES)
crypt.o:    crypt.c    $(HFILES)
ttyio.o:    ttyio.c    $(HFILES)
zipsplit.o: zipsplit.c $(HFILES)
deflate.o:  deflate.c  $(HFILES)
trees.o:    trees.c    $(HFILES)
zipfile.o:  zipfile.c  $(HFILES)
zipup.o:    zipup.c    $(HFILES)
fileio.o:   fileio.c   $(HFILES)
util.o:     util.c     $(HFILES)
crc32.o:    crc32.c    $(HFILES)
crctab.o:   crctab.c   $(HFILES)
globals.o:  globals.c  $(HFILES)

# Amiga specific objects
amiga.o: amiga/amiga.c $(HFILES)
amigazip.o: amiga/amigazip.c $(HFILES)
time_lib.o: amiga/time_lib.c

# end of Makefile
