[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.12

1.12    ! apb         1: #      $NetBSD: Makefile.makedev,v 1.11 2004/05/04 03:02:17 lukem Exp $
1.1       lukem       2: #
                      3: # Makefile snippet to add ${MAKEDEVTARGETS} devices to the mtree list
1.7       lukem       4: # (if set), otherwise copy .OJBDIR-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
1.12    ! apb        18: #      MAKEDEVSUBR     path to .OBJDIR-of-etc/MAKEDEV.subr
1.7       lukem      19: #      MTREECONF       may get "devices.spec" added
                     20: #      LISTS           may get "list.makedev" added
1.12    ! apb        21: #      IMAGEDEPENDS    may get ${MAKEDEVSCRIPT} and ${MAKEDEVSUBR} added
        !            22: #      PARSELISTENV    may get MAKEDEVSCRIPT=... and MAKEDEVSUBR=... added
1.1       lukem      23: #
                     24:
1.5       lukem      25: .if !defined(_MAKEFILE_MAKEDEV_)
                     26: _MAKEFILE_MAKEDEV_=1
                     27:
                     28:
1.1       lukem      29: MAKEDEVSPEC?=  devices.spec
                     30:
1.7       lukem      31: _MAKEDEVOBJDIR!=cd ${NETBSDSRCDIR}/etc && ${PRINTOBJDIR}
                     32: MAKEDEVSCRIPT= ${_MAKEDEVOBJDIR}/MAKEDEV
1.12    ! apb        33: MAKEDEVSUBR=   ${_MAKEDEVOBJDIR}/MAKEDEV.subr
1.7       lukem      34:
1.1       lukem      35: CLEANFILES+=   ${MAKEDEVSPEC} ${MAKEDEVSPEC}.tmp
                     36:
                     37:
                     38: .if defined(MAKEDEVTARGETS)
                     39:
                     40: #
                     41: #      MAKEDEVTARGETS is set; add those devices to the mtree spec that's
                     42: #      used to build the file system
                     43: #
                     44: MTREECONF+=    ${MAKEDEVSPEC}
                     45:
1.12    ! apb        46: ${MAKEDEVSPEC}:        ${MAKEDEVSCRIPT} ${MAKEDEVSUBR}
1.10      lukem      47:        ${_MKTARGET_CREATE}
1.1       lukem      48:        -rm -f ${.TARGET} ${.TARGET}.tmp
1.8       lukem      49:        MACHINE=${MACHINE:Q} MACHINE_ARCH=${MACHINE_ARCH:Q} \
1.9       lukem      50:            ${HOST_SH} ${MAKEDEVSCRIPT} -s ${MAKEDEVTARGETS} \
1.11      lukem      51:            | sed -e '/^\. type=dir/d' -e 's,^\.,./dev,' > ${.TARGET}.tmp \
1.1       lukem      52:        && sort -o ${.TARGET} ${.TARGET}.tmp
                     53:
                     54: .else  # ! MAKEDEVTARGETS
                     55:
                     56: #
                     57: #      MAKEDEVTARGETS isn't set; copy in /dev/MAKEDEV and rely upon
1.3       lukem      58: #      init(8) to mount an mfs /dev and recreate the devices by
                     59: #      (effectively) running "cd /dev ; ./MAKEDEV all"
1.1       lukem      60: #
                     61: LISTS+=                ${DISTRIBDIR}/common/list.makedev
1.12    ! apb        62: IMAGEDEPENDS+= ${MAKEDEVSCRIPT} ${MAKEDEVSUBR}
1.7       lukem      63: PARSELISTENV+= MAKEDEVSCRIPT=${MAKEDEVSCRIPT:Q}
1.12    ! apb        64: PARSELISTENV+= MAKEDEVSUBR=${MAKEDEVSUBR:Q}
1.1       lukem      65:
                     66: ${MAKEDEVSPEC}:        .PHONY
                     67:
                     68: .endif # ! MAKEDEVTARGETS
1.5       lukem      69:
                     70:
                     71: .endif # _MAKEFILE_MAKEDEV_

CVSweb <webmaster@jp.NetBSD.org>