#
# Copyright 1987 Apple Computer, Inc.
# $Header: makefile,v 1.24 87/11/10 00:22:18 rpd Exp $
#
# $Log:	makefile,v $
# Revision 1.24  87/11/10  00:22:18  rpd
# Added catch program
# 
# Revision 1.23  87/10/16  15:38:56  rpd
# Removed mkslot
# Changed *.res to %*
# 
# Revision 1.22  87/09/03  20:40:55  rpd
# Added term_utmp.c to make install
# Removed -DADM5 from term cc commands
# 
# Revision 1.21  87/08/24  15:10:16  rootcsh
# Added term_utmp.o
# 
# Revision 1.20  87/07/19  19:27:33  rpd
# Changed UNIX to A/UX
# Moved rez rule to make.global
# 
# Revision 1.19  87/07/03  03:19:29  rpd
# Added term_tile.c and term_save.c
# 
# Revision 1.18  87/06/18  01:01:30  rpd
# Added term_tty.h to the stuff that gets installed as term source
# 
# Revision 1.17  87/06/17  23:01:31  rpd
# Killed the te program.
# Added stuff to use rez to produce resource files.
# 
# Revision 1.16  87/06/13  14:32:43  rpd
# Now, install sample.r and term.r in the example application stuff
# We use to install sample.res and term.res, but now rez can build these
# 
# Revision 1.15  87/06/13  00:50:56  rpd
# Removed launch, he now has his own directory
# 
# Revision 1.14  87/06/11  01:41:05  rpd
# Took fkey out of list of things to install
# Added term source to list of things to install
# 
# Revision 1.13  87/05/22  13:37:12  rpd
# Moved example software into /usr/lib/mac/examples
# 
# Revision 1.12  87/04/30  08:39:23  rpd
# Added fkey
# 
# Revision 1.11  87/04/02  17:45:04  rpd
# Changed /usr/local/bin to /usr/toolboxbin
# Added copy of sample.res to /usr/lib/mac to go with sample.c
# 
# Revision 1.10  87/03/31  21:45:23  rpd
# Changed make install to put executables in /usr/local/bin
# 
# Revision 1.9  87/03/13  14:30:06  rpd
# Fixed settc entry -- it doesn't use the toolbox
# 
# Revision 1.8  87/03/13  01:33:35  rpd
# Fixed permissions in make install
# 
# Revision 1.7  87/03/12  21:25:35  rpd
# Added settc to list of files to install
# 
# Revision 1.6  87/03/12  21:24:20  rpd
# Added settc
# 
# Revision 1.5  87/03/12  17:47:11  rpd
# Changed terminal emulated by term to ADM5 from ADM3A
# Added make install
# 
# Revision 1.4  87/01/26  02:22:03  rpd
# Removed unnecessary "-ltermcap" from term build
# 
# Revision 1.3  87/01/22  04:19:24  rpd
# added launch
# 
# Revision 1.2  87/01/19  21:08:55  rpd
# added MAIN_DIR
# added mkslot
# 
# Revision 1.1  87/01/15  23:43:49  rpd
# Initial revision
# 

# This is the makefile for the misc directory

MAIN_DIR =	..
include ../make.global

TEST =		qdsamp sample frank term list
NTEST =		settc fkey rcnvt catch %sample %frank %term %list %fkey %catch
ALL =		${TEST} ${NTEST}
CFLAGS =	${GFLAGS} -DAUX

all:		${ALL}

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

test:
		for i in ${TEST}; do \
		    echo $$i; \
		    $$i; \
		done

install:
		${INSTALL} ${STRIPFLAG} -p 0755 qdsamp sample term settc rcnvt \
			${DESTPATH}/usr/toolboxbin
		${INSTALL} %sample %term \
			${DESTPATH}/usr/toolboxbin
		${INSTALL} sample.r sample.c qdsamp.c \
			${DESTPATH}/usr/lib/mac/examples
		${INSTALL} term.r term.c term.h term_tty.c term_tty.h \
			term_out.c term_em.c term_tile.c term_save.c \
			term_utmp.c \
			${DESTPATH}/usr/lib/mac/examples/term

fkey:		fkey.o ${LIB}
		${LD} -o fkey fkey.o ${LDFLAGS}
%fkey:		fkey.r
		${REZ} fkey.r
		mv %Rez.out %fkey
		rm -f Rez.out

qdsamp:		qdsamp.o ${LIB}
		${LD} -o qdsamp qdsamp.o ${LDFLAGS}

sample:		sample.o ${LIB}
		${LD} -o sample sample.o ${LDFLAGS}
%sample:	sample.r
		${REZ} sample.r
		mv %Rez.out %sample
		rm -f Rez.out

frank:		frank.o menuact.o ${LIB}
		${LD} -o frank frank.o menuact.o ${LDFLAGS}
%frank:		frank.r
		${REZ} frank.r
		mv %Rez.out %frank
		rm -f Rez.out

frank.o:	frank.c frank.h
menuact.o:	menuact.c menuact.h

TERM_OBJS =	term.o term_tty.o term_out.o term_em.o term_tile.o term_save.o\
		term_utmp.o
term:		${TERM_OBJS} ${LIB}
		${LD} -o term ${TERM_OBJS} ${LDFLAGS}
%term:		term.r
		${REZ} term.r
		mv %Rez.out %term
		rm -f Rez.out

term.o:		term.c term.h term_tty.h
term_out.o:	term_out.c term.h term_tty.h
term_em.o:	term_em.c term.h term_tty.h
term_tile.o:	term_tile.c term.h term_tty.h
term_save.o:	term_save.c term.h term_tty.h
term_tty.o:	term_tty.c term_tty.h

list:		list.o ${LIB}
		${LD} -o list list.o ${LDFLAGS}
%list:		list.r
		${REZ} list.r
		mv %Rez.out %list
		rm -f Rez.out


settc:		settc.o ${LIB}
		${LD} -o settc settc.o ${LDFLAGS}

rcnvt:		rcnvt.o
		${CC} ${CFLAGS} -o rcnvt rcnvt.o

catch:		catch.o ${LIB}
		${LD} -o catch catch.o ${LDFLAGS}
%catch:		catch.r
		${REZ} catch.r
		mv %Rez.out %catch
		rm -f Rez.out

