help-make
[Top][All Lists]
Advanced

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

VPATH & implicit rule search


From: Tristan Van Berkom
Subject: VPATH & implicit rule search
Date: Mon, 14 Mar 2005 16:47:26 -0500
User-agent: Mozilla Thunderbird 0.8 (X11/20040913)

Hi,
    Maybe I can better phrase my problem than this morning ;-D

As I described in my previous mail (which I accidentally sent privatly
to Paul); my problem turned out to be that my auto-generated dependancy
files weren't properly getting generated.

The dependancy files have the regular form of:
    file.d file.o: file.c "and a list of header files"

In the makefile which defines all the rules, at the top I use:

=============================================================
vpath %.d      $(THIS_DIR)$(PATCONF)   # These expand to relative paths
vpath %.c      $(THIS_DIR)$(PATSRCDIR) # to the config & src directories
...along with OBJDIR & BINDIR etc...
=============================================================

Later I define the implicit rules as such:

=============================================================
# dependancies from C files
%.d::%.c
    $(mkdep)

# dependancies from C++ files
%.d::%.cc
    $(mkccdep)
=============================================================

Now, the problem I'm having is that make isn't making the
connection between the deps found in the generated `.d' file &
the actual files in the src & config directories.

For example, I run make in the directory:
     `$(topbuilddir)/jukebox-source/libs/ui/glade-tt'
and `make -d' output indicates that it has read the makefile:
     `$(topbuilddir)/jukebox-source/libs/ui/glade-tt/config/glade-tt.d'
in which it is clearly stated that:
    $(glade-ttobjdir)glade-tt.o \
    $(glade-ttconfdir)glade-tt.d : \
    $(topbuilddir)/jukebox-source/libs/ui/glade-tt/src/glade-tt.c \
    .... \
    $(topbuilddir)/jukebox-source/libs/ui/gtktt/pub/gtkttwindow.h

And `gtkttwindow.h' is newer that `glade-tt.d'

(Note that $(glade-ttobjdir) & $(glade-ttconfdir) are just variables
used to allow makefiles to read dependancies from other directories
and resolve properly)

In this case I get the following output:
=============================================================
Considering target file `../../../../jukebox-source/libs/ui/glade-tt/config/glade-tt.d'. Looking for an implicit rule for `../../../../jukebox-source/libs/ui/glade-tt/config/glade-tt.d'.
  Trying pattern rule with stem `glade-tt'.
Trying implicit prerequisite `../../../../jukebox-source/libs/ui/glade-tt/config/glade-tt.c'.
  Trying pattern rule with stem `glade-tt'.
Trying implicit prerequisite `../../../../jukebox-source/libs/ui/glade-tt/config/glade-tt.cc'. No implicit rule found for `../../../../jukebox-source/libs/ui/glade-tt/config/glade-tt.d'. Finished prerequisites of target file `../../../../jukebox-source/libs/ui/glade-tt/config/glade-tt.d'. No need to remake target `../../../../jukebox-source/libs/ui/glade-tt/config/glade-tt.d'.
=============================================================

Which leads me to beleive that I have yet again failed to
understand and use vpath properly :-(

I've tried this with:

%.d::
    $(mkdep)

And that doesn't seem to help; It only produces this
output instead:
=============================================================
Considering target file `../../../../jukebox-source/libs/ui/glade-tt/config/glade-tt.d'. Looking for an implicit rule for `../../../../jukebox-source/libs/ui/glade-tt/config/glade-tt.d'.
  Trying pattern rule with stem `glade-tt'.
Found an implicit rule for `../../../../jukebox-source/libs/ui/glade-tt/config/glade-tt.d'. Finished prerequisites of target file `../../../../jukebox-source/libs/ui/glade-tt/config/glade-tt.d'. No need to remake target `../../../../jukebox-source/libs/ui/glade-tt/config/glade-tt.d'.
=============================================================

In this case if "Found an implicit rule for" glade-tt.d but
for some reason, didn't know that glade-tt.d actualy needed
to be rebuilt.

Thank you kindly for looking at this for me.

Cheers,
                                 -Tristan

PS:
    Please excuse duplicate mail, I sent another copy of this mail
from another address which is not subscribed to this list (doh!)





reply via email to

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