Annotation of src/distrib/common/Makefile.makedev, Revision 1.2.2.1
1.2.2.1 ! tv 1: # $NetBSD$
1.1 lukem 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:
1.2 lukem 9: # NETBSDSRCDIR top level of src tree (set by <bsd.own.mk>)
1.1 lukem 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:
19: MAKEDEVSPEC?= devices.spec
20:
21: CLEANFILES+= ${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: #
1.2 lukem 30: _MAKEDEVSCRIPT= ${NETBSDSRCDIR}/etc/etc.${MACHINE}/MAKEDEV
1.1 lukem 31: _MAKEDEVWRAP= ${DISTRIBDIR}/common/MAKEDEV.wrapper
32: _MAKEDEV2SPEC= ${DISTRIBDIR}/common/makedev2spec.awk
33:
34: MTREECONF+= ${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
1.2.2.1 ! tv 47: # init(8) to mount an mfs /dev and recreate the devices by
! 48: # (effectively) running "cd /dev ; ./MAKEDEV all"
1.1 lukem 49: #
50: LISTS+= ${DISTRIBDIR}/common/list.makedev
1.2 lukem 51: IMAGEDEPENDS+= ${NETBSDSRCDIR}/etc/etc.${MACHINE}/MAKEDEV
1.1 lukem 52:
53: ${MAKEDEVSPEC}: .PHONY
54:
55: .endif # ! MAKEDEVTARGETS
CVSweb <webmaster@jp.NetBSD.org>