3 ms·
Because make needs to tell the difference between the rules and then the recipes. Make tells the difference by requiring recipes (you shell scripts) to be prece
by crazydoggers 4y ago
Because make needs to tell the difference between the rules and then the recipes. Make tells the difference by requiring recipes (you shell scripts) to be preceded by tab.
If you let Make accept spaces then there’s no backwards compatible way for it to tell the difference.
You can change the behavior of make to allow a different character to be used before recipes, but then it’s not backwards compatible with other files.
- Izkata 4y ago> If you let Make accept spaces then there’s no backwards compatible way for it to tell the difference. "Rules start with non-whitespace"?
- TAForObvReasons 4y agoThat breaks backwards compatibility since a rule line can start with spaces: nonws: <tab>echo nonws ws: <tab>echo ws
- lisper 4y ago> a rule line can start with spaces Well, that's stupid. And it's news to me. I have never seen a makefile that actually did this. So you could still fix the problem and be backwards-compatible for probably 99% of actual cases. And you could provide a --stupid-whitespace-mode flag for non-backwards-compatible makefies. Honestly, I still see no legitimate reason to continue this insanity.
- maskros 4y agoNot all that uncommon, especially in ifdef situations: ifdef (something,something) rule: something specific recipe else rule: common recipe endif It's also not just rules. Variable assignments are also separate from recipes, and can be indented with spaces. ifdef (something) CFLAGS=something else CFLAGS=otherthing endif
- lisper 4y agoOK, you've convinced me. MAKE is beyond redemption.