help-make
[Top][All Lists]
Advanced

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

Confusion around empty recipe


From: Jeenu Viswambharan
Subject: Confusion around empty recipe
Date: Sat, 1 Jun 2024 19:05:49 +0100

Hi,

This is about a question I posted on Stack Overflow some time ago:
https://stackoverflow.com/questions/76954446/typescript-workflow-using-gnu-make.
The suggested solution works, but I've some follow-up questions, so
I'm trying here instead.

There's little point in my repeating the question here. As suggested
by an answer to the post, the issue I reported is solved if I add a
semicolon to a rule.

But I further wanted to understand _why_ the solution works. Somehow,
make behaves differently when a semicolon is added vs. when it's
absent.

Perhaps it's that

$(js_files): .compiled

was interpreted as an implicit rule, and

$(js_files): .compiled ;

was interpreted as an explicit rule with an empty recipe.

I can see from the output of make -d that the former syntax spawns off
implicit rule search, but the latter doesn't. But I can't explain why
(or by what mechanism) make produces different behaviours in these
cases--since there are no implicit rules found, it shouldn't have made
any difference, methinks.

Please can someone contrast make's interpretation in both the above
cases, and why that leads to the behaviours in their respective cases.

The makefile is a self-contained, so you should be able to reproduce
that locally.

Thanks.

PS: I've since learned about grouped targets to achieve similar
effect, but haven't employed them yet.

--
Jeenu



reply via email to

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