Alexandre Julliard : makefiles: Generate rules from makedep for running tests.

Alexandre Julliard julliard at winehq.org
Mon Nov 18 14:51:39 CST 2013


Module: wine
Branch: master
Commit: a6fd273a90280d4f24945ff83a5b3f61b6c7f72b
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=a6fd273a90280d4f24945ff83a5b3f61b6c7f72b

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Sat Nov 16 11:57:14 2013 +0100

makefiles: Generate rules from makedep for running tests.

---

 Make.rules.in   |   10 +---------
 Makefile.in     |    2 +-
 configure       |    4 +---
 configure.ac    |    4 +---
 tools/makedep.c |   35 ++++++++++++++++++++++++++---------
 5 files changed, 30 insertions(+), 25 deletions(-)

diff --git a/Make.rules.in b/Make.rules.in
index ed2d8cf..630e598 100644
--- a/Make.rules.in
+++ b/Make.rules.in
@@ -32,10 +32,7 @@ ALLCROSSCFLAGS = $(INCLUDES) $(DEFS) -DWINE_CROSSTEST $(CPPFLAGS) $(CFLAGS)
 
 # Implicit rules
 
-.SUFFIXES: .ok .man.in .man @MAINTAINER_MODE@ .sfd .ttf .svg .ico .bmp
-
-.c.ok:
-	$(RUNTEST) $(RUNTESTFLAGS) $< && touch $@
+.SUFFIXES: .man.in .man @MAINTAINER_MODE@ .sfd .ttf .svg .ico .bmp
 
 .sfd.ttf:
 	$(FONTFORGE) -script $(top_srcdir)/fonts/genttf.ff $< $@
@@ -106,11 +103,6 @@ $(CROSSTESTMODULE): $(CROSSOBJS) Makefile.in
 $(WINETEST_RES): $(TESTMODULE_STRIPPED)
 	echo "$(TESTMODULE) TESTRES \"$(TESTMODULE_STRIPPED)\"" | $(WRC) $(RCFLAGS) -o $@
 
-testclean::
-	$(RM) *.ok
-
-.PHONY: check test testclean
-
 # Rules for man pages
 
 MANPAGES = $(MANPAGE) $(EXTRA_MANPAGES)
diff --git a/Makefile.in b/Makefile.in
index d54fc21..045d708 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -58,7 +58,7 @@ uninstall:: __uninstall__
 # dependencies needed to build any dll or program
 __tooldeps__: libs/port libs/wine libs/wpp
 __builddeps__: __tooldeps__ include
-.PHONY: test crosstest __tooldeps__ __builddeps__
+.PHONY: check test testclean crosstest __tooldeps__ __builddeps__
 
 loader server: libs/port libs/wine tools
 fonts: tools
diff --git a/configure b/configure
index 3942d45..a66ba62 100755
--- a/configure
+++ b/configure
@@ -16161,9 +16161,7 @@ all: \$(TESTMODULE)$DLLEXT \$(WINETEST_RES)
 
 \$(C_SRCS:.c=.ok): \$(TESTMODULE)$DLLEXT \$(TESTDLL:%=../%$DLLEXT)
 
-check test: \$(C_SRCS:.c=.ok)
-
-.PHONY: check test crosstest
+.PHONY: check test testclean crosstest
 "
 
 if test -n "$CROSSTARGET"
diff --git a/configure.ac b/configure.ac
index 106377e..35accb2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2647,9 +2647,7 @@ all: \$(TESTMODULE)$DLLEXT \$(WINETEST_RES)
 
 \$(C_SRCS:.c=.ok): \$(TESTMODULE)$DLLEXT \$(TESTDLL:%=../%$DLLEXT)
 
-check test: \$(C_SRCS:.c=.ok)
-
-.PHONY: check test crosstest
+.PHONY: check test testclean crosstest
 ")
 if test -n "$CROSSTARGET"
 then
