summaryrefslogtreecommitdiffstats
path: root/etc/Makefile
diff options
context:
space:
mode:
authorbrooks <brooks@FreeBSD.org>2013-01-17 18:32:30 +0000
committerbrooks <brooks@FreeBSD.org>2013-01-17 18:32:30 +0000
commita390aab8573d52d24403baa43f0d9095d5a2308e (patch)
treef97a90816148ec8d7dbfe3bb50b488a6af71b182 /etc/Makefile
parent5a11c621e6c0ce46a79c57ad713b98822895166b (diff)
downloadFreeBSD-src-a390aab8573d52d24403baa43f0d9095d5a2308e.zip
FreeBSD-src-a390aab8573d52d24403baa43f0d9095d5a2308e.tar.gz
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 :)
Diffstat (limited to 'etc/Makefile')
-rw-r--r--etc/Makefile35
1 files changed, 23 insertions, 12 deletions
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* .
OpenPOWER on IntegriCloud