aboutsummaryrefslogtreecommitdiff
path: root/share/mk/dirdeps.mk
diff options
context:
space:
mode:
authorSimon J. Gerraty <sjg@FreeBSD.org>2015-06-08 23:34:04 +0000
committerSimon J. Gerraty <sjg@FreeBSD.org>2015-06-08 23:34:04 +0000
commit6251c65a82b50212fc46ba91b6ab0613b7751ba5 (patch)
tree293b7d11630a448b85d8b82e46c2697c71b0c8a6 /share/mk/dirdeps.mk
parent924b88f687b2fda49ee2d3bf00a611f820b07276 (diff)
downloadsrc-6251c65a82b50212fc46ba91b6ab0613b7751ba5.tar.gz
src-6251c65a82b50212fc46ba91b6ab0613b7751ba5.zip
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.
Notes
Notes: svn path=/projects/bmake/; revision=284171
Diffstat (limited to 'share/mk/dirdeps.mk')
-rw-r--r--share/mk/dirdeps.mk11
1 files changed, 9 insertions, 2 deletions
diff --git a/share/mk/dirdeps.mk b/share/mk/dirdeps.mk
index d46bced3f89d..4aa101fbd8d0 100644
--- a/share/mk/dirdeps.mk
+++ b/share/mk/dirdeps.mk
@@ -1,4 +1,4 @@
-# $Id: dirdeps.mk,v 1.53 2015/05/24 07:08:24 sjg Exp $
+# $Id: dirdeps.mk,v 1.54 2015/06/08 20:55:11 sjg Exp $
# Copyright (c) 2010-2013, Juniper Networks, Inc.
# All rights reserved.
@@ -588,6 +588,11 @@ _qm := ${_m:C;(\.depend)$;\1.${d:E};:${M_dep_qual_fixes:ts:}}
_DEP_TARGET_SPEC := ${d:E}
# some makefiles may still look at this
_DEP_MACHINE := ${d:E:C/,.*//}
+# set this "just in case"
+# we can skip :tA since we computed the path above
+DEP_RELDIR := ${_m:H:S,${SRCTOP}/,,}
+# and reset this
+DIRDEPS =
.if ${_debug_reldir} && ${_qm} != ${_m}
.info loading ${_m} for ${d:E}
.endif
@@ -603,7 +608,9 @@ _DEP_MACHINE := ${d:E:C/,.*//}
.elif ${.MAKE.LEVEL} > 42
.error You should have stopped recursing by now.
.else
-_DEP_RELDIR := ${DEP_RELDIR}
+# we are building something
+DEP_RELDIR := ${RELDIR}
+_DEP_RELDIR := ${RELDIR}
# pickup local dependencies
.-include <.depend>
.endif