diff --git a/tools/makedep.c b/tools/makedep.c
index 3b441be..cd0b573 100644
--- a/tools/makedep.c
+++ b/tools/makedep.c
@@ -1149,6 +1149,7 @@ static void output_sources(void)
     struct incl_file *source;
     struct strarray clean_files;
     int i, column, po_srcs = 0, mc_srcs = 0;
+    int is_test = find_src_file( "testlist.o" ) != NULL;
 
     strarray_init( &clean_files );
 
@@ -1247,12 +1248,12 @@ static void output_sources(void)
         }
         else
         {
-            struct object_extension *ext;
-            LIST_FOR_EACH_ENTRY( ext, &object_extensions, struct object_extension, entry )
+            struct object_extension *obj_ext;
+            LIST_FOR_EACH_ENTRY( obj_ext, &object_extensions, struct object_extension, entry )
             {
-                strarray_add( &clean_files, strmake( "%s.%s", obj, ext->extension ));
-                output( "%s.%s: %s\n", obj, ext->extension, source->filename );
-                if (strstr( ext->extension, "cross" ))
+                strarray_add( &clean_files, strmake( "%s.%s", obj, obj_ext->extension ));
+                output( "%s.%s: %s\n", obj, obj_ext->extension, source->filename );
+                if (strstr( obj_ext->extension, "cross" ))
                     output( "\t$(CROSSCC) -c $(ALLCROSSCFLAGS) -o $@ %s\n", source->filename );
                 else
                     output( "\t$(CC) -c $(ALLCFLAGS) -o $@ %s\n", source->filename );
@@ -1263,8 +1264,13 @@ static void output_sources(void)
                 output( "%s.cross.o: %s\n", obj, source->filename );
                 output( "\t$(CROSSCC) -c $(ALLCROSSCFLAGS) -o $@ %s\n", source->filename );
             }
-            LIST_FOR_EACH_ENTRY( ext, &object_extensions, struct object_extension, entry )
-                column += output( "%s.%s ", obj, ext->extension );
+            if (is_test && !strcmp( ext, "c" ) && !is_generated_idl( source ))
+            {
+                output( "%s.ok:\n", obj );
+                output( "\t$(RUNTEST) $(RUNTESTFLAGS) %s && touch $@\n", obj );
+            }
+            LIST_FOR_EACH_ENTRY( obj_ext, &object_extensions, struct object_extension, entry )
+                column += output( "%s.%s ", obj, obj_ext->extension );
             if (source->flags & FLAG_C_IMPLIB) column += output( "%s.cross.o", obj );
             column += output( ":" );
         }
@@ -1313,13 +1319,24 @@ static void output_sources(void)
         strarray_add( &clean_files, "dlldata.c" );
     }
 
-    if (find_src_file( "testlist.o" ))
+    if (is_test)
     {
         output( "testlist.c: $(MAKECTESTS) Makefile.in\n" );
         column = output( "\t$(MAKECTESTS) -o $@" );
         LIST_FOR_EACH_ENTRY( source, &sources, struct incl_file, entry )
             if (strendswith( source->name, ".c" ) && !is_generated_idl( source ))
-                output_filename( source->filename, &column );
+                output_filename( source->name, &column );
+        output( "\n" );
+        column = output( "check test:" );
+        LIST_FOR_EACH_ENTRY( source, &sources, struct incl_file, entry )
+            if (strendswith( source->name, ".c" ) && !is_generated_idl( source ))
+                output_filename( replace_extension( source->name, 2, ".ok" ), &column );
+        output( "\n" );
+        output( "clean testclean::\n" );
+        column = output( "\t$(RM)" );
+        LIST_FOR_EACH_ENTRY( source, &sources, struct incl_file, entry )
+            if (strendswith( source->name, ".c" ) && !is_generated_idl( source ))
+                output_filename( replace_extension( source->name, 2, ".ok" ), &column );
         output( "\n" );
         strarray_add( &clean_files, "testlist.c" );
     }




More information about the wine-cvs mailing list