makefiles: Generate distclean rules from makedep.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Alexandre Julliard 2016-01-11 18:41:18 +09:00
parent da9381cea5
commit ba416a5781
3 changed files with 22 additions and 26 deletions

15
aclocal.m4 vendored
View File

@ -302,11 +302,6 @@ install-dev:: $ac_dir/install-dev"
wine_fn_clean_rules ()
{
ac_clean=$[@]
ac_extraclean="$ac_dir/Makefile"
test "$srcdir" = . && ac_extraclean="$ac_extraclean $ac_dir/.gitignore"
case $ac_dir in
*/tests) ac_extraclean="$ac_extraclean $ac_dir/testlist.c" ;;
esac
if wine_fn_has_flag clean
then
@ -320,24 +315,18 @@ wine_fn_clean_rules ()
fi
wine_fn_append_rule \
"__clean__: $ac_dir/clean
.PHONY: $ac_dir/clean
distclean::
\$(RM) $ac_extraclean"
.PHONY: $ac_dir/clean"
}
wine_fn_disabled_rules ()
{
ac_clean=$[@]
ac_extraclean="$ac_dir/Makefile"
test "$srcdir" = . && ac_extraclean="$ac_extraclean $ac_dir/.gitignore"
wine_fn_append_rule \
"__clean__: $ac_dir/clean
.PHONY: $ac_dir/clean
$ac_dir/clean: dummy
\$(RM) \$(CLEAN_FILES:%=$ac_dir/%) $ac_clean
distclean::
\$(RM) $ac_extraclean"
\$(RM) \$(CLEAN_FILES:%=$ac_dir/%) $ac_clean"
}
wine_fn_config_makefile ()

15
configure vendored
View File

@ -7497,11 +7497,6 @@ install-dev:: $ac_dir/install-dev"
wine_fn_clean_rules ()
{
ac_clean=$@
ac_extraclean="$ac_dir/Makefile"
test "$srcdir" = . && ac_extraclean="$ac_extraclean $ac_dir/.gitignore"
case $ac_dir in
*/tests) ac_extraclean="$ac_extraclean $ac_dir/testlist.c" ;;
esac
if wine_fn_has_flag clean
then
@ -7515,24 +7510,18 @@ wine_fn_clean_rules ()
fi
wine_fn_append_rule \
"__clean__: $ac_dir/clean
.PHONY: $ac_dir/clean
distclean::
\$(RM) $ac_extraclean"
.PHONY: $ac_dir/clean"
}
wine_fn_disabled_rules ()
{
ac_clean=$@
ac_extraclean="$ac_dir/Makefile"
test "$srcdir" = . && ac_extraclean="$ac_extraclean $ac_dir/.gitignore"
wine_fn_append_rule \
"__clean__: $ac_dir/clean
.PHONY: $ac_dir/clean
$ac_dir/clean: dummy
\$(RM) \$(CLEAN_FILES:%=$ac_dir/%) $ac_clean
distclean::
\$(RM) $ac_extraclean"
\$(RM) \$(CLEAN_FILES:%=$ac_dir/%) $ac_clean"
}
wine_fn_config_makefile ()

View File

@ -2843,6 +2843,24 @@ static struct strarray output_sources( const struct makefile *make )
strarray_add( &phony_targets, obj_dir_path( make, "clean" ));
}
if (make->subdirs.count)
{
struct strarray distclean_files = empty_strarray;
for (i = 0; i < make->subdirs.count; i++)
{
strarray_add( &distclean_files, base_dir_path( make->submakes[i], output_makefile_name ));
if (!make->src_dir)
strarray_add( &distclean_files, base_dir_path( make->submakes[i], ".gitignore" ));
if (make->submakes[i]->testdll)
strarray_add( &distclean_files, base_dir_path( make->submakes[i], "testlist.c" ));
}
output( "distclean::\n");
output( "\trm -f" );
output_filenames( distclean_files );
output( "\n" );
strarray_add( &phony_targets, "distclean" );
}
if (phony_targets.count)
{
output( ".PHONY:" );