changeset 511:d9aa67fbc607

Specify where to find FreeBSD kernel config, instead of patching FreeBSD tree. Suggested by: loos
author Aleksandr Rybalko <ray@ddteam.net>
date Thu, 02 Oct 2014 15:54:27 +0300
parents d6809f73abeb
children 8e5d5ff73502
files Makefile
diffstat 1 files changed, 9 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Thu Oct 02 15:46:50 2014 +0300
+++ b/Makefile	Thu Oct 02 15:54:27 2014 +0300
@@ -182,6 +182,8 @@
 # Generate kernel config file
 KERNEL_HINTS_FILE?=${KERNELCONFDIR}/${TARGET_VENDOR}_${TARGET_DEVICE}.hints
 KERNEL_CONFIG_FILE?=${KERNELCONFDIR}/${TARGET_VENDOR}_${TARGET_DEVICE}
+KERNEL_CONFIG_FILENAME=${TARGET_VENDOR}_${TARGET_DEVICE}
+KERNCONFDIR=${KERNELCONFDIR}
 
 kernelconfig:	${TARGET_SOCDIR}/${SOC_KERNCONF} ${KERNELCONFDIR}
 	echo "# Kernel config for ${SOC_CHIP} on ${TARGET_VENDOR} ${TARGET_DEVICE} board" > ${KERNEL_CONFIG_FILE}
@@ -232,7 +234,6 @@
 .for hint in ${KERNEL_HINTS}
 	echo "${hint}" >> ${KERNEL_HINTS_FILE}
 .endfor
-
 # TODO: make dtd file for FDT
 #
 
@@ -251,6 +252,7 @@
 	TARGET_CPUARCH=${TARGET_CPUARCH} \
 	ZROUTER_ROOT=${ZROUTER_ROOT} \
 	WITHOUT_RESCUE=yes \
+	KERNCONFDIR=${KERNCONFDIR} \
 	${CLANG_VARS} \
 	-DNO_CLEAN
 
@@ -266,9 +268,9 @@
 
 kernel-build:	kernelconfig kernelhints ${ZROUTER_FREEBSD_OBJDIR}/tmp/usr/bin/cc
 .if defined(WITH_KERNFAST)
-	MAKEOBJDIRPREFIX=${ZROUTER_OBJ}/tmp/ ${MAKE} ${_KERNEL_BUILD_ENV} -C ${FREEBSD_SRC_TREE} KERNFAST=${KERNEL_CONFIG_FILE} buildkernel
+	MAKEOBJDIRPREFIX=${ZROUTER_OBJ}/tmp/ ${MAKE} ${_KERNEL_BUILD_ENV} -C ${FREEBSD_SRC_TREE} KERNFAST=${KERNEL_CONFIG_FILENAME} buildkernel
 .else
-	MAKEOBJDIRPREFIX=${ZROUTER_OBJ}/tmp/ ${MAKE} ${_KERNEL_BUILD_ENV} -C ${FREEBSD_SRC_TREE} KERNCONF=${KERNEL_CONFIG_FILE} buildkernel
+	MAKEOBJDIRPREFIX=${ZROUTER_OBJ}/tmp/ ${MAKE} ${_KERNEL_BUILD_ENV} -C ${FREEBSD_SRC_TREE} KERNCONF=${KERNEL_CONFIG_FILENAME} buildkernel
 .endif
 
 #XXX_BEGIN Only for testing
@@ -613,16 +615,16 @@
 ${ROOTFS_DEPTEST}:		world	ports
 	@echo "++++++++++++++ Making [email protected] ++++++++++++++"
 
-${ZROUTER_FREEBSD_OBJDIR}/sys/${KERNEL_CONFIG_FILE}/kernel:	kernel-build
+${ZROUTER_FREEBSD_OBJDIR}/sys/${KERNEL_CONFIG_FILENAME}/kernel:	kernel-build
 	@echo "++++++++++++++ Making [email protected] ++++++++++++++"
-	echo "XXXXXXXXXXXXX ${ZROUTER_FREEBSD_OBJDIR}/sys/${KERNEL_CONFIG_FILE}/kernel"
+	echo "XXXXXXXXXXXXX ${ZROUTER_FREEBSD_OBJDIR}/sys/${KERNEL_CONFIG_FILENAME}/kernel"
 
 kernel-install:				${KERNELDESTDIR}/boot/kernel/kernel
 
-${KERNELDESTDIR}/boot/kernel/kernel:	${ZROUTER_FREEBSD_OBJDIR}/sys/${KERNEL_CONFIG_FILE}/kernel kernel-install-dir
+${KERNELDESTDIR}/boot/kernel/kernel:	${ZROUTER_FREEBSD_OBJDIR}/sys/${KERNEL_CONFIG_FILENAME}/kernel kernel-install-dir
 	@echo "++++++++++++++ Making [email protected] ++++++++++++++"
 .if !empty(KERNELDESTDIR)
-	MAKEOBJDIRPREFIX=${ZROUTER_OBJ}/tmp/ ${MAKE} ${_KERNEL_BUILD_ENV} -C ${FREEBSD_SRC_TREE} DESTDIR=${KERNELDESTDIR} KERNCONF=${KERNEL_CONFIG_FILE} installkernel
+	MAKEOBJDIRPREFIX=${ZROUTER_OBJ}/tmp/ ${MAKE} ${_KERNEL_BUILD_ENV} -C ${FREEBSD_SRC_TREE} DESTDIR=${KERNELDESTDIR} KERNCONF=${KERNEL_CONFIG_FILENAME} installkernel
 .else
 .error "KERNELDESTDIR must be set for kernel-install, since we always do cross-build"
 .endif