Index: Mk/bsd.port.mk =================================================================== --- Mk/bsd.port.mk +++ Mk/bsd.port.mk @@ -1053,6 +1053,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 ':', that are not supported +.endif + # make sure bmake treats -V as expected .MAKE.EXPAND_VARIABLES= yes Index: Mk/bsd.port.subdir.mk =================================================================== --- Mk/bsd.port.subdir.mk +++ 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 ':', that are not supported +.endif + .include "${PORTSDIR}/Mk/bsd.commands.mk" .MAIN: all