diff options
author | sjg <sjg@FreeBSD.org> | 2013-03-08 01:51:32 +0000 |
---|---|---|
committer | sjg <sjg@FreeBSD.org> | 2013-03-08 01:51:32 +0000 |
commit | 01d132e6de4aecfa641945d0e5d774e6c515c8ee (patch) | |
tree | 022351dcf5a38a52f76713e0c3decf68cd3d2a1d /share | |
parent | c5f0bdef1d8c0ef23eda3f17ff4a8be5156c1678 (diff) | |
download | FreeBSD-src-01d132e6de4aecfa641945d0e5d774e6c515c8ee.zip FreeBSD-src-01d132e6de4aecfa641945d0e5d774e6c515c8ee.tar.gz |
Control default .MAKE.DEPENDFILE indepentend of .MAKE.DEPENDFILE_PREFERENCE
Diffstat (limited to 'share')
-rw-r--r-- | share/mk/local.sys.mk | 12 | ||||
-rw-r--r-- | share/mk/sys.dependfile.mk | 14 |
2 files changed, 17 insertions, 9 deletions
diff --git a/share/mk/local.sys.mk b/share/mk/local.sys.mk index d10076c..af6e72c 100644 --- a/share/mk/local.sys.mk +++ b/share/mk/local.sys.mk @@ -168,11 +168,15 @@ STAGED_INCLUDE_DIR= ${STAGE_OBJTOP}/include .include "meta.sys.mk" .endif -# most dirs can be satisfied with one Makefile.depend -.undef .MAKE.DEPENDFILE +# this is sufficient for most of the tree. +.MAKE.DEPENDFILE_DEFAULT = ${.MAKE.DEPENDFILE_PREFIX} + +# but if we have a machine qualified file it should be used in preference .MAKE.DEPENDFILE_PREFERENCE = \ - ${.MAKE.DEPENDFILE_PREFIX} \ - ${.MAKE.DEPENDFILE_PREFIX}.${MACHINE} + ${.MAKE.DEPENDFILE_PREFIX}.${MACHINE} \ + ${.MAKE.DEPENDFILE_PREFIX} + +.undef .MAKE.DEPENDFILE .include "sys.dependfile.mk" diff --git a/share/mk/sys.dependfile.mk b/share/mk/sys.dependfile.mk index 432cc4f..42cec61 100644 --- a/share/mk/sys.dependfile.mk +++ b/share/mk/sys.dependfile.mk @@ -1,4 +1,4 @@ -# $Id: sys.dependfile.mk,v 1.3 2012/04/25 15:45:04 sjg Exp $ +# $Id: sys.dependfile.mk,v 1.5 2013/03/08 00:59:21 sjg Exp $ # # @(#) Copyright (c) 2012, Simon J. Gerraty # @@ -25,16 +25,20 @@ # All depend file names should start with this .MAKE.DEPENDFILE_PREFIX ?= Makefile.depend -# The order of preference: we will use the first one of these we find -# otherwise the 1st entry will be used by default. +# The order of preference: we will use the first one of these we find. +# It usually makes sense to order from most specific to least. .MAKE.DEPENDFILE_PREFERENCE ?= \ ${.CURDIR}/${.MAKE.DEPENDFILE_PREFIX}.${MACHINE} \ ${.CURDIR}/${.MAKE.DEPENDFILE_PREFIX} +# Normally the 1st entry is our default choice +# Another useful default is ${.MAKE.DEPENDFILE_PREFIX} +.MAKE.DEPENDFILE_DEFAULT ?= ${.MAKE.DEPENDFILE_PREFERENCE:[1]} + _e := ${.MAKE.DEPENDFILE_PREFERENCE:@m@${exists($m):?$m:}@} .if !empty(_e) .MAKE.DEPENDFILE := ${_e:[1]} -.elif ${.MAKE.DEPENDFILE_PREFERENCE:M*${MACHINE}} != "" && ${.MAKE.DEPENDFILE_PREFERENCE:[1]:E} != ${MACHINE} +.elif ${.MAKE.DEPENDFILE_PREFERENCE:M*${MACHINE}} != "" && ${.MAKE.DEPENDFILE_DEFAULT:E} != ${MACHINE} # MACHINE specific depend files are supported, but *not* default. # If any already exist, we should follow suit. _aml = ${ALL_MACHINE_LIST:Uarm amd64 i386 powerpc:N${MACHINE}} ${MACHINE} @@ -44,4 +48,4 @@ _e := ${_aml:@MACHINE@${.MAKE.DEPENDFILE_PREFERENCE:@m@${exists($m):?$m:}@}@} .MAKE.DEPENDFILE ?= ${.MAKE.DEPENDFILE_PREFERENCE:M*${MACHINE}:[1]} .endif .endif -.MAKE.DEPENDFILE ?= ${.MAKE.DEPENDFILE_PREFERENCE:[1]} +.MAKE.DEPENDFILE ?= ${.MAKE.DEPENDFILE_DEFAULT} |