minix/distrib/common/Makefile.makedev
Lionel Sambuc 9152e1c5a7 Upgrading build system to new NetBSD revision
The tested targets are the followgin ones:
 * tools
 * distribution
 * sets
 * release

The remaining NetBSD targets have not been disabled nor tested
*at all*. Try them at your own risk, they may reboot the earth.

For all compliant Makefiles, objects and generated files are put in
MAKEOBJDIR, which means you can now keep objects between two branch
switching. Same for DESTDIR, please refer to build.sh options.

Regarding new or modifications of Makefiles a few things:
 * Read share/mk/bsd.README
 * If you add a subdirectory, add a Makefile in it, and have it called
   by the parent through the SUBDIR variable.
 * Do not add arbitrary inclusion which crosses to another branch of
   the hierarchy; If you can't do without it, put a comment on why.
   If possible, do not use inclusion at all.
 * Use as much as possible the infrastructure, it is here to make
   life easier, do not fight it.

Sets and package are now used to track files.
We have one set called "minix", composed of one package called "minix-sys"
2012-11-15 16:07:29 +01:00

71 lines
1.9 KiB
Text

# $NetBSD: Makefile.makedev,v 1.18 2012/08/10 05:22:22 matt Exp $
#
# Makefile snippet to add ${MAKEDEVTARGETS} devices to the mtree list
# (if set), otherwise copy .OBJDIR-of-etc/MAKEDEV to ./dev
#
# If this is to be used with Makefile.image, then this file should be
# .include-d first.
#
# Required variables:
# NETBSDSRCDIR top level of src tree (set by <bsd.own.mk>)
# MACHINE machine name (set externally by build framework)
#
# Optional variables:
# MAKEDEVTARGETS targets to create with .OBJDIR-of-etc/MAKEDEV
#
# Variables modified by this:
# MAKEDEVSCRIPT path to .OBJDIR-of-etc/MAKEDEV
# MTREECONF may get "devices.spec" added
# LISTS may get "list.makedev" added
# IMAGEDEPENDS may get ${MAKEDEVSCRIPT} added
# PARSELISTENV may get MAKEDEVSCRIPT=... added
#
.if !defined(_MAKEFILE_MAKEDEV_)
_MAKEFILE_MAKEDEV_=1
MAKEDEVSPEC?= devices.spec
_MAKEDEVOBJDIR!=cd ${NETBSDSRCDIR}/etc && ${PRINTOBJDIR}
MAKEDEVSCRIPT= ${_MAKEDEVOBJDIR}/MAKEDEV
CLEANFILES+= ${MAKEDEVSPEC} ${MAKEDEVSPEC}.tmp
.if defined(MAKEDEVTARGETS)
#
# MAKEDEVTARGETS is set; add those devices to the mtree spec that's
# used to build the file system
#
MTREECONF+= ${MAKEDEVSPEC}
${MAKEDEVSPEC}: ${MAKEDEVSCRIPT} Makefile \
${NETBSDSRCDIR}/etc/etc.${MACHINE}/MAKEDEV.conf
${_MKTARGET_CREATE}
rm -f ${.TARGET} ${.TARGET}.tmp
MACHINE=${MACHINE:Q} MACHINE_ARCH=${MACHINE_ARCH:Q} \
${HOST_SH} ${MAKEDEVSCRIPT} -s ${MAKEDEVTARGETS} \
> ${.TARGET}.tmp
${TOOL_SED} -e '/^\. type=dir/d' -e 's,^\.,./dev,' ${.TARGET}.tmp \
| sort -o ${.TARGET}
.else # ! MAKEDEVTARGETS
#
# MAKEDEVTARGETS isn't set; copy in /dev/MAKEDEV and rely upon
# init(8) to mount an mfs /dev and recreate the devices by
# (effectively) running "cd /dev ; ./MAKEDEV all"
#
LISTS+= ${DISTRIBDIR}/common/list.makedev
IMAGEDEPENDS+= ${MAKEDEVSCRIPT}
PARSELISTENV+= MAKEDEVSCRIPT=${MAKEDEVSCRIPT:Q}
${MAKEDEVSPEC}: .PHONY
.endif # ! MAKEDEVTARGETS
.endif # _MAKEFILE_MAKEDEV_