makefiles: Add a helper to split large file remove commands.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
1a49f2e044
commit
fcc0e76215
|
@ -497,6 +497,31 @@ static void output_filenames( struct strarray array )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*******************************************************************
|
||||||
|
* output_rm_filenames
|
||||||
|
*/
|
||||||
|
static void output_rm_filenames( struct strarray array )
|
||||||
|
{
|
||||||
|
static const unsigned int max_cmdline = 30000; /* to be on the safe side */
|
||||||
|
unsigned int i, len;
|
||||||
|
|
||||||
|
if (!array.count) return;
|
||||||
|
output( "\trm -f" );
|
||||||
|
for (i = len = 0; i < array.count; i++)
|
||||||
|
{
|
||||||
|
if (len > max_cmdline)
|
||||||
|
{
|
||||||
|
output( "\n" );
|
||||||
|
output( "\trm -f" );
|
||||||
|
len = 0;
|
||||||
|
}
|
||||||
|
output_filename( array.str[i] );
|
||||||
|
len += strlen( array.str[i] ) + 1;
|
||||||
|
}
|
||||||
|
output( "\n" );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*******************************************************************
|
/*******************************************************************
|
||||||
* get_extension
|
* get_extension
|
||||||
*/
|
*/
|
||||||
|
@ -3323,9 +3348,7 @@ static void output_subdirs( struct makefile *make )
|
||||||
output_filenames( makefile_deps );
|
output_filenames( makefile_deps );
|
||||||
output( ":\n" );
|
output( ":\n" );
|
||||||
output( "distclean::\n");
|
output( "distclean::\n");
|
||||||
output( "\trm -f" );
|
output_rm_filenames( distclean_files );
|
||||||
output_filenames( distclean_files );
|
|
||||||
output( "\n" );
|
|
||||||
strarray_add( &make->phony_targets, "distclean" );
|
strarray_add( &make->phony_targets, "distclean" );
|
||||||
|
|
||||||
if (build_deps.count)
|
if (build_deps.count)
|
||||||
|
|
Loading…
Reference in New Issue