#	Makefile	4.21	86/06/07
#
DESTDIR=
CFLAGS=	-O -20

# Programs that live in subdirectories, and have makefiles of their own.
#
SUBDIR=	kermit mh rcs umodem make
#
# Standard programs without special makefiles
#
STD= patch 4to8k
#
# Default programs that are installed
#
STDINST= kermit mh rcs umodem
#
# Special purpose software that requires custom installation,
# or may not be needed by all sites
#
OPTDIR=	news rn

all:	${SUBDIR} ${STD}

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

${SUBDIR}: FRC
	cd $@; make ${MFLAGS}
	@echo "------------------------------"

${OPTDIR}: FRC
	cd $@; make ${MFLAGS} all

install: install-dist

install-dist: ${STD}
	-for i in ${STD}; do \
		(install -s $$i ${DESTDIR}/usr/new/$$i); done
	-for i in ${STDINST}; do \
		(cd $$i; make ${MFLAGS} DESTDIR=${DESTDIR} install); done
	install -c Vsh ${DESTDIR}/usr/new/Vsh

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

clean:
	-for i in ${SUBDIR}; do (echo $$i; cd $$i; make ${MFLAGS} clean); done
	-for i in ${OPTDIR}; do (echo $$i; cd $$i; make ${MFLAGS} clean); done
	-rm -rf *.o ${STD} rslts*

FRC:
