version 1.5, 2003/03/11 07:18:38 |
version 1.15.18.2, 2012/10/30 18:48:29 |
|
|
# $NetBSD$ |
# $NetBSD$ |
# |
# |
# Makefile snippet to add ${MAKEDEVTARGETS} devices to the mtree list |
# Makefile snippet to add ${MAKEDEVTARGETS} devices to the mtree list |
# (if set), otherwise copy etc.${MACHINE}/MAKEDEV to ./dev |
# (if set), otherwise copy .OBJDIR-of-etc/MAKEDEV to ./dev |
# |
# |
# If this is to be used with Makefile.image, then this file should be |
# If this is to be used with Makefile.image, then this file should be |
# .include-d first. |
# .include-d first. |
|
|
# MACHINE machine name (set externally by build framework) |
# MACHINE machine name (set externally by build framework) |
# |
# |
# Optional variables: |
# Optional variables: |
# MAKEDEVTARGETS targets to create with etc/etc.${MACHINE}/MAKEDEV |
# MAKEDEVTARGETS targets to create with .OBJDIR-of-etc/MAKEDEV |
# |
# |
# Variables modified by this: |
# Variables modified by this: |
# MTREECONF may get "devices.spec" added to it |
# 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_) |
.if !defined(_MAKEFILE_MAKEDEV_) |
Line 23 _MAKEFILE_MAKEDEV_=1 |
|
Line 27 _MAKEFILE_MAKEDEV_=1 |
|
|
|
MAKEDEVSPEC?= devices.spec |
MAKEDEVSPEC?= devices.spec |
|
|
|
_MAKEDEVOBJDIR!=cd ${NETBSDSRCDIR}/etc && ${PRINTOBJDIR} |
|
MAKEDEVSCRIPT= ${_MAKEDEVOBJDIR}/MAKEDEV |
|
|
CLEANFILES+= ${MAKEDEVSPEC} ${MAKEDEVSPEC}.tmp |
CLEANFILES+= ${MAKEDEVSPEC} ${MAKEDEVSPEC}.tmp |
|
|
|
|
Line 32 CLEANFILES+= ${MAKEDEVSPEC} ${MAKEDEVSPE |
|
Line 39 CLEANFILES+= ${MAKEDEVSPEC} ${MAKEDEVSPE |
|
# MAKEDEVTARGETS is set; add those devices to the mtree spec that's |
# MAKEDEVTARGETS is set; add those devices to the mtree spec that's |
# used to build the file system |
# used to build the file system |
# |
# |
_MAKEDEVSCRIPT= ${NETBSDSRCDIR}/etc/etc.${MACHINE}/MAKEDEV |
|
_MAKEDEVWRAP= ${DISTRIBDIR}/common/MAKEDEV.wrapper |
|
_MAKEDEV2SPEC= ${DISTRIBDIR}/common/makedev2spec.awk |
|
|
|
MTREECONF+= ${MAKEDEVSPEC} |
MTREECONF+= ${MAKEDEVSPEC} |
|
|
${MAKEDEVSPEC}: ${_MAKEDEVSCRIPT} ${_MAKEDEVWRAP} ${_MAKEDEV2SPEC} |
${MAKEDEVSPEC}: ${MAKEDEVSCRIPT} Makefile \ |
-rm -f ${.TARGET} ${.TARGET}.tmp |
${NETBSDSRCDIR}/etc/etc.${MACHINE}/MAKEDEV.conf |
MAKEDEVSCRIPT=${_MAKEDEVSCRIPT:Q} \ |
|
sh ${_MAKEDEVWRAP} ${MAKEDEVTARGETS} | \ |
${_MKTARGET_CREATE} |
awk -f ${_MAKEDEV2SPEC} > ${.TARGET}.tmp \ |
rm -f ${.TARGET} ${.TARGET}.tmp |
&& sort -o ${.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 |
.else # ! MAKEDEVTARGETS |
|
|
Line 53 ${MAKEDEVSPEC}: ${_MAKEDEVSCRIPT} ${_MAK |
|
Line 60 ${MAKEDEVSPEC}: ${_MAKEDEVSCRIPT} ${_MAK |
|
# (effectively) running "cd /dev ; ./MAKEDEV all" |
# (effectively) running "cd /dev ; ./MAKEDEV all" |
# |
# |
LISTS+= ${DISTRIBDIR}/common/list.makedev |
LISTS+= ${DISTRIBDIR}/common/list.makedev |
IMAGEDEPENDS+= ${NETBSDSRCDIR}/etc/etc.${MACHINE}/MAKEDEV |
IMAGEDEPENDS+= ${MAKEDEVSCRIPT} |
|
PARSELISTENV+= MAKEDEVSCRIPT=${MAKEDEVSCRIPT:Q} |
|
|
${MAKEDEVSPEC}: .PHONY |
${MAKEDEVSPEC}: .PHONY |
|
|