Alexandre Julliard : makefiles: Generate the top-level test rules from makedep.

Alexandre Julliard julliard at winehq.org
Thu Feb 22 15:07:47 CST 2018


Module: wine
Branch: master
Commit: 2b59daf32608902f5f0450aeb0719504884cdc72
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=2b59daf32608902f5f0450aeb0719504884cdc72

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Thu Feb 22 17:32:35 2018 +0100

makefiles: Generate the top-level test rules from makedep.

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 aclocal.m4      | 18 +-----------------
 configure       | 18 +-----------------
 tools/makedep.c | 25 +++++++++++++++++++++++++
 3 files changed, 27 insertions(+), 34 deletions(-)

diff --git a/aclocal.m4 b/aclocal.m4
index 4fc6cd4..830ec2f 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -309,23 +309,7 @@ wine_fn_config_test ()
 
     wine_fn_append_file ALL_TEST_RESOURCES $ac_name.res
     wine_fn_all_rules
-
-    wine_fn_append_rule \
-"$ac_dir: __builddeps__
-programs/winetest: $ac_dir
-check test: $ac_dir/test
-.PHONY: $ac_dir/test
-$ac_dir/test: dummy
-	@cd $ac_dir && \$(MAKE) test"
-
-        if test -n "$CROSSTARGET"
-        then
-            wine_fn_append_rule \
-"crosstest: $ac_dir/crosstest
-.PHONY: $ac_dir/crosstest
-$ac_dir/crosstest: __builddeps__ dummy
-	@cd $ac_dir && \$(MAKE) crosstest"
-        fi
+    wine_fn_append_rule "$ac_dir: __builddeps__"
 }
 
 wine_fn_config_tool ()
diff --git a/configure b/configure
index 6c09a96..4dae327 100755
--- a/configure
+++ b/configure
@@ -7816,23 +7816,7 @@ fi
 
     wine_fn_append_file ALL_TEST_RESOURCES $ac_name.res
     wine_fn_all_rules
-
-    wine_fn_append_rule \
-"$ac_dir: __builddeps__
-programs/winetest: $ac_dir
-check test: $ac_dir/test
-.PHONY: $ac_dir/test
-$ac_dir/test: dummy
-	@cd $ac_dir && \$(MAKE) test"
-
-        if test -n "$CROSSTARGET"
-        then
-            wine_fn_append_rule \
-"crosstest: $ac_dir/crosstest
-.PHONY: $ac_dir/crosstest
-$ac_dir/crosstest: __builddeps__ dummy
-	@cd $ac_dir && \$(MAKE) crosstest"
-        fi
+    wine_fn_append_rule "$ac_dir: __builddeps__"
 }
 
 wine_fn_config_tool ()
diff --git a/tools/makedep.c b/tools/makedep.c
index b9f1948..a0b7ff5 100644
--- a/tools/makedep.c
+++ b/tools/makedep.c
@@ -3406,6 +3406,8 @@ static void output_subdirs( struct makefile *make )
     struct strarray testclean_files = empty_strarray;
     struct strarray distclean_files = empty_strarray;
     struct strarray tools_deps = empty_strarray;
+    struct strarray winetest_deps = empty_strarray;
+    struct strarray crosstest_deps = empty_strarray;
     unsigned int i, j;
 
     strarray_add( &tools_deps, tools_dir_path( make, "widl" ));
@@ -3483,6 +3485,20 @@ static void output_subdirs( struct makefile *make )
         }
 
         if (submake->disabled) continue;
+        if (submake->testdll)
+        {
+            output( "check test::\n" );
+            output( "\t at cd %s && $(MAKE) test\n", subdir );
+            strarray_add( &winetest_deps, subdir );
+            if (crosstarget)
+            {
+                char *target = base_dir_path( submake, "crosstest" );
+                output( "crosstest: %s\n", target );
+                output( "%s: __builddeps__ dummy\n", target );
+                output( "\t at cd %s && $(MAKE) crosstest\n", subdir );
+                strarray_add( &crosstest_deps, target );
+            }
+        }
         if (submake->install_rules[INSTALL_LIB].count)
         {
             output( "install install-lib:: %s\n", submake->base_dir );
@@ -3499,14 +3515,23 @@ static void output_subdirs( struct makefile *make )
     output( "\n" );
     output_filenames( makefile_deps );
     output( ":\n" );
+    output( "programs/winetest:" );
+    output_filenames( winetest_deps );
+    output( "\n" );
+    output( "crosstest:" );
+    output_filenames( crosstest_deps );
+    output( "\n" );
     output( "clean::\n");
     output_rm_filenames( clean_files );
     output( "testclean::\n");
     output_rm_filenames( testclean_files );
     output( "distclean::\n");
     output_rm_filenames( distclean_files );
+    strarray_add( &make->phony_targets, "check" );
+    strarray_add( &make->phony_targets, "test" );
     strarray_add( &make->phony_targets, "distclean" );
     strarray_add( &make->phony_targets, "testclean" );
+    strarray_addall( &make->phony_targets, crosstest_deps );
 
     strarray_addall( &make->clean_files, symlinks );
     strarray_addall( &build_deps, symlinks );




More information about the wine-cvs mailing list