bug-make
[Top][All Lists]
Advanced

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

Re: Circular dependency with order-only dependencies


From: Eli Zaretskii
Subject: Re: Circular dependency with order-only dependencies
Date: Wed, 23 Jan 2019 19:55:46 +0200

> From: Paul Smith <address@hidden>
> Date: Wed, 23 Jan 2019 12:00:20 -0500
> 
> GNU make's internal dependency graph determines the order in which
> targets are built.  It must be acyclical, otherwise make can never
> choose which target to build before others.
> 
> In your example makefile you have a cycle:
> 
>   b -> t -> a.o -> a.h -,
>   ^_____________________/
> 
> So make can never correctly choose which target to build first, without
> breaking the cycle.

It's only a cycle if neither a.h nor b exist.  But the same message is
emitted if a.h does exist and is newer than foo, in which case there's
no need to rebuild a.h, and thus no cycle.  And if a.h is outdated wrt
foo, but b exists, then I'd expect Make to update a.h and then rebuild
b, at which point there's also no cycle because a.h is up to date.

What am I missing?



reply via email to

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