Alexandre Julliard : makefiles: Generate dummy dependencies for header files.
Alexandre Julliard
julliard at winehq.org
Mon Mar 5 16:14:31 CST 2018
Module: wine
Branch: master
Commit: 51b57133c79ddc8787df37ebea22550cb42f6625
URL: https://source.winehq.org/git/wine.git/?a=commit;h=51b57133c79ddc8787df37ebea22550cb42f6625
Author: Alexandre Julliard <julliard at winehq.org>
Date: Mon Mar 5 00:20:57 2018 +0100
makefiles: Generate dummy dependencies for header files.
This allows building when a header file is removed.
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
tools/makedep.c | 23 ++++++++++++++++++++---
1 file changed, 20 insertions(+), 3 deletions(-)
diff --git a/tools/makedep.c b/tools/makedep.c
index 57adf0b..c9ab24d 100644
--- a/tools/makedep.c
+++ b/tools/makedep.c
@@ -200,6 +200,7 @@ struct makefile
struct strarray implib_objs;
struct strarray all_targets;
struct strarray phony_targets;
+ struct strarray dependencies;
struct strarray install_rules[NB_INSTALL_RULES];
};
@@ -426,6 +427,17 @@ static void strarray_add_uniq( struct strarray *array, const char *str )
/*******************************************************************
+ * strarray_addall_uniq
+ */
+static void strarray_addall_uniq( struct strarray *array, struct strarray added )
+{
+ unsigned int i;
+
+ for (i = 0; i < added.count; i++) strarray_add_uniq( array, added.str[i] );
+}
+
+
+/*******************************************************************
* strarray_get_value
*
* Find a value in a name/value pair string array.
@@ -3643,7 +3655,7 @@ static void output_sources( struct makefile *make )
if (!strcmp( ext, output_source_funcs[j].ext )) break;
output_source_funcs[j].fn( make, source, obj );
- free( obj );
+ strarray_addall_uniq( &make->dependencies, source->dependencies );
}
/* special case for winetest: add resource files from other test dirs */
@@ -3705,9 +3717,14 @@ static void output_sources( struct makefile *make )
output_uninstall_rules( make );
}
+ if (make->dependencies.count)
+ {
+ output_filenames( make->dependencies );
+ output( ":\n" );
+ }
+
strarray_addall( &make->clean_files, make->object_files );
- for (i = 0; i < make->crossobj_files.count; i++)
- strarray_add_uniq( &make->clean_files, make->crossobj_files.str[i] );
+ strarray_addall_uniq( &make->clean_files, make->crossobj_files );
strarray_addall( &make->clean_files, make->all_targets );
strarray_addall( &make->clean_files, get_expanded_make_var_array( make, "EXTRA_TARGETS" ));
More information about the wine-cvs
mailing list