Is there anywhere a precise makefile grammar definition? Or at least some common subset since I guess that there are some flavors. Such a grammar that could be used
It seems there is no official grammar for gnu make, and ...
It would be tricky to write a grammar for make, since the grammar is extremely context-dependent.
As said by Paul D. Smith in a message in the gnu make mailing list. Paul D. Smith is the official maintainer of gnu make.