Add a IMAGEPREBUILD option for makefiles to ovveride (e.g. to additionally

add files to the staging directory)
This commit is contained in:
martin 2014-08-12 11:48:22 +00:00
parent 94b079ef04
commit d4a4ba1584
1 changed files with 5 additions and 1 deletions

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile.image,v 1.37 2014/08/06 11:41:18 apb Exp $
# $NetBSD: Makefile.image,v 1.38 2014/08/12 11:48:22 martin Exp $
#
# Makefile snippet to build a tree from the provided lists,
# and make an ffs file system image from that tree
@ -13,6 +13,7 @@
#
# 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)
# CRUNCHBIN name of crunchgen(1)ed binary
@ -85,6 +86,9 @@ CLEANFILES+= ${WORKSPEC} ${WORKSPEC}.tmp
.if defined(IMAGE) # {
IMGMAKEFSOPTIONS?= -o bsize=4096,fsize=512
${IMAGE}: ${WORKBUILT}
.if defined(IMAGEPREBUILD)
${IMAGEPREBUILD}
.endif
[ "${.OODATE}" = ${WORKBUILT} -a -f ${IMAGE} -a ! ${IMAGE} -ot ${WORKBUILT} ] || { \
${_MKSHMSG_CREATE} ${.CURDIR:T}/${.TARGET}; \
rm -f ${.TARGET} ${.TARGET}.tmp; \