From a390aab8573d52d24403baa43f0d9095d5a2308e Mon Sep 17 00:00:00 2001 From: brooks Date: Thu, 17 Jan 2013 18:32:30 +0000 Subject: Rework the mtree portion of etc/Makefile's distrib-dirs target to run mtree in a shell loop so there is only one mtree commandline. Move the implementation of LOCAL_MTREE into etc/Makefile. Sponsored by: DARPA, AFRL Reviewed by: mtree :) --- etc/Makefile | 35 +++++++++++++++++++++++------------ 1 file changed, 23 insertions(+), 12 deletions(-) (limited to 'etc/Makefile') diff --git a/etc/Makefile b/etc/Makefile index dc5f1af..ea29cd0 100644 --- a/etc/Makefile +++ b/etc/Makefile @@ -293,26 +293,37 @@ distribution: MTREE_CMD?= mtree -distrib-dirs: - ${MTREE_CMD} -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.root.dist -p ${DESTDIR}/ - ${MTREE_CMD} -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.var.dist -p ${DESTDIR}/var - ${MTREE_CMD} -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.usr.dist -p ${DESTDIR}/usr - ${MTREE_CMD} -eU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.include.dist \ - -p ${DESTDIR}/usr/include +MTREES= mtree/BSD.root.dist / \ + mtree/BSD.var.dist /var \ + mtree/BSD.usr.dist /usr \ + mtree/BSD.include.dist /usr/include .if ${MK_BIND_LIBS} != "no" - ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BIND.include.dist \ - -p ${DESTDIR}/usr/include +MTREES+= mtree/BIND.include.dist /usr/include .endif .if ${MK_BIND_MTREE} != "no" - ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BIND.chroot.dist \ - -p ${DESTDIR}/var/named +MTREES+= mtree/BIND.chroot.dist /var/named .endif .if ${MK_GROFF} != "no" - ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.groff.dist -p ${DESTDIR}/usr +MTREES+= mtree/BSD.groff.dist /usr .endif .if ${MK_SENDMAIL} != "no" - ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} -f ${.CURDIR}/mtree/BSD.sendmail.dist -p ${DESTDIR}/ +MTREES+= mtree/BSD.sendmail.dist / .endif +.for mtree in ${LOCAL_MTREE} +MTREES+= ../${mtree} / +.endfor + +distrib-dirs: + @set ${MTREES}; \ + while test $$# -ge 2; do \ + m=${.CURDIR}/$$1; \ + shift; \ + d=${DESTDIR}$$1; \ + shift; \ + ${ECHO} ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} \ + -f $$m -p $$d; \ + ${MTREE_CMD} -deU ${MTREE_FOLLOWS_SYMLINKS} -f $$m -p $$d; \ + done; true cd ${DESTDIR}/; rm -f ${DESTDIR}/sys; ln -s usr/src/sys sys cd ${DESTDIR}/usr/share/man/en.ISO8859-1; ln -sf ../man* . cd ${DESTDIR}/usr/share/man/en.UTF-8; ln -sf ../man* . -- cgit v1.1