From: Rémi Bernon rbernon@codeweavers.com
--- tools/makedep.c | 37 +++++++++++++++++++++++++++---------- tools/wrc/parser.y | 4 +++- 2 files changed, 30 insertions(+), 11 deletions(-)
diff --git a/tools/makedep.c b/tools/makedep.c index e8ffd2c8395..b564b53ea30 100644 --- a/tools/makedep.c +++ b/tools/makedep.c @@ -347,6 +347,16 @@ static void output( const char *format, ... ) }
+/******************************************************************* + * cmd_prefix + */ +static const char *cmd_prefix( const char *cmd ) +{ + if (!silent_rules) return ""; + return strmake( "$(quiet_%s)", cmd ); +} + + /******************************************************************* * strarray_get_value * @@ -2423,16 +2433,6 @@ static const char *get_debug_file( struct makefile *make, const char *name, unsi }
-/******************************************************************* - * cmd_prefix - */ -static const char *cmd_prefix( const char *cmd ) -{ - if (!silent_rules) return ""; - return strmake( "$(quiet_%s)", cmd ); -} - - /******************************************************************* * output_winegcc_command */ @@ -3627,11 +3627,28 @@ static void output_test_module( struct makefile *make, unsigned int arch ) struct strarray dep_libs = empty_strarray; struct strarray all_libs = empty_strarray; struct makefile *parent = get_parent_makefile( make ); + struct incl_file *source; const char *debug_file; unsigned int link_arch;
if (!get_link_arch( make, arch, &link_arch )) return;
+ LIST_FOR_EACH_ENTRY( source, &make->sources, struct incl_file, entry ) + { + const char *output_rsrc; + if (source->file->flags & FLAG_GENERATED) continue; + + output_rsrc = strmake( "%s%s.res", arch_dirs[arch], source->name ); + strarray_add( &make->res_files[arch], output_rsrc ); + output( "%s:", obj_dir_path( make, output_rsrc ) ); + output_filename( source->filename ); + output_filename( tools_path( make, "wrc" )); + output( "\n" ); + + output( "\t%secho "%s TESTSRC \"%s\"" | %s -u -o $@\n", cmd_prefix( "WRC" ), source->name, + source->filename, tools_path( make, "wrc" ) ); + } + strarray_addall( &all_libs, add_import_libs( make, &dep_libs, make->imports, IMPORT_TYPE_DIRECT, arch ) ); strarray_addall( &all_libs, add_import_libs( make, &dep_libs, default_imports, IMPORT_TYPE_DEFAULT, arch ) );
diff --git a/tools/wrc/parser.y b/tools/wrc/parser.y index 6b362b06b6b..94986435bee 100644 --- a/tools/wrc/parser.y +++ b/tools/wrc/parser.y @@ -2152,7 +2152,9 @@ static raw_data_t *load_file(string_t *filename, language_t lang) name = convert_string_utf8( filename, 0 ); else name = xstrdup( filename->str.cstr ); - if (!(path = wpp_find_include(name, input_name))) + if (*name == '/') + path = xstrdup( name ); + else if (!(path = wpp_find_include(name, input_name))) yyerror("Cannot open file %s", name); if (!(fp = fopen( path, "rb" ))) yyerror("Cannot open file %s", name);