[BACK]Return to Makefile.makedev CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / distrib / common

File: [cvs.NetBSD.org] / src / distrib / common / Makefile.makedev (download)

Revision 1.15.18.2, Tue Oct 30 18:48:29 2012 UTC (6 years, 11 months ago) by yamt
Branch: yamt-pagecache
CVS Tags: yamt-pagecache-tag8
Changes since 1.15.18.1: +4 -2 lines

sync with head

#	$NetBSD: Makefile.makedev,v 1.15.18.2 2012/10/30 18:48:29 yamt Exp $
#
# Makefile snippet to add ${MAKEDEVTARGETS} devices to the mtree list
# (if set), otherwise copy .OBJDIR-of-etc/MAKEDEV to ./dev
#
# If this is to be used with Makefile.image, then this file should be
# .include-d first.
#
# Required variables:
#	NETBSDSRCDIR	top level of src tree (set by <bsd.own.mk>)
#	MACHINE		machine name (set externally by build framework)
#
# Optional variables:
#	MAKEDEVTARGETS	targets to create with .OBJDIR-of-etc/MAKEDEV
#
# Variables modified by this:
#	MAKEDEVSCRIPT	path to .OBJDIR-of-etc/MAKEDEV
#	MTREECONF	may get "devices.spec" added
#	LISTS		may get "list.makedev" added
#	IMAGEDEPENDS	may get ${MAKEDEVSCRIPT} added
#	PARSELISTENV	may get MAKEDEVSCRIPT=... added
#

.if !defined(_MAKEFILE_MAKEDEV_)
_MAKEFILE_MAKEDEV_=1


MAKEDEVSPEC?=	devices.spec

_MAKEDEVOBJDIR!=cd ${NETBSDSRCDIR}/etc && ${PRINTOBJDIR}
MAKEDEVSCRIPT=	${_MAKEDEVOBJDIR}/MAKEDEV

CLEANFILES+=	${MAKEDEVSPEC} ${MAKEDEVSPEC}.tmp


.if defined(MAKEDEVTARGETS)

#
#	MAKEDEVTARGETS is set; add those devices to the mtree spec that's
#	used to build the file system
#
MTREECONF+=	${MAKEDEVSPEC}

${MAKEDEVSPEC}:	${MAKEDEVSCRIPT} Makefile \
		${NETBSDSRCDIR}/etc/etc.${MACHINE}/MAKEDEV.conf
		
	${_MKTARGET_CREATE}
	rm -f ${.TARGET} ${.TARGET}.tmp
	MACHINE=${MACHINE:Q} MACHINE_ARCH=${MACHINE_ARCH:Q} \
	    ${HOST_SH} ${MAKEDEVSCRIPT} -s ${MAKEDEVTARGETS} \
	    > ${.TARGET}.tmp
	${TOOL_SED} -e '/^\. type=dir/d' -e 's,^\.,./dev,' ${.TARGET}.tmp \
	    | sort -o ${.TARGET}

.else	# ! MAKEDEVTARGETS

#
#	MAKEDEVTARGETS isn't set; copy in /dev/MAKEDEV and rely upon
#	init(8) to mount an mfs /dev and recreate the devices by
#	(effectively) running "cd /dev ; ./MAKEDEV all"
#
LISTS+=		${DISTRIBDIR}/common/list.makedev
IMAGEDEPENDS+=	${MAKEDEVSCRIPT}
PARSELISTENV+=	MAKEDEVSCRIPT=${MAKEDEVSCRIPT:Q}

${MAKEDEVSPEC}:	.PHONY

.endif	# ! MAKEDEVTARGETS


.endif	# _MAKEFILE_MAKEDEV_