From owner-freebsd-current@FreeBSD.ORG Tue Feb 15 15:34:56 2011 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id EE96D106564A for ; Tue, 15 Feb 2011 15:34:56 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id BFD188FC16 for ; Tue, 15 Feb 2011 15:34:56 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 3BE3B46B0C for ; Tue, 15 Feb 2011 10:34:56 -0500 (EST) Received: from jhbbsd.localnet (unknown [209.249.190.10]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 5AA4E8A009 for ; Tue, 15 Feb 2011 10:34:55 -0500 (EST) From: John Baldwin To: FreeBSD current mailing list Date: Tue, 15 Feb 2011 09:25:51 -0500 User-Agent: KMail/1.13.5 (FreeBSD/7.4-CBSD-20110107; KDE/4.4.5; amd64; ; ) MIME-Version: 1.0 Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Message-Id: <201102150925.51893.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.6 (bigwig.baldwin.cx); Tue, 15 Feb 2011 10:34:55 -0500 (EST) X-Virus-Scanned: clamav-milter 0.96.3 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=0.5 required=4.2 tests=BAYES_00,MAY_BE_FORGED, RDNS_DYNAMIC autolearn=no version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on bigwig.baldwin.cx Cc: Subject: Honor KERNSRCDIR for 'make universe' X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Feb 2011 15:34:57 -0000 This is useful when you want to run make universe against a custom kernel tree. Specifically, if you keep a cross-compiled set of toolchains lying around in a stock HEAD checkout built using 'make toolchains' or 'make universe', then with this patch you can do: make MAKE_JUST_KERNELS universe KERNSRCDIR=/path/to/test/kernel/sources This sort of worked before because KERNSRCDIR was passed to 'make buildkernel' via MAKEOPTIONS. What didn't work was generating LINT files or if you had kernel config files in your new tree that aren't in the stock tree, etc. Index: Makefile =================================================================== --- Makefile (revision 218554) +++ Makefile (working copy) @@ -336,6 +336,7 @@ MAKE_JUST_WORLDS= YES .else UNIVERSE_TARGET?= buildworld .endif +KERNSRCDIR?= ${.CURDIR}/sys targets: @echo "Supported TARGET/TARGET_ARCH pairs for world and kernel targets" @@ -383,8 +384,8 @@ universe_${target}_${target_arch}: universe_${targ .endfor .endif .if !defined(MAKE_JUST_WORLDS) -.if exists(${.CURDIR}/sys/${target}/conf/NOTES) - @(cd ${.CURDIR}/sys/${target}/conf && env __MAKE_CONF=/dev/null \ +.if exists(${KERNSRCDIR}/${target}/conf/NOTES) + @(cd ${KERNSRCDIR}/${target}/conf && env __MAKE_CONF=/dev/null \ ${MAKE} LINT > ${.CURDIR}/_.${target}.makeLINT 2>&1 || \ (echo "${target} 'make LINT' failed," \ "check _.${target}.makeLINT for details"| ${MAKEFAIL})) @@ -398,13 +399,13 @@ universe_kernels: universe_kernconfs .if !defined(TARGET) TARGET!= uname -m .endif -KERNCONFS!= cd ${.CURDIR}/sys/${TARGET}/conf && \ +KERNCONFS!= cd ${KERNSRCDIR}/${TARGET}/conf && \ find [A-Z0-9]*[A-Z0-9] -type f -maxdepth 0 \ ! -name DEFAULTS ! -name NOTES universe_kernconfs: .for kernel in ${KERNCONFS} -TARGET_ARCH_${kernel}!= cd ${.CURDIR}/sys/${TARGET}/conf && \ - config -m ${.CURDIR}/sys/${TARGET}/conf/${kernel} 2> /dev/null | \ +TARGET_ARCH_${kernel}!= cd ${KERNSRCDIR}/${TARGET}/conf && \ + config -m ${KERNSRCDIR}/${TARGET}/conf/${kernel} 2> /dev/null | \ grep -v WARNING: | cut -f 2 .if empty(TARGET_ARCH_${kernel}) .error "Target architecture for ${TARGET}/conf/${kernel} unknown. config(8) likely too old." -- John Baldwin