Date: Thu, 21 Nov 2019 15:59:33 +0000 (UTC) From: Warner Losh <imp@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r354968 - in head: share/mk sys/conf Message-ID: <201911211559.xALFxXQa012513@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: imp Date: Thu Nov 21 15:59:33 2019 New Revision: 354968 URL: https://svnweb.freebsd.org/changeset/base/354968 Log: Introduce bsd.sysdir.mk to consolidate looking for the kernel. Reviewed by: jhb Differential Revision: https://reviews.freebsd.org/D22144 Added: head/share/mk/bsd.sysdir.mk - copied, changed from r354937, head/share/mk/bsd.kmod.mk Modified: head/share/mk/bsd.dtb.mk head/share/mk/bsd.kmod.mk head/sys/conf/dtb.build.mk head/sys/conf/kmod.mk Modified: head/share/mk/bsd.dtb.mk ============================================================================== --- head/share/mk/bsd.dtb.mk Thu Nov 21 15:54:56 2019 (r354967) +++ head/share/mk/bsd.dtb.mk Thu Nov 21 15:59:33 2019 (r354968) @@ -1,22 +1,6 @@ # $FreeBSD$ -# Search for kernel source tree in standard places. -.if empty(KERNBUILDDIR) -.if !defined(SYSDIR) -.for _dir in ${SRCTOP:D${SRCTOP}/sys} \ - ${.CURDIR}/../.. ${.CURDIR}/../../.. ${.CURDIR}/../../../.. \ - ${.CURDIR}/../../../../.. /sys /usr/src/sys -.if !defined(SYSDIR) && exists(${_dir}/kern/) && exists(${_dir}/conf/kmod.mk) -SYSDIR= ${_dir} -.endif -.endfor -.endif -.if !defined(SYSDIR) || !exists(${SYSDIR}/kern/) || \ - !exists(${SYSDIR}/conf/kmod.mk) -.error Unable to locate the kernel source tree. Set SYSDIR to override. -.endif -.endif - +.include <bsd.sysdir.mk> .include "${SYSDIR}/conf/dtb.mk" .include <bsd.sys.mk> Modified: head/share/mk/bsd.kmod.mk ============================================================================== --- head/share/mk/bsd.kmod.mk Thu Nov 21 15:54:56 2019 (r354967) +++ head/share/mk/bsd.kmod.mk Thu Nov 21 15:59:33 2019 (r354968) @@ -1,20 +1,4 @@ # $FreeBSD$ -# Search for kernel source tree in standard places. -.if empty(KERNBUILDDIR) -.if !defined(SYSDIR) -.for _dir in ${SRCTOP:D${SRCTOP}/sys} \ - ${.CURDIR}/../.. ${.CURDIR}/../../.. ${.CURDIR}/../../../.. \ - ${.CURDIR}/../../../../.. /sys /usr/src/sys -.if !defined(SYSDIR) && exists(${_dir}/kern/) && exists(${_dir}/conf/kmod.mk) -SYSDIR= ${_dir:tA} -.endif -.endfor -.endif -.if !defined(SYSDIR) || !exists(${SYSDIR}/kern/) || \ - !exists(${SYSDIR}/conf/kmod.mk) -.error Unable to locate the kernel source tree. Set SYSDIR to override. -.endif -.endif - +.include <bsd.sysdir.mk> .include "${SYSDIR}/conf/kmod.mk" Copied and modified: head/share/mk/bsd.sysdir.mk (from r354937, head/share/mk/bsd.kmod.mk) ============================================================================== --- head/share/mk/bsd.kmod.mk Thu Nov 21 06:48:30 2019 (r354937, copy source) +++ head/share/mk/bsd.sysdir.mk Thu Nov 21 15:59:33 2019 (r354968) @@ -1,7 +1,6 @@ # $FreeBSD$ # Search for kernel source tree in standard places. -.if empty(KERNBUILDDIR) .if !defined(SYSDIR) .for _dir in ${SRCTOP:D${SRCTOP}/sys} \ ${.CURDIR}/../.. ${.CURDIR}/../../.. ${.CURDIR}/../../../.. \ @@ -15,6 +14,3 @@ SYSDIR= ${_dir:tA} !exists(${SYSDIR}/conf/kmod.mk) .error Unable to locate the kernel source tree. Set SYSDIR to override. .endif -.endif - -.include "${SYSDIR}/conf/kmod.mk" Modified: head/sys/conf/dtb.build.mk ============================================================================== --- head/sys/conf/dtb.build.mk Thu Nov 21 15:54:56 2019 (r354967) +++ head/sys/conf/dtb.build.mk Thu Nov 21 15:59:33 2019 (r354968) @@ -11,12 +11,7 @@ DTC?= dtc .if defined(S) SYSDIR= ${S} .else -# Search for kernel source tree in standard places. -.for _dir in ${.CURDIR}/../.. ${.CURDIR}/../../.. /sys /usr/src/sys -.if exists(${_dir}/kern/) -SYSDIR= ${_dir:tA} -.endif -.endfor +.include <bsd.sysdir.mk> .endif # defined(S) .endif # defined(SYSDIR) Modified: head/sys/conf/kmod.mk ============================================================================== --- head/sys/conf/kmod.mk Thu Nov 21 15:54:56 2019 (r354967) +++ head/sys/conf/kmod.mk Thu Nov 21 15:59:33 2019 (r354968) @@ -79,21 +79,7 @@ OBJCOPY?= objcopy .include "kern.opts.mk" .include <bsd.compiler.mk> .include "config.mk" - -# Search for kernel source tree in standard places. -.if empty(KERNBUILDDIR) -.if !defined(SYSDIR) -.for _dir in ${SRCTOP:D${SRCTOP}/sys} \ - ${.CURDIR}/../.. ${.CURDIR}/../../.. /sys /usr/src/sys -.if !defined(SYSDIR) && exists(${_dir}/kern/) -SYSDIR= ${_dir:tA} -.endif -.endfor -.endif -.if !defined(SYSDIR) || !exists(${SYSDIR}/kern/) -.error "can't find kernel source tree" -.endif -.endif +.include <bsd.sysdir.mk> .SUFFIXES: .out .o .c .cc .cxx .C .y .l .s .S .m
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201911211559.xALFxXQa012513>