Alexandre Julliard : makedep: Automatically add the source idl for generated sources to the dependencies list .
Alexandre Julliard
julliard at winehq.org
Wed Oct 16 14:25:49 CDT 2013
Module: wine
Branch: master
Commit: b9cb6d4f956dc8ff0c74dc38d43e12d5a8cda5aa
URL: http://source.winehq.org/git/wine.git/?a=commit;h=b9cb6d4f956dc8ff0c74dc38d43e12d5a8cda5aa
Author: Alexandre Julliard <julliard at winehq.org>
Date: Tue Oct 15 13:15:06 2013 +0200
makedep: Automatically add the source idl for generated sources to the dependencies list.
---
Make.rules.in | 3 +-
tools/makedep.c | 85 +++++++++++++++++++++++++++++++++++--------------------
2 files changed, 55 insertions(+), 33 deletions(-)
diff --git a/Make.rules.in b/Make.rules.in
index cc04821..94c2e83 100644
--- a/Make.rules.in
+++ b/Make.rules.in
@@ -100,8 +100,7 @@ $(IMPORTLIB:%=lib%.cross.a): $(MAINSPEC) $(IMPLIB_SRCS:.c=.cross.o)
# Rules for dependencies
DEPEND_SRCS = $(C_SRCS) $(OBJC_SRCS) $(RC_SRCS) $(MC_SRCS) $(PO_SRCS:.rc=.pot) \
- $(IDL_H_SRCS) $(IDL_C_SRCS) $(IDL_I_SRCS) $(IDL_P_SRCS) $(IDL_R_SRCS) $(IDL_S_SRCS) \
- $(IDL_GEN_C_SRCS) $(IDL_R_SRCS:.idl=_r.res) $(IDL_TLB_SRCS) $(IDL_TLB_SRCS:.idl=.tlb) \
+ $(IDL_H_SRCS) $(IDL_GEN_C_SRCS) $(IDL_R_SRCS:.idl=_r.res) $(IDL_TLB_SRCS:.idl=.tlb) \
$(BISON_SRCS) $(LEX_SRCS) $(EXTRA_OBJS)
depend: dummy
diff --git a/tools/makedep.c b/tools/makedep.c
index ea23318..982d827 100644
--- a/tools/makedep.c
+++ b/tools/makedep.c
@@ -832,39 +832,8 @@ static void parse_file( struct incl_file *source, int src )
{
FILE *file;
- /* special case for source files generated from idl */
- if (is_generated_idl( source ))
- {
- 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" ))
- {
- 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 = replace_extension( source->name, 2, ".c" );
- return;
- }
-
/* don't try to open certain types of files */
if (strendswith( source->name, ".tlb" ) ||
- strendswith( source->name, ".res" ) ||
- strendswith( source->name, ".pot" ) ||
strendswith( source->name, ".x" ))
{
source->filename = xstrdup( source->name );
@@ -900,14 +869,68 @@ static void parse_file( struct incl_file *source, int src )
static struct incl_file *add_src_file( const char *name )
{
struct incl_file *file;
+ char *idl;
if (find_src_file( name )) return NULL; /* we already have it */
file = xmalloc( sizeof(*file) );
memset( file, 0, sizeof(*file) );
file->name = xstrdup(name);
list_add_tail( &sources, &file->entry );
+
+ /* special cases for generated files */
+
+ if (is_generated_idl( file ))
+ {
+ parse_generated_idl( file );
+ goto add_idl_source;
+ }
+
+ if (!strcmp( file->name, "dlldata.o" ))
+ {
+ file->filename = xstrdup( "dlldata.c" );
+ add_include( file, "objbase.h", 1 );
+ add_include( file, "rpcproxy.h", 1 );
+ return file;
+ }
+
+ if (!strcmp( file->name, "testlist.o" ))
+ {
+ file->filename = xstrdup( "testlist.c" );
+ add_include( file, "wine/test.h", 1 );
+ return file;
+ }
+
+ if (strendswith( file->name, ".o" ))
+ {
+ /* default to .c for unknown extra object files */
+ file->filename = replace_extension( file->name, 2, ".c" );
+ return file;
+ }
+
+ if (strendswith( file->name, ".tlb" ) ||
+ strendswith( file->name, "_r.res" ) ||
+ strendswith( file->name, "_t.res" ))
+ {
+ file->filename = xstrdup( file->name );
+ goto add_idl_source;
+ }
+
+ if (strendswith( file->name, ".res" ) ||
+ strendswith( file->name, ".pot" ) ||
+ strendswith( file->name, ".x" ))
+ {
+ file->filename = xstrdup( file->name );
+ return file;
+ }
+
parse_file( file, 1 );
return file;
+
+add_idl_source:
+ idl = replace_extension( name, strendswith( name, ".res" ) ? 6 : 4, ".idl" );
+ add_src_file( idl );
+ free( idl );
+ return file;
}
More information about the wine-cvs
mailing list