# @(#) makefile 2.2 88/01/27 19:37:59 
#Make Zoo
#
#The contents of this makefile are hereby released to the public domain.
#                                  -- Rahul Dhesi 1986/12/31
#
#This makefile should not be invoked directly, because different 
#targets require different compilation switches.  The standard make
#utility does not allow different switches to be specified for each target
#(except through recursive invocation, which takes more memory than 
#some systems have).  Invoke this makefile through one of the several
#shell scripts supplied.  For non *NIX systems, convert the appropriate
#shell script to one accepted by your system.
#
#This makefile expects two macro names, `cswitch' and `extra', to hold
#all the switches to be supplied to the C compiler.  It also expects
#a macro `ldswitch' to hold the switch for the loader when invoked.
#
#There is no target for installation.  Just copy the executables
#(zoo and fiz) to the appropriate destination directory.
#
#"make lint" will probably not work.

CC = cc
cswitch = -c -O -DBSD4_3 -A nansi
extra = -DBIG_MEM -DNDEBUG  

#List of all object files created for Zoo
ZOOOBJS = 	addbfcrc.o addfname.o basename.o comment.o crcdefs.o \
		getfile.o lzc.o lzd.o machine.o makelist.o misc.o misc2.o \
		nextfile.o needed.o options.o parse.o portable.o prterror.o \
		version.o zoo.o zooadd.o zooadd2.o zoodel.o zooext.o zoofilt.o \
		zoolist.o zoopack.o

FIZOBJS = fiz.o addbfcrc.o portable.o crcdefs.o

.c.o :
	$(CC) $(cswitch) $(extra) $*.c

all : zoo fiz

#doesn't work
lint: $(ZOOOBJS)
	lint $(ZOOOBJS)

zoo: $(ZOOOBJS)
	$(CC) -o zoo $(ZOOOBJS)

fiz: $(FIZOBJS)
	$(CC) -o fiz $(FIZOBJS)

clean :
	/bin/rm -f core a.out $(ZOOOBJS) $(FIZOBJS)

lzd.o : lzd.c zoomem.h
	$(CC) $(cswitch) $(extra) $*.c

lzc.o : lzc.c zoomem.h
	$(CC) $(cswitch) $(extra) $*.c

addbfcrc.o : addbfcrc.c

addfname.o : addfname.c

basename.o : basename.c

comment.c : zooio.h

crcdefs.o : crcdefs.c

getfile.o : getfile.c zoomem.h
	$(CC) $(cswitch) $(extra) $*.c

machine.o : machine.c nixtime.i
	$(CC) $(cswitch) $(extra) $*.c

makelist.o : makelist.c

misc.c : zooio.h

misc2.o : misc2.c zoomem.h
	$(CC) $(cswitch) $(extra) $*.c

options.o : options.c

nextfile.o :  nextfile.c

needed.o : needed.c

parse.o : parse.c

portable.o : portable.c

prterror.o : prterror.c

zoo.o :   zoo.c zoomem.h errors.i
	$(CC) $(cswitch) $(extra) $*.c

zooadd.c : zooio.h

zooadd2.c : zooio.h

zoodel.c : zooio.h

zooext.o : zooext.c  errors.i zooio.h
	$(CC) $(cswitch) $(extra) $*.c

zoofilt.o : zoofilt.c zooio.h
	$(CC) $(cswitch) $(extra) $*.c

zoolist.c : zooio.h

zoopack.c : zooio.h
