Signed-off-by: Eric Pouech eric.pouech@gmail.com
--- tools/makedep.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/tools/makedep.c b/tools/makedep.c index d5b30b606b8..6f94dc4da1d 100644 --- a/tools/makedep.c +++ b/tools/makedep.c @@ -2951,6 +2951,8 @@ static void output_source_spec( struct makefile *make, struct incl_file *source, { struct strarray imports = get_expanded_file_local_var( make, obj, "IMPORTS" ); struct strarray dll_flags = get_expanded_file_local_var( make, obj, "EXTRADLLFLAGS" ); + unsigned is_exe = strarray_exists( &dll_flags, "-mconsole" ) || + strarray_exists( &dll_flags, "-mwindows" ); struct strarray all_libs, dep_libs = empty_strarray; char *dll_name, *obj_name, *output_file; const char *debug_file; @@ -2960,7 +2962,7 @@ static void output_source_spec( struct makefile *make, struct incl_file *source, if (!strarray_exists( &dll_flags, "-nodefaultlibs" )) imports = add_default_imports( make, imports );
all_libs = add_import_libs( make, &dep_libs, imports, 0, make->is_cross ); - dll_name = strmake( "%s.dll%s", obj, make->is_cross ? "" : dll_ext ); + dll_name = strmake( "%s.%s%s", obj, is_exe ? "exe" : "dll", make->is_cross ? "" : dll_ext ); obj_name = strmake( "%s%s", obj_dir_path( make, obj ), make->is_cross ? ".cross.o" : ".o" ); output_file = obj_dir_path( make, dll_name );
@@ -2970,8 +2972,8 @@ static void output_source_spec( struct makefile *make, struct incl_file *source, output_filename( obj_dir_path( make, dll_name )); output_filename( tools_path( make, "wrc" )); output( "\n" ); - output( "\t%secho "%s.dll TESTDLL \"%s\"" | %s -u -o $@\n", cmd_prefix( "WRC" ), obj, output_file, - tools_path( make, "wrc" )); + output( "\t%secho "%s.%s TESTDLL \"%s\"" | %s -u -o $@\n", cmd_prefix( "WRC" ), obj, + is_exe ? "exe" : "dll", output_file, tools_path( make, "wrc" ));
output( "%s:", output_file); output_filename( source->filename ); @@ -2983,7 +2985,7 @@ static void output_source_spec( struct makefile *make, struct incl_file *source, output_winegcc_command( make, make->is_cross ); output_filename( "-s" ); output_filenames( dll_flags ); - output_filename( "-shared" ); + if (!is_exe) output_filename( "-shared" ); output_filename( source->filename ); output_filename( obj_name ); if ((debug_file = get_debug_file( make, dll_name )))