[Top][All Lists]

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

Automagic Listing of targets,prereqs

From: Tristan Van Berkom
Subject: Automagic Listing of targets,prereqs
Date: Tue, 15 Apr 2003 13:09:27 -0400

I was wondering if there is a way to list targets and
prerequisites in a way that the Nth element in list
1 depends on the Nth element in list 2.

If one were to write a dependancy like so:


this means (mistaken am I ?) that every `single'
target in the former list depends on `all' 
the prereq's in the latter list.

I tried something like this:

$(foreach prereq, $(PREREQS),                   \
    $(foreach, target $(TARGETS),               \
        $(if $(findstring $(prereq), $(target)), \

exept I cant figure out how to violently add newlines
instead of whitespace in between the elements of the 
above generated list (and even then, would they be
considered targets ? I guess so since the pre-proccessing
gets done before targets are considered).

My last resort I guess is to pipe that list through
`sed' for the newlines; into a file on disk... and
then include them in the makefile.

Is this not "beating aroud the bush" for such a simple
task ?

ThankYou in advance for any support ;-)

Cheers all,

PS: I'm useing GNU Make 3.79

reply via email to

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