Re: Makefile indentation for conditionals

Felix Held <[email protected]>
Newsgroups gmane.linux.bios
Message-ID <[email protected]>
Hi,

the odd thing about Makefiles is that those use two different syntax': 
Everything that's indented by a tab is shell syntax and everything else 
is Makefile syntax. So we can't just indent the Makefile syntax part 
with tabs to make it look nicer and mixing tabs and spaces which do 
different things here if I'm not mistaken doesn't sound too good to me 
either. I'd say that we should add some comments to the else and endif 
to point out to which ifeq/ifneq those belong in cases where there are 
multiple nested if(n)eq or where the else/endif is far away from the 
if(n)eq. Separating unrelated if(n)eq blocks by a newline also helps a 
bit. Maybe there's a better way that I'm not aware of though.

Regards,
Felix

On 23/11/2023 02:51, Maximilian Brune wrote:
> Hi
> 
> Reading Makefiles especially in big projects like coreboot is a 
> constant. pain. One of the big issues is that conditionals are very hard 
> to read since we cannot use tabs for indentation. Has anyone ever 
> thought about using whitespaces as indentation for conditionals in our 
> Makefiles or is that connected to known problems?
> 
> greetings
> Max
> 
> _______________________________________________
> coreboot mailing list -- [email protected]
> To unsubscribe send an email to [email protected]
_______________________________________________
coreboot mailing list -- [email protected]
To unsubscribe send an email to [email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.