makefiles: Look in the extra targets for dependencies.

Signed-off-by: Alexandre Julliard <julliard@winehq.org>
oldstable
Alexandre Julliard 2018-11-30 13:09:12 +01:00
parent 364f97c2e1
commit cb078bd3bf
3 changed files with 15 additions and 4 deletions

View File

@ -21,12 +21,10 @@ EXTRA_TARGETS = build.nfo
INSTALL_LIB = none
build.rc: dummy
build="BUILD_INFO STRINGRES build.nfo STRINGTABLE { 1 \"`GIT_DIR=$(top_srcdir)/.git git rev-parse HEAD 2>/dev/null`\" }" && (echo $$build | cmp -s - $@) || echo $$build >$@ || ($(RM) $@ && exit 1)
build="STRINGTABLE { 1 \"`GIT_DIR=$(top_srcdir)/.git git rev-parse HEAD 2>/dev/null`\" }" && (echo $$build | cmp -s - $@) || echo $$build >$@ || (rm -f $@ && exit 1)
build.nfo:
-$(CC) -v 2>$@
build.res: build.nfo
dummy:
.PHONY: dummy

View File

@ -90,3 +90,6 @@ END
/* @makedep: winetest.ico */
IDI_WINE ICON "winetest.ico"
/* @makedep: build.nfo */
BUILD_INFO STRINGRES "build.nfo"

View File

@ -170,6 +170,7 @@ struct makefile
struct strarray extradllflags;
struct strarray install_lib;
struct strarray install_dev;
struct strarray extra_targets;
struct list sources;
struct list includes;
const char *base_dir;
@ -1433,6 +1434,14 @@ static struct file *open_include_file( const struct makefile *make, struct incl_
return file;
}
/* check for extra targets */
if (strarray_exists( &make->extra_targets, pFile->name ))
{
pFile->sourcename = filename;
pFile->filename = obj_dir_path( make, pFile->name );
return NULL;
}
/* now try in source dir */
if ((file = open_local_file( make, pFile->name, &pFile->filename ))) return file;
@ -3740,7 +3749,7 @@ static void output_sources( struct makefile *make )
strarray_addall( &make->clean_files, make->object_files );
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" ));
strarray_addall( &make->clean_files, make->extra_targets );
if (make->clean_files.count)
{
@ -4044,6 +4053,7 @@ static void load_sources( struct makefile *make )
make->extradllflags = get_expanded_make_var_array( make, "EXTRADLLFLAGS" );
make->install_lib = get_expanded_make_var_array( make, "INSTALL_LIB" );
make->install_dev = get_expanded_make_var_array( make, "INSTALL_DEV" );
make->extra_targets = get_expanded_make_var_array( make, "EXTRA_TARGETS" );
if (make->module && strendswith( make->module, ".a" )) make->staticlib = make->module;