Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/distrib/common - allow ${MTREECONF} to contain multiple file...
details: https://anonhg.NetBSD.org/src/rev/430a595bca69
branches: trunk
changeset: 521801:430a595bca69
user: lukem <lukem%NetBSD.org@localhost>
date: Tue Feb 05 23:29:43 2002 +0000
description:
- allow ${MTREECONF} to contain multiple files, and build ${WORKSPEC} up by
catting these together with "/unset all" between each file.
- when populating the tree (${WORKBUILT} rule), depend upon ${WORKSPEC}
rather than ${MTREECONF}
- support ${MAKEFS_FLAGS} as optional flags for ${MAKEFS}
- use CLEANFILES to remove files
diffstat:
distrib/common/Makefile.image | 23 +++++++++++++----------
1 files changed, 13 insertions(+), 10 deletions(-)
diffs (75 lines):
diff -r 377758caca93 -r 430a595bca69 distrib/common/Makefile.image
--- a/distrib/common/Makefile.image Tue Feb 05 23:16:51 2002 +0000
+++ b/distrib/common/Makefile.image Tue Feb 05 23:29:43 2002 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.image,v 1.1 2002/02/03 15:24:43 lukem Exp $
+# $NetBSD: Makefile.image,v 1.2 2002/02/05 23:29:43 lukem Exp $
#
# Makefile snippet to build a tree from the provided lists,
# and make an ffs file system image from that tree
@@ -13,9 +13,10 @@
# IMAGEDEPENDS depends for ${IMAGE}
# IMAGEENDIAN endianness of ${IMAGE}
# IMAGESIZE size of ${IMAGE}
-# MTREECONF mtree specfile to use
+# MTREECONF mtree specfiles to use to build a master specfile
#
# Optional variables:
+# MAKEFS_FLAGS extra options to ${MAKEFS}
# POPULATEENV environment variables to pass to the output of
# parselist.awk -v mode=populate
# WORKDIR directory to build image in to
@@ -26,8 +27,6 @@
WORKSPEC?= work.spec
WORKBUILT?= work.built
-_PARSELIST= ${_SRC_TOP_}/distrib/common/parselist.awk
-
POPULATEENV+= _SRC_TOP_=${_SRC_TOP_:Q} \
DESTDIR=${DESTDIR:Q} \
CURDIR=${.CURDIR:Q} \
@@ -35,19 +34,23 @@
TARGDIR=${.OBJDIR}/${WORKDIR:Q} \
CRUNCHBIN=${CRUNCHBIN:Q}
+_PARSELIST= ${_SRC_TOP_}/distrib/common/parselist.awk
-${WORKBUILT}: ${IMAGEDEPENDS} ${MTREECONF} ${_PARSELIST} ${LISTS}
+
+${WORKBUILT}: ${IMAGEDEPENDS} ${WORKSPEC} ${_PARSELIST} ${LISTS}
@echo "Building tree into ${WORKDIR}"
-rm -rf ${WORKDIR} ${WORKBUILT}
mkdir -m 755 ${WORKDIR}
- ${MTREE} -def ${MTREECONF} -p ${WORKDIR}/ -UW
+ ${MTREE} -def ${WORKSPEC} -p ${WORKDIR}/ -UW
awk -f ${_PARSELIST} -v mode=populate ${LISTS} | ${POPULATEENV} sh -e \
&& touch ${WORKBUILT}
${WORKSPEC}: ${MTREECONF} ${LISTS} ${_PARSELIST}
-rm -f ${.TARGET} ${.TARGET}.tmp
- cp ${MTREECONF} ${.TARGET}.tmp
- echo "/unset mode" >> ${.TARGET}.tmp
+ ( for i in ${MTREECONF}; do \
+ cat $$i ; \
+ echo "/unset all" ; \
+ done ) >> ${.TARGET}.tmp
awk -f ${_PARSELIST} -v mode=mtree ${LISTS} >> ${.TARGET}.tmp \
&& mv ${.TARGET}.tmp ${.TARGET}
@@ -57,14 +60,14 @@
${MAKEFS} -t ffs -B ${IMAGEENDIAN} -s ${IMAGESIZE} -F ${WORKSPEC} \
-N ${_SRC_TOP_}/etc -o bsize=4096,fsize=512 \
-o optimization=space,minfree=0,nsectors=1,ntracks=128 \
- ${.TARGET}.tmp ${WORKDIR} \
+ ${MAKEFS_FLAGS} ${.TARGET}.tmp ${WORKDIR} \
&& mv -f ${.TARGET}.tmp ${.TARGET}
+CLEANFILES+= ${IMAGE} ${IMAGE}.tmp ${WORKBUILT} ${WORKSPEC} ${WORKSPEC}.tmp
clean cleandir distclean: cleanfsimage
.PHONY: cleanfsimage
cleanfsimage:
- -rm -rf ${IMAGE} ${IMAGE}.tmp ${WORKBUILT} ${WORKSPEC} ${WORKSPEC}.tmp
-rm -rf ${WORKDIR}
Home |
Main Index |
Thread Index |
Old Index