bug-make
[Top][All Lists]
Advanced

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

implicit rule invocation issue


From: Hakenson, Gary C.
Subject: implicit rule invocation issue
Date: Mon, 26 Jul 2004 09:21:34 -0600

Hi developers,

I have an issue with make that I am unable to resolve on my own.

My makefile contains an implicit rule as follows:

        %.d : %.c
                (command to create a .d file from the .c file here)

I also have the VPATH variable set as follows:

        VPATH = /d

When I run make, it finds both the target (.d) and the prerequisite (.c) in
the /d directory and since the target is newer then the prerequisite nothing
is done. This is as expected since the current directory does not contain a
.d file.

There exists in the current directory a .c file. What I want to happen is
for the above implicit rule to be invoked on this .c file to produce a .d
file (in the current directory) but this is not happening.

Section 10.5.4 How Patterns Match of the GNU Make book states: "The
directories are ignored only for the purpose of finding an implicit rule to
use, not in the application of that rule.". This explains the behavior I am
seeing.

Not invoking the above implicit rule for the target and prerequisite in the
/d directory is understandable. However, I need the rule to be invoked on a
prerequisite in the current directory to produce the target (which does not
exist) in the current directory.

Do you have any suggestions as to how this may be accomplished?

Thanks for your attention.

Gary Hakenson
505-678-2676






reply via email to

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