2004-01-01 17:34:24 +03:00
|
|
|
# $NetBSD: Makefile.makedev,v 1.9 2004/01/01 14:34:24 lukem Exp $
|
2002-02-08 05:18:53 +03:00
|
|
|
#
|
|
|
|
# Makefile snippet to add ${MAKEDEVTARGETS} devices to the mtree list
|
2003-10-25 08:29:24 +04:00
|
|
|
# (if set), otherwise copy .OJBDIR-of-etc/MAKEDEV to ./dev
|
2002-02-08 05:18:53 +03:00
|
|
|
#
|
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:
|
2003-10-25 08:29:24 +04:00
|
|
|
# MAKEDEVTARGETS targets to create with .OBJDIR-of-etc/MAKEDEV
|
2002-02-08 05:18:53 +03:00
|
|
|
#
|
|
|
|
# Variables modified by this:
|
2003-10-25 08:29:24 +04:00
|
|
|
# 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
|
2002-02-08 05:18:53 +03:00
|
|
|
#
|
|
|
|
|
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
|
|
|
|
|
2003-10-25 08:29:24 +04:00
|
|
|
_MAKEDEVOBJDIR!=cd ${NETBSDSRCDIR}/etc && ${PRINTOBJDIR}
|
|
|
|
MAKEDEVSCRIPT= ${_MAKEDEVOBJDIR}/MAKEDEV
|
|
|
|
|
2002-02-08 05:18:53 +03:00
|
|
|
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}
|
|
|
|
|
2003-12-21 20:37:26 +03:00
|
|
|
${MAKEDEVSPEC}: ${MAKEDEVSCRIPT}
|
2002-02-08 05:18:53 +03:00
|
|
|
-rm -f ${.TARGET} ${.TARGET}.tmp
|
2003-12-21 20:37:26 +03:00
|
|
|
MACHINE=${MACHINE:Q} MACHINE_ARCH=${MACHINE_ARCH:Q} \
|
2004-01-01 17:34:24 +03:00
|
|
|
${HOST_SH} ${MAKEDEVSCRIPT} -s ${MAKEDEVTARGETS} \
|
|
|
|
| sed -e 's,^\.,./dev,' > ${.TARGET}.tmp \
|
2002-02-08 05:18:53 +03:00
|
|
|
&& 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
|
2003-10-25 08:29:24 +04:00
|
|
|
IMAGEDEPENDS+= ${MAKEDEVSCRIPT}
|
|
|
|
PARSELISTENV+= MAKEDEVSCRIPT=${MAKEDEVSCRIPT:Q}
|
2002-02-08 05:18:53 +03:00
|
|
|
|
|
|
|
${MAKEDEVSPEC}: .PHONY
|
|
|
|
|
|
|
|
.endif # ! MAKEDEVTARGETS
|
2003-03-11 10:18:38 +03:00
|
|
|
|
|
|
|
|
|
|
|
.endif # _MAKEFILE_MAKEDEV_
|