help-make
[Top][All Lists]
Advanced

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

Re: MAKEFLAGS and auto-including another makefile


From: Robert P. J. Day
Subject: Re: MAKEFLAGS and auto-including another makefile
Date: Fri, 7 Jan 2005 11:52:07 -0500 (EST)

On Fri, 7 Jan 2005, Ken Smith wrote:

> I mean the latter.
>
> include /the/absolute/path/to/your/include/file.mk

that's not really doable since several developers will be checking out
this project to their local machines, and where they check it out is
completely unpredictable.  the whole point is that i'm desperately
trying to abolish all absolute paths in this source tree.

> > for the moment, as grotty as it seems, what i'm doing is just setting
> > the env variable for everyone:
> >
> >   export MAKEFLAGS="-I /a/b/c"
> >
> > so that everyone, when they write their own makefiles, just has to
> > write:
> >
> >   include usefuldefines.mk
> >
> > and it will be found automatically.
> >
> >   but, again, this seems like a fairly handy thing to be able to do
> > and, if there's no clean way to do it, what about introducing another
> > variable, MAKEINCLUDES, to handle it?   it doesn't seem like that
> > would hurt anything.
>
> I think the script approach is cleaner than this.  People get used to
> magic environment stuff and forget about it.  Then, when it breaks, you
> may not know where to look.

i'm not crazy about using MAKEFLAGS this way but one consolation is
that, if a developer forgets to set it, then their include directive
should simply fail (as long as they haven't used a name that just
happens to duplicate one in the standard search path of system dirs,
of course).  so as soon as their make chokes, they'll realize what
they did wrong.

not a perfect solution by any means.  but i'll live with it for now.

rday




reply via email to

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