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

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

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

# 4.2 binaries of utilities that don't work between 4.3 and 4.2
#
4_2= ls diff cp rm mv diff3 sh csh pwd

all:	${STD} ${SUBDIR}

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

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

install: install-dist

install-dist: ${STD}
	-mkdir ${DESTDIR}/usr/old
	-for i in ${STD}; do (install -s $$i ${DESTDIR}/usr/old/$$i); done
	-for i in ${SUBDIR}; do \
 		(cd $$i; make ${MFLAGS} DESTDIR=${DESTDIR} install); done
	-for i in ${4_2}; do (install -c -m 777 $$i ${DESTDIR}/usr/old/$$i); done

clean:
	-rm -f ${STD}
	-for i in ${SUBDIR}; do (echo $$i; cd $$i; make ${MFLAGS} clean); done

FRC:
