#	Makefile	4.49	83/09/27
#
DESTDIR=
CFLAGS=	-O
FFLAGS=	-O
PFLAGS=	-O

# Programs that live in subdirectories, and have makefiles of their own.
#
SUBDIR=	

# C programs that live in the current directory and do not need
# explicit make lines.
#
STD=	

# C programs in the current directory that use libvt only.
CVT=	boxes casey clkvt commander hilbert recvt spiral stringart
# C programs in the current directory that use libvt and libbm.
CBM=	clkbm erode moveb recbm
# C programs in the current directory that use libvt and libtools.
CTOOLS=	button cursor ebar1d ebar2d gauge menu
# C programs in the current directory that use libvt and libgip.
CGIP=	grid

# FORTRAN programs in the current directory that use libvt only.
FVT=	clkvtf recvtf
# FORTRAN programs in the current directory that use libvt and libbm.
FBM=	clkbmf recbmf
# FORTRAN programs in the current directory that use libvt and libtools.
FTOOLS=	buttonf cursorf ebar1df ebar2df gaugef menuf

# Pascal programs in the current directory that use libvt only.
PVT=	clkvtp recvtp
# Pascal programs in the current directory that use libvt and libbm.
PBM=	clkbmp recbmp
# Pascal programs in the current directory that use libvt and libtools.
PTOOLS=	buttonp cursorp ebar1dp ebar2dp gaugep menup

# Programs that live in the current directory and need explicit make lines.
#
NSTD=	${CVT} ${CBM} ${CTOOLS} ${CGIP} \
	${FVT} ${FBM} ${FTOOLS} \
	${PVT} ${PBM} ${PTOOLS}

all:	${SUBDIR} ${STD} ${NSTD}

# For convenience in makeing subsets of the programs
C:		${CVT} ${CBM} ${CTOOLS} ${CGIP}
FORTRAN:	${FVT} ${FBM} ${FTOOLS}
Pascal:		${PVT} ${PBM} ${PTOOLS}
vt:		${CVT} ${FVT} ${PVT}
bm:		${CBM} ${FBM} ${PBM}
tools:		${CTOOLS} ${FTOOLS} ${PTOOLS}
gip:		${CGIP}

#${SUBDIR}: FRC
#	cd $@; make ${MFLAGS}

#${STD}:
#	cc ${CFLAGS} -o $@ $@.c

install:
#	for i in ${SUBDIR}; do \
#		(cd $$i; make ${MFLAGS} DESTDIR=${DESTDIR} install); done
	for i in ${STD} ${NSTD}; do \
		(install -s $$i ${DESTDIR}/usr/isi/$$i); \
	done

clean:
	rm -f a.out core *.s *.o
#	for i in ${SUBDIR}; do (cd $$i; make ${MFLAGS} clean); done
	rm -f ${STD} ${NSTD}

FRC:

depend:
	cat </dev/null >x.c
	for i in ${STD} ${CVT} ${CBM} ${CTOOLS} ${CGIP}; do \
		(echo $$i: $$i.c >>makedep; \
		/bin/grep '^#[ 	]*include' x.c $$i.c | sed \
			-e 's,<\(.*\)>,"${DESTDIR}/usr/include/\1",' \
			-e 's/:[^"]*"\([^"]*\)".*/: \1/' \
			-e 's/\.c//' >>makedep); done
	for i in ${FVT} ${FBM} ${FTOOLS}; do \
		(echo $$i: $$i.f >>makedep); done
	for i in ${PVT} ${PBM} ${PTOOLS}; do \
		(echo $$i: $$i.p >>makedep; \
		/bin/grep '^#[ 	]*include' x.c $$i.p | sed \
			-e 's,<\(.*\)>,"${DESTDIR}/usr/include/\1",' \
			-e 's/:[^"]*"\([^"]*\)".*/: \1/' \
			-e 's/\.p//' >>makedep); done
	echo '/^# DO NOT DELETE THIS LINE/+2,$$d' >eddep
	echo '$$r makedep' >>eddep
	echo 'w' >>eddep
	cp Makefile Makefile.bak
	ed - Makefile < eddep
	rm eddep makedep x.c
	echo '# DEPENDENCIES MUST END AT END OF FILE' >> Makefile
	echo '# IF YOU PUT STUFF HERE IT WILL GO AWAY' >> Makefile
	echo '# see make depend above' >> Makefile

# Files listed in ${NSTD} have explicit make lines given below.

${CVT}:
	cc ${CFLAGS} -o $@ $@.c -lvt

${CBM}:
	cc ${CFLAGS} -o $@ $@.c -lbm -lvt

${CTOOLS}:
	cc ${CFLAGS} -o $@ $@.c -ltools -lbm -lvt

${CGIP}:
	cc ${CFLAGS} -o $@ $@.c -lgip -lvt

${FVT}:
	f77 ${FFLAGS} -o $@ $@.f -lvtf

${FBM}:
	f77 ${FFLAGS} -o $@ $@.f -lbmf -lvtf

${FTOOLS}:
	f77 ${FFLAGS} -o $@ $@.f -ltoolsf -lbmf -lvtf

${PVT}:
	pc ${PFLAGS} -o $@ $@.p -lvtp

${PBM}:
	pc ${PFLAGS} -o $@ $@.p -lbmp -lvtp

${PTOOLS}:
	pc ${PFLAGS} -o $@ $@.p -ltoolsp -lbmp -lvtp

