diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk --- a/Mk/bsd.port.mk +++ b/Mk/bsd.port.mk @@ -1058,6 +1058,11 @@ # make -C /usr/ports/category/port/. .CURDIR:= ${.CURDIR:tA} +# Ensure .CURDIR doesn't contain a colon, which breaks makefile targets +.if ${.CURDIR:S/:/\:/g} != ${.CURDIR} +.error The current directory path contains ':', this is not supported +.endif + # make sure bmake treats -V as expected .MAKE.EXPAND_VARIABLES= yes diff --git a/Mk/bsd.port.subdir.mk b/Mk/bsd.port.subdir.mk --- a/Mk/bsd.port.subdir.mk +++ b/Mk/bsd.port.subdir.mk @@ -51,6 +51,11 @@ # make -C /usr/ports/category/port/. .CURDIR:= ${.CURDIR:tA} +# Ensure .CURDIR doesn't contain a colon, which breaks makefile targets +.if ${.CURDIR:S/:/\:/g} != ${.CURDIR} +.error The current directory path contains ':', this is not supported +.endif + .include "${PORTSDIR}/Mk/bsd.commands.mk" .MAIN: all @@ -505,7 +510,7 @@ } \ }' ${MOVEDDIR}/${MOVEDFILE}; \ fi \ - fi + fi search: @${_PORTSEARCH}