aboutsummaryrefslogtreecommitdiff
path: root/Makefile.inc1
diff options
context:
space:
mode:
authorGleb Smirnoff <glebius@FreeBSD.org>2015-09-02 15:42:14 +0000
committerGleb Smirnoff <glebius@FreeBSD.org>2015-09-02 15:42:14 +0000
commit05f05f8bdc144ccc6d52167d425aae21510ab10f (patch)
tree77f8b3e5f4b1a029a41ac6f906cc2f7e36ace949 /Makefile.inc1
parentb0f99291de18bf4106b11e642187e70bc376c473 (diff)
downloadsrc-05f05f8bdc144ccc6d52167d425aae21510ab10f.tar.gz
src-05f05f8bdc144ccc6d52167d425aae21510ab10f.zip
The ${BUILDKERNELS:[2..-1]} appears to produce a non zero result for
a one word variable, which is quite unexpected from documentation. So, to avoid double installation of a single kernel, protect the extra kernels loop with ${BUILDKERNELS:[#]} > 1 conditional. Sponsored by: Netflix Sponsored by: Nginx, Inc.
Notes
Notes: svn path=/head/; revision=287400
Diffstat (limited to 'Makefile.inc1')
-rw-r--r--Makefile.inc18
1 files changed, 8 insertions, 0 deletions
diff --git a/Makefile.inc1 b/Makefile.inc1
index 7e2c3819e755..397c1af89869 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -1127,6 +1127,7 @@ reinstallkernel reinstallkernel.debug: _installcheck_kernel
cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \
${CROSSENV} PATH=${TMPPATH} \
${MAKE} ${IMAKE_INSTALL} KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel//}
+.if ${BUILDKERNELS:[#]} > 1
.for _kernel in ${BUILDKERNELS:[2..-1]}
@echo "--------------------------------------------------------------"
@echo ">>> Installing kernel ${_kernel}"
@@ -1135,6 +1136,7 @@ reinstallkernel reinstallkernel.debug: _installcheck_kernel
${CROSSENV} PATH=${TMPPATH} \
${MAKE} ${IMAKE_INSTALL} KERNEL=${INSTKERNNAME}.${_kernel} ${.TARGET:S/kernel//}
.endfor
+.endif
distributekernel distributekernel.debug:
.if empty(INSTALLKERNEL)
@@ -1154,6 +1156,7 @@ distributekernel distributekernel.debug:
sed -e 's|^./kernel|.|' ${DESTDIR}/${DISTDIR}/kernel.premeta > \
${DESTDIR}/${DISTDIR}/kernel.meta
.endif
+.if ${BUILDKERNELS:[#]} > 1
.for _kernel in ${BUILDKERNELS:[2..-1]}
.if defined(NO_ROOT)
echo "#${MTREE_MAGIC}" > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.premeta
@@ -1170,27 +1173,32 @@ distributekernel distributekernel.debug:
${DESTDIR}/${DISTDIR}/kernel.${_kernel}.meta
.endif
.endfor
+.endif
packagekernel:
.if defined(NO_ROOT)
cd ${DESTDIR}/${DISTDIR}/kernel; \
tar cvf - @${DESTDIR}/${DISTDIR}/kernel.meta | \
${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel.txz
+.if ${BUILDKERNELS:[#]} > 1
.for _kernel in ${BUILDKERNELS:[2..-1]}
cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \
tar cvf - @${DESTDIR}/${DISTDIR}/kernel.${_kernel}.meta | \
${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.txz
.endfor
+.endif
.else
cd ${DESTDIR}/${DISTDIR}/kernel; \
tar cvf - . | \
${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel.txz
+.if ${BUILDKERNELS:[#]} > 1
.for _kernel in ${BUILDKERNELS:[2..-1]}
cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \
tar cvf - . | \
${XZ_CMD} > ${DESTDIR}/${DISTDIR}/kernel.${_kernel}.txz
.endfor
.endif
+.endif
#
# doxygen