summaryrefslogtreecommitdiff
path: root/Mk
diff options
context:
space:
mode:
authorBryan Drewery <bdrewery@FreeBSD.org>2022-12-21 08:12:45 -0800
committerBryan Drewery <bdrewery@FreeBSD.org>2022-12-21 08:34:32 -0800
commit4ca11c4efc7e01e8fbf797624c8d54157f1c61a0 (patch)
tree4e6b7f8873446f2c8ae4c7116f2c59223cd55ca7 /Mk
parentefbf64ff8c34dd09e3781b6f80df8e7b5d9950e6 (diff)
downloadfreebsd-ports-4ca11c4efc7e01e8fbf797624c8d54157f1c61a0.zip
Mk/bsd.sanity.mk: Reduce parsing during package builds
This disables bsd.sanity.mk when PACKAGE_BUILDING is set such that it only is loaded during 'make [all]' or 'make check-sanity'. It is assumed the package tool will manually call the target if it wants the check. Otherwise we get redundant logic and filesystem lookups from this file for every other build target. Prodded by: mjg
Diffstat (limited to 'Mk')
-rw-r--r--Mk/bsd.port.mk3
-rw-r--r--Mk/bsd.sanity.mk3
2 files changed, 6 insertions, 0 deletions
diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk
index 457497a17e8a..4bd5681bc61c 100644
--- a/Mk/bsd.port.mk
+++ b/Mk/bsd.port.mk
@@ -1961,7 +1961,10 @@ ERROR+= "Unknown USES=${f:C/\:.*//}"
. endfor
. if defined(PORTNAME)
+. if !defined(PACKAGE_BUILDING) || empty(.TARGETS) || make(all) || \
+ make(check-sanity) || make(show*-errors) || make(show*-warnings)
.include "${PORTSDIR}/Mk/bsd.sanity.mk"
+. endif
. endif
. if defined(USE_LOCALE)
diff --git a/Mk/bsd.sanity.mk b/Mk/bsd.sanity.mk
index ac76013ef80b..621445045470 100644
--- a/Mk/bsd.sanity.mk
+++ b/Mk/bsd.sanity.mk
@@ -55,6 +55,7 @@ ERROR+= "${a} is unsupported, please use ${${a}_ALT}"
# Warnings only when DEVELOPER=yes
+.if defined(DEVELOPER)
.if exists(${.CURDIR}/../../Mk/bsd.port.mk) || ${OVERLAYS:tA:M${.CURDIR:H:H}} == ${.CURDIR:H:H}
. if ${.CURDIR:H:T} != ${PKGCATEGORY}
@@ -311,3 +312,5 @@ DEV_WARNING+= "${a} is not needed: ${${a}_REASON}"
DEV_ERROR+= "${a} is unsupported, please use ${${a}_ALT}"
. endif
.endfor
+
+.endif # defined(DEVELOPER)