aboutsummaryrefslogtreecommitdiff
path: root/Makefile.inc1
diff options
context:
space:
mode:
authorBryan Drewery <bdrewery@FreeBSD.org>2015-12-01 20:24:58 +0000
committerBryan Drewery <bdrewery@FreeBSD.org>2015-12-01 20:24:58 +0000
commit6fa9702035fd947fa39fd97306d99c3b9a9cf63c (patch)
tree4a5f5bd5d8bc48f474f14fd6f8a7651dd349fd7e /Makefile.inc1
parent0a63717cfac24533e9dad3794f50aef463826c83 (diff)
downloadsrc-6fa9702035fd947fa39fd97306d99c3b9a9cf63c.tar.gz
src-6fa9702035fd947fa39fd97306d99c3b9a9cf63c.zip
Add NO_INSTALLKERNEL to undo the assumption that the first KERNCONF will be
installed as "kernel". This is relevant for packaging of the kernel when not wanting a default "kernel.txz". Submitted by: Russell Cattelan <cattelan@thebarn.com> MFC after: 2 weeks Obtained from: OneFS Sponsored by: EMC / Isilon Storage Division
Notes
Notes: svn path=/head/; revision=291611
Diffstat (limited to 'Makefile.inc1')
-rw-r--r--Makefile.inc118
1 files changed, 15 insertions, 3 deletions
diff --git a/Makefile.inc1 b/Makefile.inc1
index b75abb84d763..3e2894cf20d3 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -1110,10 +1110,14 @@ KERNCONFDIR?= ${KRNLCONFDIR}
BUILDKERNELS=
INSTALLKERNEL=
+.if defined(NO_INSTALLKERNEL)
+# All of the BUILDKERNELS loops start at index 1.
+BUILDKERNELS+= dummy
+.endif
.for _kernel in ${KERNCONF}
.if exists(${KERNCONFDIR}/${_kernel})
BUILDKERNELS+= ${_kernel}
-.if empty(INSTALLKERNEL)
+.if empty(INSTALLKERNEL) && !defined(NO_INSTALLKERNEL)
INSTALLKERNEL= ${_kernel}
.endif
.endif
@@ -1127,12 +1131,12 @@ ${WMAKE_TGTS:N_worldtmp:Nbuild32} ${.ALLTARGETS:M_*:N_worldtmp}: .MAKE .PHONY
# Builds all kernels defined by BUILDKERNELS.
#
buildkernel: .MAKE .PHONY
-.if empty(BUILDKERNELS)
+.if empty(BUILDKERNELS:Ndummy)
@echo "ERROR: Missing kernel configuration file(s) (${KERNCONF})."; \
false
.endif
@echo
-.for _kernel in ${BUILDKERNELS}
+.for _kernel in ${BUILDKERNELS:Ndummy}
@echo "--------------------------------------------------------------"
@echo ">>> Kernel build for ${_kernel} started on `LC_ALL=C date`"
@echo "--------------------------------------------------------------"
@@ -1191,6 +1195,7 @@ buildkernel: .MAKE .PHONY
#
installkernel installkernel.debug \
reinstallkernel reinstallkernel.debug: _installcheck_kernel
+.if !defined(NO_INSTALLKERNEL)
.if empty(INSTALLKERNEL)
@echo "ERROR: No kernel \"${KERNCONF}\" to install."; \
false
@@ -1201,6 +1206,7 @@ reinstallkernel reinstallkernel.debug: _installcheck_kernel
cd ${KRNLOBJDIR}/${INSTALLKERNEL}; \
${CROSSENV} PATH=${TMPPATH} \
${MAKE} ${IMAKE_INSTALL} KERNEL=${INSTKERNNAME} ${.TARGET:S/kernel//}
+.endif
.if ${BUILDKERNELS:[#]} > 1
.for _kernel in ${BUILDKERNELS:[2..-1]}
@echo "--------------------------------------------------------------"
@@ -1213,6 +1219,7 @@ reinstallkernel reinstallkernel.debug: _installcheck_kernel
.endif
distributekernel distributekernel.debug:
+.if !defined(NO_INSTALLKERNEL)
.if empty(INSTALLKERNEL)
@echo "ERROR: No kernel \"${KERNCONF}\" to install."; \
false
@@ -1230,6 +1237,7 @@ distributekernel distributekernel.debug:
sed -e 's|^./kernel|.|' ${DESTDIR}/${DISTDIR}/kernel.premeta > \
${DESTDIR}/${DISTDIR}/kernel.meta
.endif
+.endif
.if ${BUILDKERNELS:[#]} > 1
.for _kernel in ${BUILDKERNELS:[2..-1]}
.if defined(NO_ROOT)
@@ -1251,9 +1259,11 @@ distributekernel distributekernel.debug:
packagekernel:
.if defined(NO_ROOT)
+.if !defined(NO_INSTALLKERNEL)
cd ${DESTDIR}/${DISTDIR}/kernel; \
tar cvf - @${DESTDIR}/${DISTDIR}/kernel.meta | \
${XZ_CMD} > ${PACKAGEDIR}/kernel.txz
+.endif
.if ${BUILDKERNELS:[#]} > 1
.for _kernel in ${BUILDKERNELS:[2..-1]}
cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \
@@ -1262,9 +1272,11 @@ packagekernel:
.endfor
.endif
.else
+.if !defined(NO_INSTALLKERNEL)
cd ${DESTDIR}/${DISTDIR}/kernel; \
tar cvf - . | \
${XZ_CMD} > ${PACKAGEDIR}/kernel.txz
+.endif
.if ${BUILDKERNELS:[#]} > 1
.for _kernel in ${BUILDKERNELS:[2..-1]}
cd ${DESTDIR}/${DISTDIR}/kernel.${_kernel}; \