.if and Makefile issues

Gary Aitken freebsd at dreamchaser.org
Mon Mar 26 16:57:26 UTC 2018


On 03/26/18 01:11, Don Lewis wrote:
> On 25 Mar, Don Lewis wrote:
>> On 25 Mar, Gary Aitken wrote:
<snip>
> I forgot that all of the lines from the "if" up to but not including 
> "fi" need to end with a \ so that make treats them all as one
> multi-line shell command:
> 
> post-build:
> <ht>echo "***** post-build *****"
> <ht>#   Avoid executable name conflict with dcraw port
> <ht>if [ -e ${WRKSRC}/dcraw ]; then \
> <ht><ht>echo ===== dcraw exists ===== \
> <ht><ht>mv ${WRKSRC}/dcraw ${WRKSRC}/${PORTNAME}-dcraw \
> <ht>else \
> <ht><ht>echo ===== dcraw does not exist ===== \
> <ht>fi

Thanks, and thanks also to Theron Tarigo for his solution.

In case anyone in the future is looking at this:
The above doesn't work because of a few missing ;
(not a Makefile related issue; a shell syntax issue)
What works:

post-build:
<ht>echo "***** post-build *****"
#<ht>Avoid executable name conflict with dcraw port
<ht>if [ -e ${WRKSRC}/dcraw ] ; then \
<ht><ht>echo "===== dcraw exists =====" ; \
<ht><ht>mv ${WRKSRC}/dcraw ${WRKSRC}/${PORTNAME}-dcraw ; \
<ht>else \
<ht><ht>echo "===== dcraw does not exist =====" ; \
<ht>fi

Thanks again,
Gary


More information about the freebsd-ports mailing list