Alexandre Julliard : makefiles: Generate the testclean rule using the subdirs file lists.
Alexandre Julliard
julliard at winehq.org
Tue Feb 20 16:44:52 CST 2018
Module: wine
Branch: master
Commit: 3e6c12e7a9ce9e703cf321f7b4b17ebe0a6ef4e4
URL: https://source.winehq.org/git/wine.git/?a=commit;h=3e6c12e7a9ce9e703cf321f7b4b17ebe0a6ef4e4
Author: Alexandre Julliard <julliard at winehq.org>
Date: Mon Feb 19 21:10:14 2018 +0100
makefiles: Generate the testclean rule using the subdirs file lists.
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
aclocal.m4 | 4 +---
configure | 4 +---
tools/makedep.c | 13 +++++++++++--
3 files changed, 13 insertions(+), 8 deletions(-)
diff --git a/aclocal.m4 b/aclocal.m4
index 2c11de0..0c4356a 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -542,9 +542,7 @@ programs/winetest: $ac_dir
check test: $ac_dir/test
.PHONY: $ac_dir/test
$ac_dir/test: dummy
- @cd $ac_dir && \$(MAKE) test
-testclean::
- \$(RM) $ac_dir/*.ok"
+ @cd $ac_dir && \$(MAKE) test"
if test -n "$CROSSTARGET"
then
diff --git a/configure b/configure
index 74935d8..cbd451f 100755
--- a/configure
+++ b/configure
@@ -8037,9 +8037,7 @@ programs/winetest: $ac_dir
check test: $ac_dir/test
.PHONY: $ac_dir/test
$ac_dir/test: dummy
- @cd $ac_dir && \$(MAKE) test
-testclean::
- \$(RM) $ac_dir/*.ok"
+ @cd $ac_dir && \$(MAKE) test"
if test -n "$CROSSTARGET"
then
diff --git a/tools/makedep.c b/tools/makedep.c
index 779d60a..e2e24b9 100644
--- a/tools/makedep.c
+++ b/tools/makedep.c
@@ -3326,8 +3326,9 @@ static void output_subdirs( struct makefile *make )
{
struct strarray build_deps = empty_strarray;
struct strarray makefile_deps = empty_strarray;
+ struct strarray testclean_files = empty_strarray;
struct strarray distclean_files = get_expanded_make_var_array( make, "CONFIGURE_TARGETS" );
- unsigned int i;
+ unsigned int i, j;
strarray_add( &distclean_files, obj_dir_path( make, output_makefile_name ));
if (!make->src_dir) strarray_add( &distclean_files, obj_dir_path( make, ".gitignore" ));
@@ -3339,7 +3340,12 @@ static void output_subdirs( struct makefile *make )
strmake ( "%s.in", output_makefile_name ))));
strarray_add( &distclean_files, base_dir_path( submake, output_makefile_name ));
if (!make->src_dir) strarray_add( &distclean_files, base_dir_path( submake, ".gitignore" ));
- if (submake->testdll) strarray_add( &distclean_files, base_dir_path( submake, "testlist.c" ));
+ if (submake->testdll)
+ {
+ for (j = 0; j < submake->ok_files.count; j++)
+ strarray_add( &testclean_files, base_dir_path( submake, submake->ok_files.str[j] ));
+ strarray_add( &distclean_files, base_dir_path( submake, "testlist.c" ));
+ }
strarray_addall( &build_deps, output_importlib_symlinks( make, submake ));
}
output( "Makefile:" );
@@ -3347,9 +3353,12 @@ static void output_subdirs( struct makefile *make )
output( "\n" );
output_filenames( makefile_deps );
output( ":\n" );
+ output( "testclean::\n");
+ output_rm_filenames( testclean_files );
output( "distclean::\n");
output_rm_filenames( distclean_files );
strarray_add( &make->phony_targets, "distclean" );
+ strarray_add( &make->phony_targets, "testclean" );
if (build_deps.count)
{
More information about the wine-cvs
mailing list