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. _______________________________________________ Help-make mailing list [email protected] http://lists.gnu.org/mailman/listinfo/help-make
