Re: Conditional broken line in recipe

2023-09-03 Thread Alejandro Colomar
On 2023-09-03 14:57, Alejandro Colomar wrote: > On 2023-09-03 14:38, Paul Smith wrote: >> On Sun, 2023-09-03 at 13:14 +0200, Alejandro Colomar wrote: You need to put the ifdef outside the recipe: >>> >>> That would hurt readability a little bit. >> >> IMO a make preprocessor statement inside a

Re: Conditional broken line in recipe

2023-09-03 Thread Alejandro Colomar
On 2023-09-03 14:38, Paul Smith wrote: > On Sun, 2023-09-03 at 13:14 +0200, Alejandro Colomar wrote: >>> You need to put the ifdef outside the recipe: >> >> That would hurt readability a little bit. > > IMO a make preprocessor statement inside a recipe is a code smell and I > would find the "outsi

Re: Conditional broken line in recipe

2023-09-03 Thread Paul Smith
On Sun, 2023-09-03 at 13:20 +0200, Alejandro Colomar wrote: > Never mind; a python script could be it. Any language where a backslash at the end of the line changes the semantics of the script is difficult to use as a make SHELL, without also using .ONESHELL, because backslash/newline must be used

Re: Conditional broken line in recipe

2023-09-03 Thread Paul Smith
On Sun, 2023-09-03 at 13:14 +0200, Alejandro Colomar wrote: > > You need to put the ifdef outside the recipe: > > That would hurt readability a little bit. IMO a make preprocessor statement inside a recipe is a code smell and I would find the "outside the recipe" version simpler to understand, bu

Re: Conditional broken line in recipe

2023-09-03 Thread Bahman Movaqar
On Sun, 2023-09-03 at 01:00 +0200, Alejandro Colomar wrote: > Hi! > > Is something like this possible? > > target: > foo \ > ifeq (...) > | bar \ > endif > | baz I'm afraid not. The way I approach similar situations is this pattern: ifeq (...) define target._condi

Re: Conditional broken line in recipe

2023-09-03 Thread Alejandro Colomar
On 2023-09-03 13:11, Alejandro Colomar wrote: > Hi Paul, > > On 2023-09-03 04:09, Paul Smith wrote: >> On Sun, 2023-09-03 at 01:03 +0200, Alejandro Colomar wrote: >>> I was also wondering... is ONESHELL significant for performance?  >>> Does the reduction in number of shells speed up things? >> >>

Re: Conditional broken line in recipe

2023-09-03 Thread Alejandro Colomar
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 >

Re: Conditional broken line in recipe

2023-09-03 Thread Alejandro Colomar
Hi Paul, On 2023-09-03 04:09, Paul Smith wrote: > On Sun, 2023-09-03 at 01:03 +0200, Alejandro Colomar wrote: >> I was also wondering... is ONESHELL significant for performance?  >> Does the reduction in number of shells speed up things? > > It might increase performance but that's not what it's

Re: Conditional broken line in recipe

2023-09-02 Thread Paul Smith
On Sun, 2023-09-03 at 01:03 +0200, Alejandro Colomar wrote: > I was also wondering... is ONESHELL significant for performance?  > Does the reduction in number of shells speed up things? It might increase performance but that's not what it's for primarily, at least not in my opinion. It's there fo

Re: Conditional broken line in recipe

2023-09-02 Thread Paul Smith
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

Re: Conditional broken line in recipe

2023-09-02 Thread Alejandro Colomar
On 2023-09-03 01:00, Alejandro Colomar wrote: > Hi! > > Is something like this possible? > > target: > foo \ > ifeq (...) > | bar \ > endif > | baz > > > I imagine I could get something similar, if I I used .ONESHELL:, but I > want to avoid it, as I'd need to redesign most of

Conditional broken line in recipe

2023-09-02 Thread Alejandro Colomar
Hi! Is something like this possible? target: foo \ ifeq (...) | bar \ endif | baz I imagine I could get something similar, if I I used .ONESHELL:, but I want to avoid it, as I'd need to redesign most of the rules. .ONESHELL: target: foo | ifeq (...) bar