makedep: Allow overriding makefile variables through the MAKEFLAGS environment variable.
This commit is contained in:
parent
ab8d61d29b
commit
cab558b4bd
|
@ -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
|
* parse_option
|
||||||
*/
|
*/
|
||||||
|
@ -1893,9 +1916,12 @@ static int parse_option( const char *opt )
|
||||||
*/
|
*/
|
||||||
int main( int argc, char *argv[] )
|
int main( int argc, char *argv[] )
|
||||||
{
|
{
|
||||||
|
const char *makeflags = getenv( "MAKEFLAGS" );
|
||||||
struct incl_file *pFile;
|
struct incl_file *pFile;
|
||||||
int i, j;
|
int i, j;
|
||||||
|
|
||||||
|
if (makeflags) parse_makeflags( makeflags );
|
||||||
|
|
||||||
i = 1;
|
i = 1;
|
||||||
while (i < argc)
|
while (i < argc)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue