# 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: Feb 7, 1993
# -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 -DPROTO
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

OBJA = zipfile.o zipup.o fileio.o util.o globals.o crypt.o amiga.o
OBJI = deflate.o trees.o bits.o
OBJU = zipfile.oo zipup.oo fileio.oo util.oo globals.o

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

OBJN = zipnote.o  $(OBJU)
OBJC = zipcloak.o $(OBJU) crypt.oo
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@wkuvx1.bitnet>"
       -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)
zipsplit.o: zipsplit.c $(HFILES)
deflate.o:  deflate.c  $(HFILES)
trees.o:    trees.c    $(HFILES)
bits.o:     bits.c     $(HFILES)
zipfile.o:  zipfile.c  $(HFILES)
zipup.o:    zipup.c    $(HFILES)
fileio.o:   fileio.c   $(HFILES)
util.o:     util.c     $(HFILES)
globals.o:  globals.c  $(HFILES)

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

# end of Makefile
