diff options
Diffstat (limited to 'mk/depends/depends.mk')
-rw-r--r-- | mk/depends/depends.mk | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/mk/depends/depends.mk b/mk/depends/depends.mk index 6bf5e4c4ba1..c3eb73fa0e0 100644 --- a/mk/depends/depends.mk +++ b/mk/depends/depends.mk @@ -1,4 +1,4 @@ -# $NetBSD: depends.mk,v 1.16 2011/10/15 00:23:08 reed Exp $ +# $NetBSD: depends.mk,v 1.17 2014/01/14 10:52:12 cheusov Exp $ ###################################################################### ### depends (PUBLIC) @@ -6,6 +6,7 @@ ### depends is a public target to install missing dependencies for ### the package. ### +_DEPENDS_TARGETS+= sanity-check-depends _DEPENDS_TARGETS+= acquire-depends-lock _DEPENDS_TARGETS+= ${_COOKIE.depends} _DEPENDS_TARGETS+= release-depends-lock @@ -62,3 +63,26 @@ depends-message: .PHONY: pre-depends-hook pre-depends-hook: @${DO_NADA} + +###################################################################### +### sanity-check-depends (PRIVATE) +###################################################################### +### sanity-check-depends is a private target to check that DEPENDS, +### TOOL_DEPENDS, BUILD_DEPENDS and CONFLICTS contain correct values +### + +_SANITY_CHECK_DEPENDS_CMD=${AWK} ' \ + match($$1, /[<>][^,{}]*[*?\[\]]/) { \ + sub(/:[^{}]*$$/, "", $$1); \ + print "Incorrect dependency: " $$1; \ + ex=1 \ + } \ + END { exit ex }' + +.PHONY: sanity-check-depends +sanity-check-depends: + @{ ${DEPENDS:@.temp.@echo '${.temp.}';@} \ + ${BUILD_DEPENDS:@.temp.@echo '${.temp.}';@} \ + ${TOOL_DEPENDS:@.temp.@echo '${.temp.}';@} \ + ${CONFLICTS:@.temp.@echo '${.temp.}';@} \ + } | ${_SANITY_CHECK_DEPENDS_CMD} |