help-make
[Top][All Lists]
Advanced

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

conditional prerequisite


From: Martin d'Anjou
Subject: conditional prerequisite
Date: Fri, 29 Aug 2003 11:05:46 -0400 (EDT)

Hi,

I have a static pattern rule like this:

%.o: %.c
        gcc ...

Occasionaly, I have an additional dependency, but not always, so I added:

%.other: %.weird
        compile weird

%.o: %.c %.other
        gcc ...

But the entire thing fails now as no rule can be found when there is no 
corresponding ".other" file.

Writing a special rule for that file is ackward because we would have to
copy the special rule to a large number of unrelated makefiles. We already
use VPATH for finding source files, and we already store all our rules in
.mk files that get included. We also use Advanced Auto-Dependency
Generation (works remarkably well).

Is there an elegant solution to this problem?

Thanks,
Martin d'Anjou







reply via email to

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