Anyone? Is this a stupid idea? Too hard to implement properly? cheers,
Kris ----- Original Message ----- From: "Kris Warkentin" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> 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 > [EMAIL PROTECTED] > http://mail.gnu.org/mailman/listinfo/bug-make > _______________________________________________ Bug-make mailing list [EMAIL PROTECTED] http://mail.gnu.org/mailman/listinfo/bug-make