[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.1, Fri Feb 8 02:18:53 2002 UTC (17 years, 8 months ago) by lukem
Branch: MAIN

- cleanup image device creation: add Makefile.makedev & list.makedev,
  remove dist/*, now that they're not needed.
  if MAKEDEVTARGETS is set, use MAKEDEV.wrapper and makedev2spec.awk to
  create an mtree specfile containing the devices that would be made with
  "etc/etc.${MACHINE}/MAKEDEV $MAKEDEVTARGETS".
  otherwise, copy etc/etc.${MACHINE}/MAKEDEV to dev/MAKEDEV (via list.makedev)
- add mtree.common; contains directories used by all images, and optional
  entries for dist/*

#	$NetBSD: Makefile.makedev,v 1.1 2002/02/08 02:18:53 lukem Exp $
#
# Makefile snippet to add ${MAKEDEVTARGETS} devices to the mtree list
# (if set), otherwise copy etc.${MACHINE}/MAKEDEV to ./dev
#

#
# Required variables:
#	_SRC_TOP_	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 etc/etc.${MACHINE}/MAKEDEV
#
# Variables modified by this:
#	MTREECONF	may get "devices.spec" added to it
#

MAKEDEVSPEC?=	devices.spec

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
#
_MAKEDEVSCRIPT=	${_SRC_TOP_}/etc/etc.${MACHINE}/MAKEDEV
_MAKEDEVWRAP=	${DISTRIBDIR}/common/MAKEDEV.wrapper
_MAKEDEV2SPEC=	${DISTRIBDIR}/common/makedev2spec.awk

MTREECONF+=	${MAKEDEVSPEC}

${MAKEDEVSPEC}:	${_MAKEDEVSCRIPT} ${_MAKEDEVWRAP} ${_MAKEDEV2SPEC}
	-rm -f ${.TARGET} ${.TARGET}.tmp
	MAKEDEVSCRIPT=${_MAKEDEVSCRIPT:Q} \
	    sh ${_MAKEDEVWRAP} ${MAKEDEVTARGETS} | \
	    awk -f ${_MAKEDEV2SPEC} > ${.TARGET}.tmp \
	&& sort -o ${.TARGET} ${.TARGET}.tmp

.else	# ! MAKEDEVTARGETS

#
#	MAKEDEVTARGETS isn't set; copy in /dev/MAKEDEV and rely upon
#	init(8) to mount an mfs /dev and recreated the devices
#
LISTS+=		${DISTRIBDIR}/common/list.makedev
IMAGEDEPENDS+=	${_SRC_TOP_}/etc/etc.${MACHINE}/MAKEDEV

${MAKEDEVSPEC}:	.PHONY

.endif	# ! MAKEDEVTARGETS