help-make
[Top][All Lists]
Advanced

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

Re: implicit rule and VPATH


From: Paul D. Smith
Subject: Re: implicit rule and VPATH
Date: Wed, 28 Jul 2004 17:59:28 -0400

%% "Hakenson, Gary C." <address@hidden> writes:

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

  hgc> My makefile contains an implicit rule as follows:

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

  hgc> I also have the VPATH variable set as follows:

  hgc>  VPATH = /d

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

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

Can you provide a small, but _complete_ makefile that shows this
behavior?  These kinds of things often depend on exactly how the real
target (foo.d / foo.c) is accessed in the rest of the makefile, not just
how the pattern rule is created.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <address@hidden>          Find some GNU make tips at:
 http://www.gnu.org                      http://make.paulandlesley.org
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist




reply via email to

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