#
# Copyright 1987 Apple Computer, Inc.
# $Header: makefile,v 1.20 87/11/10 02:54:20 rpd Exp $
#
# $Log:	makefile,v $
# Revision 1.20  87/11/10  02:54:20  rpd
# Killed filemgr.o and filemgr2.o
# Added new filemgr files
# 
# Revision 1.19  87/11/10  00:32:14  rpd
# Added STRIPFLAG to make install
# 
# Revision 1.18  87/10/16  15:41:49  rpd
# Added filemgr2.o
# 
# Revision 1.17  87/10/15  22:56:34  rpd
# slot.o now depends on uinter.h
# 
# Revision 1.16  87/10/09  11:46:27  rpd
# Added soundmgr.o
# Added UINTER definition and made modules depend on it
# 
# Revision 1.15  87/06/07  02:09:26  rpd
# added shutup.o (ShutDown Manager) and scrapmgr.o (Scrap Manager)
# 
# Revision 1.14  87/05/27  01:12:10  rpd
# Removed obsolete debugs.o
# 
# Revision 1.13  87/04/02  17:50:07  rpd
# Phantom's FINAL name is /etc/toolboxdaemon
# 
# Revision 1.12  87/04/01  16:27:31  rpd
# Sigh... Now, tooldemon is called tooldaemon
# 
# Revision 1.11  87/03/31  22:22:47  rpd
# Renamed /etc/toolbox /etc/tooldemon, so there!
# 
# Revision 1.10  87/03/31  22:00:37  rpd
# Changed make install to install phantom as /etc/toolbox.
# Added dependencies for depth.c
# 
# Revision 1.9  87/03/13  01:43:34  rpd
# Fixed permissions on make install
# 
# Revision 1.8  87/03/12  17:58:36  rpd
# Added make install
# 
# Revision 1.7  87/02/19  00:48:25  rpd
# Renamed time.c to timemgr.c
# 
# Revision 1.6  87/02/19  00:46:21  rpd
# Added time.o for Time Manager stuff
# 
# Revision 1.5  87/01/31  16:28:41  rpd
# Killed 'v' option to ar.
# 
# Revision 1.4  87/01/21  18:03:15  rpd
# added maccrt0.o
# 
# Revision 1.3  87/01/21  03:51:49  rpd
# moved include of driver.h from macstuff.h to driver.c and initmac.c
# 
# Revision 1.2  87/01/19  21:25:36  rpd
# added MAIN_DIR
# added depth.c
# 
# Revision 1.1  87/01/16  00:06:13  rpd
# Initial revision
# 

# This is the makefile for the lib directory

MAIN_DIR =	..
include ../make.global

ALL =		maccrt0.o phantom shared.a
CFLAGS =	${GFLAGS}
HDRS =		macstuff.h ${INC}/low.h debug.h
UINTER =	/usr/include/sys/uinter.h

all:		${ALL}

clean:
		rm -f ${ALL}
		rm -f *.o *.ws

test:

install:
		${INSTALL} ${STRIPFLAG} -p 0755 phantom ${DESTPATH}/etc
		mv ${DESTPATH}/etc/phantom ${DESTPATH}/etc/toolboxdaemon
		${INSTALL} maccrt0.o ${DESTPATH}/usr/lib

maccrt0.o:	maccrt0.s
		as maccrt0.s
		cp maccrt0.o /usr/lib

phantom:	phantom.o zap.o depth.o
		${CC} ${CFLAGS} -o phantom phantom.o zap.o depth.o
phantom.o:	phantom.c phantom.h ${UINTER}

shared.a:	patch.o initmac.o misc.o table.o memmgr.o \
		util.o debug.o driver.o slot.o eventmgr.o \
		zap.o depth.o timemgr.o shutup.o scrapmgr.o soundmgr.o \
		fmgr_msd.o fmgr_names.o fmgr_pb.o fmgr_uf.o fmgr_util.o
		ar r $@ $?
initmac.o:	initmac.c ${HDRS} driver.h
misc.o:		misc.c ${HDRS}
timemgr.o:	timemgr.c ${HDRS}
soundmgr.o:	soundmgr.c ${HDRS}
table.o:	table.c ${HDRS}
memmgr.o:	memmgr.c ${HDRS}
filemgr.o:	filemgr.c ${HDRS}
driver.o:	driver.c driver.h phantom.h ${UINTER}
depth.o:	depth.c phantom.h ${UINTER}
slot.o:		slot.c ${HDRS} ${UINTER}
eventmgr.o:	eventmgr.c ${HDRS}
fmgr_msd.o:	fmgr_msd.c fmgr.h ${HDRS}
fmgr_names.o:	fmgr_names.c fmgr.h ${HDRS}
fmgr_pb.o:	fmgr_pb.c fmgr.h ${HDRS}
fmgr_uf.o:	fmgr_uf.c fmgr.h ${HDRS}
fmgr_util.o:	fmgr_util.c fmgr.h ${HDRS}
zap.o:		zap.s
		/lib/cpp < zap.s > zap.i
		as -o zap.o zap.i
		rm -f zap.i
patch.o:	patch.ws
		as patch.ws -o patch.o
patch.ws:	patch.w
		${MKGLUE} < patch.w > patch.ws

