On 09/02/2023 12:11 pm, Anthony PERARD wrote:
> flex/bison generate two targets, and when those targets are
> prerequisite of other rules they are considered independently by make.
>
> We can have a situation where the .c file is out-of-date but not the
> .h, git checkout for example. In this case, if a rule only have the .h

Nit.  s/have/has/

(Can fix on commit.)

> file as prerequiste, make will procced and start to build the object.
> In parallel, another target can have the .c file as prerequisite and
> make will find out it need re-generating and do so, changing the .h at
> the same time. This parallel task breaks the first one.
>
> To avoid this scenario, we put both the header and the source as
> prerequisite for all object even if they only need the header.
>
> Reported-by: Andrew Cooper <[email protected]>
> Signed-off-by: Anthony PERARD <[email protected]>

Acked-by: Andrew Cooper <[email protected]>

This is a very subtle corner case.

~Andrew

Reply via email to