diff options
author | sjg <sjg@FreeBSD.org> | 2015-06-08 23:34:04 +0000 |
---|---|---|
committer | sjg <sjg@FreeBSD.org> | 2015-06-08 23:34:04 +0000 |
commit | 0239aaa70cc122fa5224b9fb39974d568bbb4b72 (patch) | |
tree | 293b7d11630a448b85d8b82e46c2697c71b0c8a6 /share/mk/gendirdeps.mk | |
parent | a147866eaa091dcb58f0c92024aafaacdf5b6a45 (diff) | |
download | FreeBSD-src-0239aaa70cc122fa5224b9fb39974d568bbb4b72.zip FreeBSD-src-0239aaa70cc122fa5224b9fb39974d568bbb4b72.tar.gz |
Latest dirdeps.mk sets DEP_RELDIR for itself.
This helps guard against bugs in manually edited Makefile.depend
files, and avoids the need to call realpath from the Makefile.depend file.
Diffstat (limited to 'share/mk/gendirdeps.mk')
-rw-r--r-- | share/mk/gendirdeps.mk | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/share/mk/gendirdeps.mk b/share/mk/gendirdeps.mk index b313298..614a20e 100644 --- a/share/mk/gendirdeps.mk +++ b/share/mk/gendirdeps.mk @@ -1,4 +1,4 @@ -# $Id: gendirdeps.mk,v 1.25 2014/03/14 21:28:37 sjg Exp $ +# $Id: gendirdeps.mk,v 1.27 2015/06/08 20:55:11 sjg Exp $ # Copyright (c) 2010-2013, Juniper Networks, Inc. # All rights reserved. @@ -93,6 +93,17 @@ _skip_gendirdeps = egrep -v '^(${SKIP_GENDIRDEPS:O:u:ts|})' | _skip_gendirdeps = .endif +# Below we will turn _{VAR} into ${VAR} which keeps this simple +# GENDIRDEPS_FILTER_DIR_VARS is a list of dirs to be substiuted for. +# GENDIRDEPS_FILTER_VARS is more general. +# In each case order matters. +.if !empty(GENDIRDEPS_FILTER_DIR_VARS) +GENDIRDEPS_FILTER += ${GENDIRDEPS_FILTER_DIR_VARS:@v@S,${$v},_{${v}},@} +.endif +.if !empty(GENDIRDEPS_FILTER_VARS) +GENDIRDEPS_FILTER += ${GENDIRDEPS_FILTER_VARS:@v@S,/${$v}/,/_{${v}}/,@:NS,//,*:u} +.endif + # this (*should* be set in meta.sys.mk) # is the script that extracts what we want. META2DEPS ?= ${.PARSEDIR}/meta2deps.sh @@ -300,7 +311,6 @@ CAT_DEPEND ?= .depend # to output _{VAR} tokens which we will turn into proper ${VAR} references. ${_DEPENDFILE}: ${CAT_DEPEND:M.depend} ${META_FILES:O:u:@m@${exists($m):?$m:}@} ${_this} ${META2DEPS} @(echo '# Autogenerated - do NOT edit!'; echo; \ - echo 'DEP_RELDIR := $${_PARSEDIR:S,$${SRCTOP}/,,}'; echo; \ echo 'DIRDEPS = \'; \ echo '${DIRDEPS:@d@ $d \\${.newline}@}'; echo; \ ${_include_src_dirdeps} \ @@ -321,7 +331,6 @@ all: ${_DEPENDFILE} ${_DEPENDFILE}: ${MAKEFILE} ${_this} @(echo '# Autogenerated - do NOT edit!'; echo; \ - echo 'DEP_RELDIR := $${_PARSEDIR:S,$${SRCTOP}/,,}'; echo; \ echo 'DIRDEPS = \'; \ echo '${DIRDEPS:@d@ $d \\${.newline}@}'; echo; \ echo '.include <dirdeps.mk>'; \ |