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)