bug-make
[Top][All Lists]
Advanced

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

Re: [RFC] allow GNUMAKEFLAGS override to MAKEFLAGS


From: Kris Warkentin
Subject: Re: [RFC] allow GNUMAKEFLAGS override to MAKEFLAGS
Date: Tue, 24 Jun 2003 14:12:47 -0400

Anyone?  Is this a stupid idea?  Too hard to implement properly?

cheers,

Kris

----- Original Message ----- 
From: "Kris Warkentin" <address@hidden>
To: <address@hidden>
Sent: Monday, June 23, 2003 3:14 PM
Subject: [RFC] allow GNUMAKEFLAGS override to MAKEFLAGS


> Microsoft's nmake command makes use of MAKEFLAGS as well which potentially
> could create a problem with having GNU make and nmake co-exist on a
system.
>
> It seemed that having a GNUMAKEFLAGS environment variable to override
> MAKEFLAGS would probably do the trick.  The logic would be:
>
> 1) At first invocation, check for GNUMAKEFLAGS.
> 2) If defined, set MAKEFLAGS to be the same as GNUMAKEFLAGS and clear
> GNUMAKEFLAGS
>
> Step two makes sure that if make invokes itself recursively, everything
> works properly.  Based on my quick look at the code, it seems that make
uses
> the environment to pass things down the line but I could be wrong about
> that.  I'm hoping someone can tell me why this seemingly simple patch
> doesn't work.  I fell back on setenv("GNUMAKEFLAGS", "", 1) and then
testing
> for an empty string because setenv("blah", NULL, 1) didn't seem to do
> anything on Cygwin.
>
> cheers,
>
> Kris
>
> --- main.c 2002-08-09 21:27:17.000000000 -0400
> +++ main.c.new 2003-06-23 15:01:54.000000000 -0400
> @@ -841,6 +841,7 @@ int main (int argc, char ** argv)
>    register struct file *f;
>    register unsigned int i;
>    char **p;
> +  char *gmf;
>    struct dep *read_makefiles;
>    PATH_VAR (current_directory);
>  #ifdef WINDOWS32
> @@ -854,6 +855,14 @@ int main (int argc, char ** argv)
>    no_default_sh_exe = 1;
>  #endif
>
> +  /* Allow GNUMAKEFLAGS to override MAKEFLAGS.  We unset it after the
first
> +     call so as to not override it on subsequent calls.  */
> +  gmf = getenv("GNUMAKEFLAGS");
> +  if(NULL != gmf && '\0' != gmf[0]){
> +    setenv("MAKEFLAGS", gmf, 1);
> +    setenv("GNUMAKEFLAGS", "", 1);
> +  }
> +
>    default_goal_file = 0;
>    reading_file = 0;
>
>
>
>
>
> _______________________________________________
> Bug-make mailing list
> address@hidden
> http://mail.gnu.org/mailman/listinfo/bug-make
>






reply via email to

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