From: Rémi Bernon rbernon@codeweavers.com
--- tools/makedep.c | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-)
diff --git a/tools/makedep.c b/tools/makedep.c index 8fa539026ca..ddb091e2dc2 100644 --- a/tools/makedep.c +++ b/tools/makedep.c @@ -97,9 +97,10 @@ struct incl_file #define FLAG_IDL_HEADER 0x008000 /* generates a header (.h) file */ #define FLAG_RC_PO 0x010000 /* rc file contains translations */ #define FLAG_RC_HEADER 0x020000 /* rc file is a header */ -#define FLAG_C_IMPLIB 0x040000 /* file is part of an import library */ -#define FLAG_C_UNIX 0x080000 /* file is part of a Unix library */ -#define FLAG_SFD_FONTS 0x100000 /* sfd file generated bitmap fonts */ +#define FLAG_RC_TESTDLL 0x040000 /* rc file is for a test dll */ +#define FLAG_C_IMPLIB 0x080000 /* file is part of an import library */ +#define FLAG_C_UNIX 0x100000 /* file is part of a Unix library */ +#define FLAG_SFD_FONTS 0x200000 /* sfd file generated bitmap fonts */
static const struct { @@ -938,6 +939,7 @@ static void parse_pragma_directive( struct file *source, char *str ) { if (!strcmp( flag, "header" )) source->flags |= FLAG_RC_HEADER; else if (!strcmp( flag, "po" )) source->flags |= FLAG_RC_PO; + else if (!strcmp( flag, "testdll" )) source->flags |= FLAG_RC_TESTDLL; } else if (strendswith( source->name, ".sfd" )) { @@ -2710,8 +2712,14 @@ static void output_source_rc( struct makefile *make, struct incl_file *source, c if (source->file->flags & FLAG_RC_HEADER) return; if (source->file->flags & FLAG_GENERATED) strarray_add( &make->clean_files, source->name ); if (linguas.count && (source->file->flags & FLAG_RC_PO)) po_dir = "po"; - for (arch = 0; arch < archs.count; arch++) - if (!make->disabled[arch]) strarray_add( &make->res_files[arch], res_file ); + if (!(source->file->flags & FLAG_RC_TESTDLL)) + { + for (arch = 0; arch < archs.count; arch++) + { + if (make->disabled[arch]) continue; + strarray_add( &make->res_files[arch], res_file ); + } + } if (source->file->flags & FLAG_RC_PO) { strarray_add( &make->pot_files, strmake( "%s.pot", obj )); @@ -3036,11 +3044,11 @@ static void output_source_in( struct makefile *make, struct incl_file *source, c */ static void output_source_spec( struct makefile *make, struct incl_file *source, const char *obj ) { + const char *dll_name, *obj_name, *res_name, *output_file, *debug_file, *output_rsrc; struct strarray imports = get_expanded_file_local_var( make, obj, "IMPORTS" ); struct strarray dll_flags = empty_strarray; struct strarray default_imports = empty_strarray; struct strarray all_libs, dep_libs; - const char *dll_name, *obj_name, *res_name, *output_file, *debug_file; unsigned int arch;
if (!imports.count) imports = make->imports; @@ -3057,12 +3065,15 @@ static void output_source_spec( struct makefile *make, struct incl_file *source, if (!arch) strarray_addall( &all_libs, libs ); dll_name = arch_module_name( strmake( "%s.dll", obj ), arch ); obj_name = obj_dir_path( make, strmake( "%s%s.o", arch_dirs[arch], obj )); - res_name = strmake( "%s%s.res", arch_dirs[arch], obj ); output_file = obj_dir_path( make, dll_name ); + output_rsrc = strmake( "%s.res", dll_name ); + + if (!find_src_file( make, strmake( "%s.rc", obj ))) res_name = NULL; + else res_name = obj_dir_path( make, strmake( "%s.res", obj ));
strarray_add( &make->clean_files, dll_name ); - strarray_add( &make->res_files[arch], res_name ); - output( "%s:", obj_dir_path( make, res_name )); + strarray_add( &make->res_files[arch], output_rsrc ); + output( "%s:", obj_dir_path( make, output_rsrc )); output_filename( output_file ); output_filename( tools_path( make, "wrc" )); output( "\n" ); @@ -3072,6 +3083,7 @@ static void output_source_spec( struct makefile *make, struct incl_file *source, output( "%s:", output_file ); output_filename( source->filename ); output_filename( obj_name ); + if (res_name) output_filename( res_name ); output_filenames( dep_libs ); output_filename( tools_path( make, "winebuild" )); output_filename( tools_path( make, "winegcc" )); @@ -3083,6 +3095,7 @@ static void output_source_spec( struct makefile *make, struct incl_file *source, output_filename( "-shared" ); output_filename( source->filename ); output_filename( obj_name ); + if (res_name) output_filename( res_name ); if ((debug_file = get_debug_file( make, dll_name, arch ))) output_filename( strmake( "-Wl,--debug-file,%s", obj_dir_path( make, debug_file ))); output_filenames( all_libs );