Makefile.makedev revision 1.3
1# $NetBSD: Makefile.makedev,v 1.3 2002/06/01 16:22:54 lukem Exp $ 2# 3# Makefile snippet to add ${MAKEDEVTARGETS} devices to the mtree list 4# (if set), otherwise copy etc.${MACHINE}/MAKEDEV to ./dev 5# 6 7# 8# Required variables: 9# NETBSDSRCDIR top level of src tree (set by <bsd.own.mk>) 10# MACHINE machine name (set externally by build framework) 11# 12# Optional variables: 13# MAKEDEVTARGETS targets to create with etc/etc.${MACHINE}/MAKEDEV 14# 15# Variables modified by this: 16# MTREECONF may get "devices.spec" added to it 17# 18 19MAKEDEVSPEC?= devices.spec 20 21CLEANFILES+= ${MAKEDEVSPEC} ${MAKEDEVSPEC}.tmp 22 23 24.if defined(MAKEDEVTARGETS) 25 26# 27# MAKEDEVTARGETS is set; add those devices to the mtree spec that's 28# used to build the file system 29# 30_MAKEDEVSCRIPT= ${NETBSDSRCDIR}/etc/etc.${MACHINE}/MAKEDEV 31_MAKEDEVWRAP= ${DISTRIBDIR}/common/MAKEDEV.wrapper 32_MAKEDEV2SPEC= ${DISTRIBDIR}/common/makedev2spec.awk 33 34MTREECONF+= ${MAKEDEVSPEC} 35 36${MAKEDEVSPEC}: ${_MAKEDEVSCRIPT} ${_MAKEDEVWRAP} ${_MAKEDEV2SPEC} 37 -rm -f ${.TARGET} ${.TARGET}.tmp 38 MAKEDEVSCRIPT=${_MAKEDEVSCRIPT:Q} \ 39 sh ${_MAKEDEVWRAP} ${MAKEDEVTARGETS} | \ 40 awk -f ${_MAKEDEV2SPEC} > ${.TARGET}.tmp \ 41 && sort -o ${.TARGET} ${.TARGET}.tmp 42 43.else # ! MAKEDEVTARGETS 44 45# 46# MAKEDEVTARGETS isn't set; copy in /dev/MAKEDEV and rely upon 47# init(8) to mount an mfs /dev and recreate the devices by 48# (effectively) running "cd /dev ; ./MAKEDEV all" 49# 50LISTS+= ${DISTRIBDIR}/common/list.makedev 51IMAGEDEPENDS+= ${NETBSDSRCDIR}/etc/etc.${MACHINE}/MAKEDEV 52 53${MAKEDEVSPEC}: .PHONY 54 55.endif # ! MAKEDEVTARGETS 56