aboutsummaryrefslogtreecommitdiff
path: root/sys/conf/Makefile.i386
diff options
context:
space:
mode:
authorDavid E. O'Brien <obrien@FreeBSD.org>2000-09-05 22:37:46 +0000
committerDavid E. O'Brien <obrien@FreeBSD.org>2000-09-05 22:37:46 +0000
commit3bdfa9e589b3febf74898a7caeb0a4dda6629777 (patch)
tree4d85be34ca9a68fb856e54b67d5e7d96c4425344 /sys/conf/Makefile.i386
parent877aa18bbf2ce86e50f9ab1b1795cd1eff6b0f43 (diff)
downloadsrc-3bdfa9e589b3febf74898a7caeb0a4dda6629777.tar.gz
src-3bdfa9e589b3febf74898a7caeb0a4dda6629777.zip
The kernel is now known as `kernel.ko' and it and its matching modules
live in ``/boot/kernel/''.
Notes
Notes: svn path=/head/; revision=65501
Diffstat (limited to 'sys/conf/Makefile.i386')
-rw-r--r--sys/conf/Makefile.i38661
1 files changed, 34 insertions, 27 deletions
diff --git a/sys/conf/Makefile.i386 b/sys/conf/Makefile.i386
index acf5001199e8..6f940fe45e83 100644
--- a/sys/conf/Makefile.i386
+++ b/sys/conf/Makefile.i386
@@ -20,7 +20,9 @@
%VERSREQ= 500003
# Can be overridden by makeoptions or /etc/make.conf
+KERNEL_KO?= kernel.ko
KERNEL?= kernel
+KODIR?= /boot/${KERNEL}
STD8X16FONT?= iso
.if !defined(S)
@@ -107,7 +109,7 @@ SYSTEM_DEP+= $S/conf/ldscript.$M
.PHONY: all modules
-all: ${KERNEL}
+all: ${KERNEL_KO}
depend: kernel-depend
clean: kernel-clean
@@ -117,11 +119,11 @@ install install.debug: kernel-install
reinstall reinstall.debug: kernel-reinstall
.if !defined(DEBUG)
-FULLKERNEL= ${KERNEL}
+FULLKERNEL= ${KERNEL_KO}
.else
-FULLKERNEL= ${KERNEL}.debug
-${KERNEL}: ${FULLKERNEL}
- ${OBJCOPY} --strip-debug ${FULLKERNEL} ${KERNEL}
+FULLKERNEL= ${KERNEL_KO}.debug
+${KERNEL_KO}: ${FULLKERNEL}
+ ${OBJCOPY} --strip-debug ${FULLKERNEL} ${KERNEL_KO}
.endif
${FULLKERNEL}: ${SYSTEM_DEP} vers.o
@@ -141,7 +143,7 @@ ${mfile:T:S/.m$/.h/}: ${mfile}
kernel-clean:
rm -f *.o *.so *.So *.ko *.s eddep errs \
- ${FULLKERNEL} ${KERNEL} linterrs makelinks param.c \
+ ${FULLKERNEL} ${KERNEL_KO} linterrs makelinks param.c \
setdef[01].c setdefs.h tags \
vers.c vnode_if.c vnode_if.h \
${MFILES:T:S/.m$/.c/} ${MFILES:T:S/.m$/.h/} \
@@ -222,20 +224,30 @@ kernel-install kernel-install.debug:
echo "You must activate /boot/device.hints in loader.conf." ; \
exit 1 ; \
fi
- @if [ ! -f ${KERNEL}${.TARGET:S/kernel-install//} ] ; then \
+ @if [ ! -f ${KERNEL_KO}${.TARGET:S/kernel-install//} ] ; then \
echo "You must build a kernel first." ; \
exit 1 ; \
fi
-.if exists(${DESTDIR}/${KERNEL})
- -chflags noschg ${DESTDIR}/${KERNEL}
- mv ${DESTDIR}/${KERNEL} ${DESTDIR}/${KERNEL}.old
+.if exists(${DESTDIR}/${KODIR})
+.if exists(${DESTDIR}/${KODIR}.old)
+ @-chflags -R noschg ${DESTDIR}/${KODIR}.old
+ -rm -rf ${DESTDIR}/${KODIR}.old
.endif
+ mv ${DESTDIR}/${KODIR} ${DESTDIR}/${KODIR}.old
+.endif
+ mkdir -p ${KODIR}
+ @if [ -f ${DESTDIR}/${KODIR}/${KERNEL_KO} ] ; then \
+ chflags noschg ${DESTDIR}/${KODIR}/${KERNEL_KO} ; \
+ fi
install -c -m 555 -o root -g wheel -fschg \
- ${KERNEL}${.TARGET:S/kernel-install//} ${DESTDIR}/${KERNEL}
+ ${KERNEL_KO}${.TARGET:S/kernel-install//} ${DESTDIR}/${KODIR}
kernel-reinstall kernel-reinstall.debug:
+ @if [ -f ${DESTDIR}/${KODIR}/${KERNEL_KO} ] ; then \
+ chflags noschg ${DESTDIR}/${KODIR}/${KERNEL_KO} ; \
+ fi
install -c -m 555 -o root -g wheel -fschg \
- ${KERNEL}${.TARGET:S/kernel-reinstall//} ${DESTDIR}/${KERNEL}
+ ${KERNEL_KO}${.TARGET:S/kernel-reinstall//} ${DESTDIR}/${KODIR}
.if !defined(MODULES_WITH_WORLD) && !defined(NO_MODULES) && exists($S/modules)
all: modules
@@ -248,38 +260,33 @@ install install.debug: modules-install
reinstall reinstall.debug: modules-reinstall
.endif
+MKMODULESENV= MAKEOBJDIRPREFIX=${.OBJDIR}/modules KMODDIR=${DESTDIR}/${KODIR}
+
modules:
@mkdir -p ${.OBJDIR}/modules
- cd $S/modules && env MAKEOBJDIRPREFIX=${.OBJDIR}/modules ${MAKE} obj all
+ cd $S/modules && env ${MKMODULESENV} ${MAKE} obj all
modules-depend:
@mkdir -p ${.OBJDIR}/modules
- cd $S/modules && env MAKEOBJDIRPREFIX=${.OBJDIR}/modules ${MAKE} obj depend
+ cd $S/modules && env ${MKMODULESENV} ${MAKE} obj depend
modules-clean:
- cd $S/modules && env MAKEOBJDIRPREFIX=${.OBJDIR}/modules ${MAKE} clean
+ cd $S/modules && env ${MKMODULESENV} ${MAKE} clean
modules-cleandepend:
- cd $S/modules && env MAKEOBJDIRPREFIX=${.OBJDIR}/modules ${MAKE} cleandepend
+ cd $S/modules && env ${MKMODULESENV} ${MAKE} cleandepend
modules-cleandir:
- cd $S/modules && env MAKEOBJDIRPREFIX=${.OBJDIR}/modules ${MAKE} cleandir
+ cd $S/modules && env ${MKMODULESENV} ${MAKE} cleandir
modules-tags:
- cd $S/modules && env MAKEOBJDIRPREFIX=${.OBJDIR}/modules ${MAKE} tags
+ cd $S/modules && env ${MKMODULESENV} ${MAKE} tags
modules-install modules-install.debug:
-.if !defined(NO_MODULES_OLD)
- if [ -d ${DESTDIR}/modules -a -n "`ls ${DESTDIR}/modules`" ]; then \
- mkdir -p ${DESTDIR}/modules.old; \
- cp -p ${DESTDIR}/modules/* ${DESTDIR}/modules.old; \
- fi;
-.endif
- mkdir -p ${DESTDIR}/modules
- cd $S/modules && env MAKEOBJDIRPREFIX=${.OBJDIR}/modules ${MAKE} install
+ cd $S/modules && env ${MKMODULESENV} ${MAKE} install
modules-reinstall modules-reinstall.debug:
- cd $S/modules && env MAKEOBJDIRPREFIX=${.OBJDIR}/modules ${MAKE} install
+ cd $S/modules && env ${MKMODULESENV} ${MAKE} install
config.o:
${NORMAL_C}