Using sed in a Makefile

Jerry gesbbb at
Sat Mar 7 08:10:52 PST 2009

I have a question regarding the syntax for 'sed' in a Makefile. Using sed outside a Makefile this works fine.

sed -e 's|SIG_DB=${SIG_DB:-""}|SIG_DB=${SIG_DB:-"/var/db/clamav"}|' ./
sed -e 's|CONFIG_FILE=${CONFIG_FILE:-/etc/${SCRIPT_NAME}.conf}|CONFIG_FILE=${CONFIG_FILE:-/usr/local/etc/${SCRIPT_NAME}.conf}|' ./

However, This does not work in a Makefile

@${REINPLACE_CMD} -e 's|SIG_DB=${SIG_DB:-""}|SIG_DB=${SIG_DB:-"/var/db/clamav"}|g' ${WRKSRC}/${PORTNAME}.sh
	Syntax error: Unterminated quoted string
	*** error code 2

This will probably line wrap making it difficult to read. I just do not understand why it should behave differently. The second line in each example is the one that seems to cause a problem.

gesbbb at

When the ax entered the forest, the trees said, "The handle is one of us!"

	Turkish proverb
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 196 bytes
Desc: not available
Url :

More information about the freebsd-ports mailing list