Alexandre Julliard : makedep: Generate correct dependencies for testlist.c.

Alexandre Julliard julliard at winehq.org
Mon Oct 14 12:39:28 CDT 2013


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon Oct 14 12:12:26 2013 +0200

makedep: Generate correct dependencies for testlist.c.

---

 Make.rules.in   |    5 +--
 tools/makedep.c |   86 ++++++++++++++++++++++++++++++++-----------------------
 2 files changed, 51 insertions(+), 40 deletions(-)

diff --git a/Make.rules.in b/Make.rules.in
index d912bcd..30a72fa 100644
--- a/Make.rules.in
+++ b/Make.rules.in
@@ -4,7 +4,6 @@
 # C_SRCS       : C sources for the module
 # OBJC_SRCS    : Objective-C sources for the module
 # RC_SRCS      : resource source files
-# EXTRA_SRCS   : extra source files for make depend
 # EXTRA_OBJS   : extra object files
 # IMPORTS      : dlls to import
 # DELAYIMPORTS : dlls to import in delayed mode
@@ -147,7 +146,7 @@ $(IMPORTLIB:%=lib%.cross.a): $(MAINSPEC) $(IMPLIB_SRCS:.c=.cross.o)
 DEPEND_SRCS = $(C_SRCS) $(OBJC_SRCS) $(RC_SRCS) $(MC_SRCS) \
               $(IDL_H_SRCS) $(IDL_C_SRCS) $(IDL_I_SRCS) $(IDL_P_SRCS) $(IDL_S_SRCS) \
               $(IDL_GEN_C_SRCS) $(IDL_R_SRCS:.idl=_r.res) $(IDL_TLB_SRCS) $(IDL_TLB_SRCS:.idl=.tlb) \
-              $(BISON_SRCS) $(LEX_SRCS) $(EXTRA_SRCS)
+              $(BISON_SRCS) $(LEX_SRCS) $(EXTRA_OBJS)
 
 depend: dummy
 	$(MAKEDEP) $(MAKEDEPFLAGS) -C$(srcdir) -S$(top_srcdir) -T$(top_builddir) $(EXTRAINCL) $(DEPEND_SRCS)
@@ -171,8 +170,6 @@ $(WINETEST_RES): $(TESTMODULE_STRIPPED)
 testlist.c: Makefile.in $(MAKECTESTS)
 	$(MAKECTESTS) -o $@ $(C_SRCS)
 
-testlist.o testlist.cross.o: testlist.c $(top_srcdir)/include/wine/test.h
-
 testclean::
 	$(RM) *.ok
 
diff --git a/tools/makedep.c b/tools/makedep.c
index 8c5dcd0..498a05d 100644
--- a/tools/makedep.c
+++ b/tools/makedep.c
@@ -810,11 +810,6 @@ static void parse_generated_idl( struct incl_file *source )
         add_include( source, "wine/exception.h", 1 );
         add_include( source, header, 0 );
     }
-    else if (!strcmp( source->name, "dlldata.c" ))
-    {
-        add_include( source, "objbase.h", 1 );
-        add_include( source, "rpcproxy.h", 1 );
-    }
 
     free( header );
     free( basename );
@@ -823,46 +818,68 @@ static void parse_generated_idl( struct incl_file *source )
 /*******************************************************************
  *         parse_file
  */
-static void parse_file( struct incl_file *pFile, int src )
+static void parse_file( struct incl_file *source, int src )
 {
     FILE *file;
 
     /* special case for source files generated from idl */
-    if (strendswith( pFile->name, "_c.c" ) ||
-        strendswith( pFile->name, "_i.c" ) ||
-        strendswith( pFile->name, "_p.c" ) ||
-        strendswith( pFile->name, "_s.c" ) ||
-        !strcmp( pFile->name, "dlldata.c" ))
+    if (strendswith( source->name, "_c.c" ) ||
+        strendswith( source->name, "_i.c" ) ||
+        strendswith( source->name, "_p.c" ) ||
+        strendswith( source->name, "_s.c" ))
+    {
+        parse_generated_idl( source );
+        return;
+    }
+
+    if (!strcmp( source->name, "dlldata.o" ))
+    {
+        source->filename = xstrdup( "dlldata.c" );
+        add_include( source, "objbase.h", 1 );
+        add_include( source, "rpcproxy.h", 1 );
+        return;
+    }
+
+    if (!strcmp( source->name, "testlist.o" ))
     {
-        parse_generated_idl( pFile );
+        source->filename = xstrdup( "testlist.c" );
+        add_include( source, "wine/test.h", 1 );
+        return;
+    }
+
+    if (strendswith( source->name, ".o" ))
+    {
+        /* default to .c for unknown extra object files */
+        source->filename = xstrdup( source->name );
+        source->filename[strlen(source->filename) - 1] = 'c';
         return;
     }
 
     /* don't try to open certain types of files */
-    if (strendswith( pFile->name, ".tlb" ) ||
-        strendswith( pFile->name, ".res" ) ||
-        strendswith( pFile->name, ".x" ))
+    if (strendswith( source->name, ".tlb" ) ||
+        strendswith( source->name, ".res" ) ||
+        strendswith( source->name, ".x" ))
     {
-        pFile->filename = xstrdup( pFile->name );
+        source->filename = xstrdup( source->name );
         return;
     }
 
-    file = src ? open_src_file( pFile ) : open_include_file( pFile );
+    file = src ? open_src_file( source ) : open_include_file( source );
     if (!file) return;
-    input_file_name = pFile->filename;
-
-    if (pFile->sourcename && strendswith( pFile->sourcename, ".idl" ))
-        parse_idl_file( pFile, file, 1 );
-    else if (strendswith( pFile->filename, ".idl" ))
-        parse_idl_file( pFile, file, 0 );
-    else if (strendswith( pFile->filename, ".c" ) ||
-             strendswith( pFile->filename, ".m" ) ||
-             strendswith( pFile->filename, ".h" ) ||
-             strendswith( pFile->filename, ".l" ) ||
-             strendswith( pFile->filename, ".y" ))
-        parse_c_file( pFile, file );
-    else if (strendswith( pFile->filename, ".rc" ))
-        parse_rc_file( pFile, file );
+    input_file_name = source->filename;
+
+    if (source->sourcename && strendswith( source->sourcename, ".idl" ))
+        parse_idl_file( source, file, 1 );
+    else if (strendswith( source->filename, ".idl" ))
+        parse_idl_file( source, file, 0 );
+    else if (strendswith( source->filename, ".c" ) ||
+             strendswith( source->filename, ".m" ) ||
+             strendswith( source->filename, ".h" ) ||
+             strendswith( source->filename, ".l" ) ||
+             strendswith( source->filename, ".y" ))
+        parse_c_file( source, file );
+    else if (strendswith( source->filename, ".rc" ))
+        parse_rc_file( source, file );
     fclose(file);
     input_file_name = NULL;
 }
@@ -1151,11 +1168,8 @@ int main( int argc, char *argv[] )
         free( path );
     }
 
-    for (i = 1; i < argc; i++)
-    {
-        add_src_file( argv[i] );
-        if (strendswith( argv[i], "_p.c" )) add_src_file( "dlldata.c" );
-    }
+    for (i = 1; i < argc; i++) add_src_file( argv[i] );
+
     LIST_FOR_EACH_ENTRY( pFile, &includes, struct incl_file, entry ) parse_file( pFile, 0 );
     output_dependencies();
     return 0;




More information about the wine-cvs mailing list