# $NetBSD: Makefile.image,v 1.44 2024/05/17 21:31:10 christos Exp $
#
# Makefile snippet to build a tree from the provided lists,
# and make an ffs file system image from that tree
#
# Required variables:
# NETBSDSRCDIR top level of src tree (set by <bsd.own.mk>)
# LISTS list file(s) to use
# IMAGEDEPENDS depends for ${IMAGE}
# IMAGEENDIAN endianness of ${IMAGE}
# IMAGESIZE size of ${IMAGE}
# MTREECONF mtree specfiles to use to build a master specfile
#
# Optional variables:
# IMAGE name of target image
# IMAGEPREBUILD additional operations to run pre image creation
# IMAGEPOSTBUILD operation to run on ${IMAGE} ${.TARGET} after its built
# (if this returns non zero, ${.TARGET} is removed)
# IMAGERUNTIME files/directories to copy from $DESTDIR onto the image
# IMAGESPECEXTRA files/directories to add to the spec
# CRUNCHBIN name of crunchgen(1)ed binary
# DESTDIR destination directory
# MAKEFS_FLAGS extra options to ${TOOL_MAKEFS}
# PARSELISTENV environment variables to set for parselist.awk
# WORKDIR directory to build image in to
# IMAGETAR tar.gz file to create containing ${IMAGE}'s contents
#
# IMAGE_RELEASEDIR where to install ${IMAGE}.gz
# IMAGETAR_RELEASEDIR where to install ${IMAGETAR}
#
if !defined(_MAKEFILE_IMAGE_)
_MAKEFILE_IMAGE_=1
WORKDIR?= work
WORKSPEC?= work.spec
WORKBUILT?= work.built
CUROBJDIR!= cd ${.CURDIR} && ${PRINTOBJDIR}