makedep: Allow overriding makefile variables through the MAKEFLAGS environment variable.

This commit is contained in:
Alexandre Julliard 2013-12-26 19:26:37 +01:00
parent ab8d61d29b
commit cab558b4bd
1 changed files with 26 additions and 0 deletions

View File

@ -1837,6 +1837,29 @@ static void update_makefile( const char *path )
}
/*******************************************************************
* parse_makeflags
*/
static void parse_makeflags( const char *flags )
{
const char *p = flags;
char *var, *buffer = xmalloc( strlen(flags) + 1 );
while (*p)
{
while (isspace(*p)) p++;
var = buffer;
while (*p && !isspace(*p))
{
if (*p == '\\' && p[1]) p++;
*var++ = *p++;
}
*var = 0;
if (var > buffer) set_make_variable( &cmdline_vars, buffer );
}
}
/*******************************************************************
* parse_option
*/
@ -1893,9 +1916,12 @@ static int parse_option( const char *opt )
*/
int main( int argc, char *argv[] )
{
const char *makeflags = getenv( "MAKEFLAGS" );
struct incl_file *pFile;
int i, j;
if (makeflags) parse_makeflags( makeflags );
i = 1;
while (i < argc)
{