summaryrefslogtreecommitdiffstats
path: root/Makefile.inc1
diff options
context:
space:
mode:
authorbdrewery <bdrewery@FreeBSD.org>2016-01-07 22:06:05 +0000
committerbdrewery <bdrewery@FreeBSD.org>2016-01-07 22:06:05 +0000
commit94e10a453c90b8824c3259629975eb51e4be2493 (patch)
treeae40216aa046e002ae44e709e313da9b81b4b702 /Makefile.inc1
parentd931913fc595153c76edbd68c8c42d0aa39cc57f (diff)
downloadFreeBSD-src-94e10a453c90b8824c3259629975eb51e4be2493.zip
FreeBSD-src-94e10a453c90b8824c3259629975eb51e4be2493.tar.gz
MFC r291611:
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".
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 28842f4..e0553b8 100644
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -1012,10 +1012,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
@@ -1029,12 +1033,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 "--------------------------------------------------------------"
@@ -1093,6 +1097,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
@@ -1103,6 +1108,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 "--------------------------------------------------------------"
@@ -1115,6 +1121,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
@@ -1132,6 +1139,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)
@@ -1153,9 +1161,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}; \
@@ -1164,9 +1174,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}; \
OpenPOWER on IntegriCloud