# DO NOT DELETE THIS LINE -- make depend uses it

boxes: boxes.c
boxes: /usr/include/vt.h
boxes: /usr/include/signal.h
boxes: sin.h
casey: casey.c
casey: /usr/include/vt.h
casey: /usr/include/signal.h
clkvt: clkvt.c
clkvt: /usr/include/vt.h
clkvt: /usr/include/sys/time.h
clkvt: /usr/include/signal.h
commander: commander.c
commander: /usr/include/vt.h
commander: /usr/include/signal.h
commander: sin.h
hilbert: hilbert.c
hilbert: /usr/include/vt.h
hilbert: /usr/include/signal.h
hilbert: sin.h
recvt: recvt.c
recvt: /usr/include/vt.h
spiral: spiral.c
spiral: /usr/include/vt.h
spiral: /usr/include/signal.h
spiral: sin.h
stringart: stringart.c
stringart: /usr/include/stdio.h
stringart: /usr/include/signal.h
stringart: /usr/include/vt.h
clkbm: clkbm.c
clkbm: /usr/include/vt.h
clkbm: /usr/include/bitmap.h
clkbm: /usr/include/sys/time.h
clkbm: /usr/include/signal.h
erode: erode.c
erode: /usr/include/stdio.h
erode: /usr/include/signal.h
erode: /usr/include/vt.h
erode: /usr/include/bitmap.h
moveb: moveb.c
moveb: /usr/include/vt.h
moveb: /usr/include/stdio.h
moveb: /usr/include/signal.h
moveb: /usr/include/tools.h
moveb: /usr/include/bitmap.h
recbm: recbm.c
recbm: /usr/include/vt.h
recbm: /usr/include/bitmap.h
button: button.c
button: /usr/include/vt.h
button: /usr/include/tools.h
cursor: cursor.c
cursor: /usr/include/vt.h
cursor: /usr/include/bitmap.h
cursor: /usr/include/tools.h
cursor: /usr/include/signal.h
ebar1d: ebar1d.c
ebar1d: /usr/include/vt.h
ebar1d: /usr/include/tools.h
ebar2d: ebar2d.c
ebar2d: /usr/include/vt.h
ebar2d: /usr/include/tools.h
gauge: gauge.c
gauge: /usr/include/vt.h
gauge: /usr/include/tools.h
menu: menu.c
menu: /usr/include/vt.h
menu: /usr/include/tools.h
grid: grid.c
grid: /usr/include/vt.h
grid: /usr/include/stdio.h
grid: /usr/include/gip.h
clkvtf: clkvtf.f
recvtf: recvtf.f
clkbmf: clkbmf.f
recbmf: recbmf.f
buttonf: buttonf.f
cursorf: cursorf.f
ebar1df: ebar1df.f
ebar2df: ebar2df.f
gaugef: gaugef.f
menuf: menuf.f
clkvtp: clkvtp.p
clkvtp: /usr/include/pascal/gconst.h
clkvtp: /usr/include/pascal/gtype.h
clkvtp: /usr/include/pascal/gproc.h
clkvtp: unixprocs.h
recvtp: recvtp.p
recvtp: /usr/include/pascal/gconst.h
recvtp: /usr/include/pascal/gtype.h
recvtp: /usr/include/pascal/gproc.h
clkbmp: clkbmp.p
clkbmp: /usr/include/pascal/gconst.h
clkbmp: /usr/include/pascal/gtype.h
clkbmp: /usr/include/pascal/gproc.h
clkbmp: unixprocs.h
recbmp: recbmp.p
recbmp: /usr/include/pascal/gconst.h
recbmp: /usr/include/pascal/gtype.h
recbmp: /usr/include/pascal/gproc.h
buttonp: buttonp.p
buttonp: /usr/include/pascal/vtpconst.h
buttonp: /usr/include/pascal/bmpconst.h
buttonp: /usr/include/pascal/toolspconst.h
buttonp: /usr/include/pascal/vtptype.h
buttonp: /usr/include/pascal/bmptype.h
buttonp: /usr/include/pascal/toolsptype.h
buttonp: /usr/include/pascal/vtpproc.h
buttonp: /usr/include/pascal/bmpproc.h
buttonp: /usr/include/pascal/toolspproc.h
cursorp: cursorp.p
cursorp: /usr/include/pascal/gconst.h
cursorp: /usr/include/pascal/gtype.h
cursorp: /usr/include/pascal/gproc.h
ebar1dp: ebar1dp.p
ebar1dp: /usr/include/pascal/gconst.h
ebar1dp: /usr/include/pascal/gtype.h
ebar1dp: /usr/include/pascal/gproc.h
ebar2dp: ebar2dp.p
ebar2dp: /usr/include/pascal/gconst.h
ebar2dp: /usr/include/pascal/gtype.h
ebar2dp: /usr/include/pascal/gproc.h
gaugep: gaugep.p
gaugep: /usr/include/pascal/gconst.h
gaugep: /usr/include/pascal/gtype.h
gaugep: /usr/include/pascal/gproc.h
menup: menup.p
menup: /usr/include/pascal/gconst.h
menup: /usr/include/pascal/gtype.h
menup: /usr/include/pascal/gproc.h
# DEPENDENCIES MUST END AT END OF FILE
# IF YOU PUT STUFF HERE IT WILL GO AWAY
# see make depend above
