Using sed in a Makefile

Jerry gesbbb at yahoo.com
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"}|' ./a.sh
sed -e 's|CONFIG_FILE=${CONFIG_FILE:-/etc/${SCRIPT_NAME}.conf}|CONFIG_FILE=${CONFIG_FILE:-/usr/local/etc/${SCRIPT_NAME}.conf}|' ./a.sh

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
@${REINPLACE_CMD} -e 's|CONFIG_FILE=${CONFIG_FILE:-/etc/${SCRIPT_NAME}.conf}|CONFIG_FILE=${CONFIG_FILE:-/usr/local/etc/${SCRIPT_NAME}.conf}|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.

-- 
Jerry
gesbbb at yahoo.com

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 : http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20090307/791a9c86/signature.pgp


More information about the freebsd-ports mailing list