help-make
[Top][All Lists]
Advanced

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

Re: Help needed on implicit rule search/paths et al


From: Tristan Van Berkom
Subject: Re: Help needed on implicit rule search/paths et al
Date: Thu, 03 Apr 2003 11:40:14 -0500

"Paul D. Smith" wrote:
> 
> If you're using VPATH you should take a stroll through the VPATH
> discussion on my web site below.
> 

Thanks to your VPATH discussion I tried a few things out
and stumbled on a workaround (or a more "correct" way of 
doing things ?).

(BTW I am useing GNU make 3.79)


when I `sed' the output of `gcc -M' like so:

$(topbuilddir)/jukebox-source/libs/gtktt/obj/gtktogglejacket.o \
$(topbuilddir)/jukebox-source/libs/gtktt/config/gtktogglejacket.dep.mk :
\
    $(topbuilddir)/jukebox-source/libs/gtktt/src/gtktogglejacket.c \
    $(topbuilddir)/jukebox-root/usr/include/gtk-2.0/gtk/gtklabel.h \
    $(topbuilddir)/jukebox-root/usr/include/gtk-2.0/gdk/gdk.h \
    $(topbuilddir)/jukebox-root/usr/include/gtk-2.0/gdk/gdkcolor.h \
    ...

and prepend the relative paths to the `targets'; no implicit rules seem
apply to
theese targets (as prereq's of other targets).

when I `sed' the output of `gcc -M' like so:

gtktogglejacket.o gtktogglejacket.dep.mk : \
    $(topbuilddir)/jukebox-source/libs/gtktt/src/gtktogglejacket.c \
    $(topbuilddir)/jukebox-root/usr/include/gtk-2.0/gtk/gtklabel.h \
    $(topbuilddir)/jukebox-root/usr/include/gtk-2.0/gdk/gdk.h \
    $(topbuilddir)/jukebox-root/usr/include/gtk-2.0/gdk/gdkcolor.h \

everything seems to work fine.

The problem with this is that I wanted to prepend the paths so that
an application subdir can include all the `.dep.mk' files from the
library subdirs without running into namespace problems (and so
I can give them a $(MAKE) -C $(subdir) type rule to rebuild the 
libraries they depend on).

what I'm going to try now is something like
this (gcc -M | sed...):

$(gtkttobjdir)gtktogglejacket.o $(gtkttconfdir)gtktogglejacket.dep.mk :
\
    $(topbuilddir)/jukebox-source/libs/gtktt/src/gtktogglejacket.c \
    $(topbuilddir)/jukebox-root/usr/include/gtk-2.0/gtk/gtklabel.h \
    $(topbuilddir)/jukebox-root/usr/include/gtk-2.0/gdk/gdk.h \
    $(topbuilddir)/jukebox-root/usr/include/gtk-2.0/gdk/gdkcolor.h \

where $(gtkttobjdir) will expand to
"$(topbuilddir)/jukebox-source/libs/gtktt/obj/"
when included from an application subdir and will expand to nothing when
included from a library subdir (or when included from its "own" subdir).

maybe I'm still missing some vital piece of information but this seems
like the logical solution (no matter how illogical and seemingly 
complicated my co-workers will probably find this).

If you think I'm makeing a big miss; please let me know; otherwise
I think I have this covered. that one phrase "VPATH is good for finding
sources, 
not for finding targets" really helped + I've been looking for a website
like yours all week.

Cheers,
        -Tristan




reply via email to

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