From 00c57ad89a225b840225f83e34d98c9688516944 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Fri, 21 Dec 2018 10:49:17 +0100 Subject: [PATCH] makefiles: Add support for sharing resource files with parent dll. Signed-off-by: Alexandre Julliard --- dlls/dinput8/Makefile.in | 1 + tools/make_makefiles | 1 + tools/makedep.c | 5 ++++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/dlls/dinput8/Makefile.in b/dlls/dinput8/Makefile.in index 53cd0c36778..0ede9f0fb16 100644 --- a/dlls/dinput8/Makefile.in +++ b/dlls/dinput8/Makefile.in @@ -21,4 +21,5 @@ C_SRCS = \ IDL_SRCS = dinput8.idl RC_SRCS = \ + dinput.rc \ version.rc diff --git a/tools/make_makefiles b/tools/make_makefiles index d1fe7f5da7c..455ff9e9641 100755 --- a/tools/make_makefiles +++ b/tools/make_makefiles @@ -404,6 +404,7 @@ sub assign_sources_to_makefiles(@) my $parent = get_parent_makefile( $file ); next unless $parent; preserve_shared_source_files( $makefiles{$file}, $makefiles{$parent}, "C_SRCS" ); + preserve_shared_source_files( $makefiles{$file}, $makefiles{$parent}, "RC_SRCS" ); preserve_shared_source_files( $makefiles{$file}, $makefiles{$parent}, "IDL_SRCS" ); preserve_shared_source_files( $makefiles{$file}, $makefiles{$parent}, "LEX_SRCS" ); preserve_shared_source_files( $makefiles{$file}, $makefiles{$parent}, "BISON_SRCS" ); diff --git a/tools/makedep.c b/tools/makedep.c index 6b631b69022..532ef52d035 100644 --- a/tools/makedep.c +++ b/tools/makedep.c @@ -89,6 +89,7 @@ struct incl_file #define FLAG_GENERATED 0x000001 /* generated file */ #define FLAG_INSTALL 0x000002 /* file to install */ +#define FLAG_PARENTDIR 0x000004 /* file comes from parent dir */ #define FLAG_IDL_PROXY 0x000100 /* generates a proxy (_p.c) file */ #define FLAG_IDL_CLIENT 0x000200 /* generates a client (_c.c) file */ #define FLAG_IDL_SERVER 0x000400 /* generates a server (_s.c) file */ @@ -1351,6 +1352,7 @@ static struct file *open_local_file( const struct makefile *make, const char *pa path = strmake( "%s/%s", make->parent_dir, path ); src_path = root_dir_path( base_dir_path( make, path )); ret = load_file( src_path ); + if (ret) ret->flags |= FLAG_PARENTDIR; } if (ret) *filename = src_dir_path( make, path ); @@ -2447,6 +2449,7 @@ static void output_po_files( const struct makefile *make ) LIST_FOR_EACH_ENTRY( source, &submake->sources, struct incl_file, entry ) { + if (source->file->flags & FLAG_PARENTDIR) continue; if (strendswith( source->name, ".rc" ) && (source->file->flags & FLAG_RC_PO)) { char *pot_file = replace_extension( source->name, ".rc", ".pot" ); @@ -2567,7 +2570,7 @@ static void output_source_rc( struct makefile *make, struct incl_file *source, c output_filename( source->filename ); output( "\n" ); } - if (source->file->flags & FLAG_RC_PO) + if (source->file->flags & FLAG_RC_PO && !(source->file->flags & FLAG_PARENTDIR)) { strarray_add( &make->clean_files, strmake( "%s.pot", obj )); output( "%s.pot: %s\n", obj_dir_path( make, obj ), source->filename );