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:01:52 -0500
User-agent: Mutt/1.5.6i

On Fri, Jan 07, 2005 at 08:33:01AM -0500, Robert P. J. Day wrote:
> 
>   a couple of questions.  first, in messing with the MAKEFLAGS
> variable and printing it out in a rule, i noticed that the leading "-"
> is dropped.  that is, if i run:
> 
>   $ make -I/a/b/c
> 
> and print the value of ${MAKEFLAGS}, what i get is "I /a/b/c".  but if
> i have multiple options, all subsequent options will have the leading
> hyphen.  not a big deal, but i'm just curious as to why the leading
> hyphen goes missing.  and the docs don't seem to make any mention of
> that.

I confirmed this behavior.  Seems strange to me too.  However, the
option's effect gets properly propogated to a submake.

>   and second (and more importantly), i'd like to initialize my make
> execution environment to automatically add some entries to the
> "include" directive search path.  that is, i want to create a single
> .mk file that contains universally-useful defines, and be able to just
> include that file with
> 
>   -include usefuldefines.mk
> 
> now, i know i can use the make "-I" option to extend the include
> search path, but that gets to be a pain after a while -- i just want
> my users to type "make".  i can see several solutions.
> 
>   one, alias "make" to "make -I<dirname>" for everyone.  barf.
> 
>   two, set MAKEFLAGS in the shell environment to "I <dirname>".  barf
> as well.
> 
>   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?  Alternatively, you can write a script which calls gmake on a
global makefile which performs the include and then includes the user's
makefile.

  Ken




reply via email to

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