[Top][All Lists]

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

Re: How to get all the dependences of a target?

From: Paul Smith
Subject: Re: How to get all the dependences of a target?
Date: Thu, 7 Jan 2010 13:52:43 -0500

On Fri, 2010-01-08 at 11:16 +1800, Peng Yu wrote:
> Is there a way to get all the dependences (i.e., file1.txt ...
> filen.txt) in gnu make? For example, to delete all the dependent
> files.
> clean:
>   rm <all the dependent files of 'all'>

You can get all the prerequisites of the CURRENT target in its recipe
with the $^ automatic variable.

There is no way to get make to tell you all the prerequisites of SOME
OTHER target.

Anyway, that wouldn't do what you want (at least in this case, for
"clean") since each of those prerequisites has its own list of
prerequisites, and each of those has its own list, etc.

The above pseudo-code, even if it could be made to work, would only
remove the top-level prerequisites.

reply via email to

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