2003-05-08 17:04:13 +04:00
|
|
|
# $NetBSD: Makefile.makedev,v 1.6 2003/05/08 13:04:37 christos Exp $
|
2002-02-08 05:18:53 +03:00
|
|
|
#
|
|
|
|
# Makefile snippet to add ${MAKEDEVTARGETS} devices to the mtree list
|
|
|
|
# (if set), otherwise copy etc.${MACHINE}/MAKEDEV to ./dev
|
|
|
|
#
|
2003-03-11 02:42:45 +03:00
|
|
|
# If this is to be used with Makefile.image, then this file should be
|
|
|
|
# .include-d first.
|
2002-02-08 05:18:53 +03:00
|
|
|
#
|
|
|
|
# Required variables:
|
2002-04-26 19:50:21 +04:00
|
|
|
# NETBSDSRCDIR top level of src tree (set by <bsd.own.mk>)
|
2002-02-08 05:18:53 +03:00
|
|
|
# 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
|
|
|
|
#
|
|
|
|
|
2003-03-11 10:18:38 +03:00
|
|
|
.if !defined(_MAKEFILE_MAKEDEV_)
|
|
|
|
_MAKEFILE_MAKEDEV_=1
|
|
|
|
|
|
|
|
|
2002-02-08 05:18:53 +03:00
|
|
|
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
|
|
|
|
#
|
2002-04-26 19:50:21 +04:00
|
|
|
_MAKEDEVSCRIPT= ${NETBSDSRCDIR}/etc/etc.${MACHINE}/MAKEDEV
|
2002-02-08 05:18:53 +03:00
|
|
|
_MAKEDEVWRAP= ${DISTRIBDIR}/common/MAKEDEV.wrapper
|
|
|
|
_MAKEDEV2SPEC= ${DISTRIBDIR}/common/makedev2spec.awk
|
|
|
|
|
|
|
|
MTREECONF+= ${MAKEDEVSPEC}
|
|
|
|
|
|
|
|
${MAKEDEVSPEC}: ${_MAKEDEVSCRIPT} ${_MAKEDEVWRAP} ${_MAKEDEV2SPEC}
|
|
|
|
-rm -f ${.TARGET} ${.TARGET}.tmp
|
|
|
|
MAKEDEVSCRIPT=${_MAKEDEVSCRIPT:Q} \
|
2003-05-08 17:04:13 +04:00
|
|
|
${HOST_SH} ${_MAKEDEVWRAP} ${MAKEDEVTARGETS} | \
|
2002-02-08 05:18:53 +03:00
|
|
|
awk -f ${_MAKEDEV2SPEC} > ${.TARGET}.tmp \
|
|
|
|
&& sort -o ${.TARGET} ${.TARGET}.tmp
|
|
|
|
|
|
|
|
.else # ! MAKEDEVTARGETS
|
|
|
|
|
|
|
|
#
|
|
|
|
# MAKEDEVTARGETS isn't set; copy in /dev/MAKEDEV and rely upon
|
2002-06-01 20:22:54 +04:00
|
|
|
# init(8) to mount an mfs /dev and recreate the devices by
|
|
|
|
# (effectively) running "cd /dev ; ./MAKEDEV all"
|
2002-02-08 05:18:53 +03:00
|
|
|
#
|
|
|
|
LISTS+= ${DISTRIBDIR}/common/list.makedev
|
2002-04-26 19:50:21 +04:00
|
|
|
IMAGEDEPENDS+= ${NETBSDSRCDIR}/etc/etc.${MACHINE}/MAKEDEV
|
2002-02-08 05:18:53 +03:00
|
|
|
|
|
|
|
${MAKEDEVSPEC}: .PHONY
|
|
|
|
|
|
|
|
.endif # ! MAKEDEVTARGETS
|
2003-03-11 10:18:38 +03:00
|
|
|
|
|
|
|
|
|
|
|
.endif # _MAKEFILE_MAKEDEV_
|