#	$NecBSD: Makefile,v 1.1.2.1 2000/06/07 02:37:50 honda Exp $
#	$NetBSD: Makefile,v 1.11.2.3 1999/11/11 21:07:04 he Exp $

TOP=		${.CURDIR}/..
AUXTARGETS=
AUXDEPENDS= 	termcap.vsc
AUXCLEAN=	${AUXTARGETS}

CBIN=		ramdiskbin
MOUNT_POINT?=	/home/netdisk

LISTS=		list
CRUNCHCONF=	${CBIN}.conf
MTREE=		mtree.conf
SUBDIR=		inetd portmap cmdexec

all: specific-bin ${AUXTARGETS} ${CBIN} ${AUXDEPENDS} ${MTREE} ${LISTS}
	mtree -def ${.CURDIR}/${MTREE} -p ${MOUNT_POINT}/ -u
	TOPDIR=${TOP} CURDIR=${.CURDIR} OBJDIR=${.OBJDIR} \
	    TARGDIR=${MOUNT_POINT} sh ${TOP}/runlist.sh ${.CURDIR}/${LISTS}
	@echo ""
	@du -sk ${MOUNT_POINT}
	@echo ""

${CBIN}.mk ${CBIN}.cache ${CBIN}.c: ${CRUNCHCONF}
	crunchgen -D ${TOP}/../../.. -L ${DESTDIR}/usr/lib ${.ALLSRC}

${CBIN}: ${CBIN}.mk ${CBIN}.cache ${CBIN}.c
	make -f ${CBIN}.mk all

specific-bin:
	(cd cmdexec; make -f Makefile)
	(cd portmap; make -f Makefile)
	(cd inetd; make -f Makefile)
	(cd ../../../../usr.bin/top; make -f Makefile)
	(cd ../../../../usr.sbin/bind; make -f Makefile)
	(cd ../../../../usr.sbin/dhcp; make -f Makefile)


release:

clean cleandir distclean:
	/bin/rm -f ${AUXCLEAN} *.core ${IMAGE} ${CBIN} ${CBIN}.mk ${CBIN}.cache *.o *.lo *.c

.include <bsd.own.mk>
.include <bsd.obj.mk>
.include <bsd.subdir.mk>
.include <bsd.sys.mk>
