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: Ken Smith
Subject: Re: MAKEFLAGS and auto-including another makefile
Date: Fri, 7 Jan 2005 11:35:46 -0500
User-agent: Mutt/1.5.6i

On Fri, Jan 07, 2005 at 11:25:46AM -0500, Robert P. J. Day wrote:
> On Fri, 7 Jan 2005, Ken Smith wrote:
> 
> > On Fri, Jan 07, 2005 at 08:33:01AM -0500, Robert P. J. Day wrote:
> 
> > >   is there a standard way to do this?  i went looking for a
> > > MAKEINCLUDES env variable or something like that, but didn't find one.
> > > and i'm not sure i want to use MAKEFILES for something like that.  or
> > > do i?
> >
> > Can you simply ask your users to use the complete path to your
> > include makefile?
> 
> sorry, not sure what you mean.  ask them to use the complete path
> where?  on the "-I" option when they invoke make?  i'd rather avoid
> that.  or in the internal "include", which i'd rather avoid as well.
> i'm pretty sure i'm misinterpreting what you mean.

I mean the latter.

include /the/absolute/path/to/your/include/file.mk

You could provide an emacs mode/macro (or equivalent in your IDE) or you
could give users a template file.

> 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.  If you are invoking a script which is named
differently from gmake or make, then you know that you are getting
something special.

  Ken




reply via email to

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