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