[BACK]Return to Makefile.makedev CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / src / distrib / common

Annotation of src/distrib/common/Makefile.makedev, Revision 1.18.2.1

1.18.2.1! tls         1: #      $NetBSD$
1.1       lukem       2: #
                      3: # Makefile snippet to add ${MAKEDEVTARGETS} devices to the mtree list
1.14      tsutsui     4: # (if set), otherwise copy .OBJDIR-of-etc/MAKEDEV to ./dev
1.4       lukem       5: #
                      6: # If this is to be used with Makefile.image, then this file should be
                      7: # .include-d first.
1.1       lukem       8: #
                      9: # Required variables:
1.2       lukem      10: #      NETBSDSRCDIR    top level of src tree (set by <bsd.own.mk>)
1.1       lukem      11: #      MACHINE         machine name (set externally by build framework)
                     12: #
                     13: # Optional variables:
1.7       lukem      14: #      MAKEDEVTARGETS  targets to create with .OBJDIR-of-etc/MAKEDEV
1.1       lukem      15: #
                     16: # Variables modified by this:
1.7       lukem      17: #      MAKEDEVSCRIPT   path to .OBJDIR-of-etc/MAKEDEV
                     18: #      MTREECONF       may get "devices.spec" added
                     19: #      LISTS           may get "list.makedev" added
1.13      apb        20: #      IMAGEDEPENDS    may get ${MAKEDEVSCRIPT} added
                     21: #      PARSELISTENV    may get MAKEDEVSCRIPT=... added
1.1       lukem      22: #
                     23:
1.5       lukem      24: .if !defined(_MAKEFILE_MAKEDEV_)
                     25: _MAKEFILE_MAKEDEV_=1
                     26:
                     27:
1.1       lukem      28: MAKEDEVSPEC?=  devices.spec
                     29:
1.7       lukem      30: _MAKEDEVOBJDIR!=cd ${NETBSDSRCDIR}/etc && ${PRINTOBJDIR}
                     31: MAKEDEVSCRIPT= ${_MAKEDEVOBJDIR}/MAKEDEV
                     32:
1.1       lukem      33: CLEANFILES+=   ${MAKEDEVSPEC} ${MAKEDEVSPEC}.tmp
                     34:
                     35:
                     36: .if defined(MAKEDEVTARGETS)
                     37:
                     38: #
                     39: #      MAKEDEVTARGETS is set; add those devices to the mtree spec that's
                     40: #      used to build the file system
                     41: #
                     42: MTREECONF+=    ${MAKEDEVSPEC}
                     43:
1.18.2.1! tls        44: .if exists(${NETBSDSRCDIR}/etc/etc.${MACHINE_CPU}/MAKEDEV.conf)
        !            45: MAKEDEV_MACHINE=${MACHINE_CPU}
        !            46: .else
        !            47: MAKEDEV_MACHINE=${MACHINE}
        !            48: .endif
        !            49:
1.18      matt       50: ${MAKEDEVSPEC}:        ${MAKEDEVSCRIPT} Makefile \
1.18.2.1! tls        51:                ${NETBSDSRCDIR}/etc/etc.${MAKEDEV_MACHINE}/MAKEDEV.conf
1.18      matt       52:
1.10      lukem      53:        ${_MKTARGET_CREATE}
1.16      njoly      54:        rm -f ${.TARGET} ${.TARGET}.tmp
1.18.2.1! tls        55:        MACHINE=${MAKEDEV_MACHINE:Q} MACHINE_ARCH=${MACHINE_ARCH:Q} \
1.9       lukem      56:            ${HOST_SH} ${MAKEDEVSCRIPT} -s ${MAKEDEVTARGETS} \
1.16      njoly      57:            > ${.TARGET}.tmp
                     58:        ${TOOL_SED} -e '/^\. type=dir/d' -e 's,^\.,./dev,' ${.TARGET}.tmp \
                     59:            | sort -o ${.TARGET}
1.1       lukem      60:
                     61: .else  # ! MAKEDEVTARGETS
                     62:
                     63: #
                     64: #      MAKEDEVTARGETS isn't set; copy in /dev/MAKEDEV and rely upon
1.3       lukem      65: #      init(8) to mount an mfs /dev and recreate the devices by
                     66: #      (effectively) running "cd /dev ; ./MAKEDEV all"
1.1       lukem      67: #
                     68: LISTS+=                ${DISTRIBDIR}/common/list.makedev
1.13      apb        69: IMAGEDEPENDS+= ${MAKEDEVSCRIPT}
1.7       lukem      70: PARSELISTENV+= MAKEDEVSCRIPT=${MAKEDEVSCRIPT:Q}
1.1       lukem      71:
                     72: ${MAKEDEVSPEC}:        .PHONY
                     73:
                     74: .endif # ! MAKEDEVTARGETS
1.5       lukem      75:
                     76:
                     77: .endif # _MAKEFILE_MAKEDEV_

CVSweb <webmaster@jp.NetBSD.org>