help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Conditional broken line in recipe


From: Alejandro Colomar
Subject: Re: Conditional broken line in recipe
Date: Sun, 3 Sep 2023 13:14:57 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.1

Hi Paul,

On 2023-09-03 04:06, Paul Smith wrote:
> On Sun, 2023-09-03 at 01:00 +0200, Alejandro Colomar wrote:
>> Is something like this possible?
>>
>> target:
>>      foo \
>> ifeq (...)
>>      | bar \
>> endif
>>      | baz
> 
> I'm sure you've tried it and discovered the answer is "no".  The
> backslash will append the next line to the previous line and it won't
> be considered a make statement.
> 
> You need to put the ifdef outside the recipe:
> 
>     ifeq (...)
>       BAR = | bar
>     else
>       BAR =
>     endif
> 
>     target:
>             foo $(BAR) | baz


That would hurt readability a little bit.  I think ONESHELL is
calling me in whisper.  :)

Cheers,

Alex

-- 
<http://www.alejandro-colomar.es/>
GPG key fingerprint: A9348594CE31283A826FBDD8D57633D441E25BB5

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]