From 431b6459989569a032ee50fe71b101c6aeacce5c Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Sun, 4 Mar 2018 22:27:23 +0100 Subject: [PATCH] makefiles: Generate the tools dependencies from makedep. Signed-off-by: Alexandre Julliard --- Makefile.in | 13 +++---------- aclocal.m4 | 9 +-------- configure | 13 ++++--------- configure.ac | 4 +++- tools/makedep.c | 32 ++++++++++++++++++++++++++++++++ 5 files changed, 43 insertions(+), 28 deletions(-) diff --git a/Makefile.in b/Makefile.in index 791bb847967..6b65fdfb8c0 100644 --- a/Makefile.in +++ b/Makefile.in @@ -74,7 +74,6 @@ CROSSTARGET = @CROSSTARGET@ SUBDIRS = @SUBDIRS@ RUNTESTFLAGS = -q -P wine MAKEDEP = $(TOOLSDIR)/tools/makedep$(TOOLSEXT) -WINEBUILD = $(TOOLSDIR)/tools/winebuild/winebuild$(TOOLSEXT) WRC = $(TOOLSDIR)/tools/wrc/wrc$(TOOLSEXT) PACKAGE_VERSION = @PACKAGE_VERSION@ SED_CMD = LC_ALL=C sed -e 's,@bindir\@,$(bindir),g' -e 's,@dlldir\@,$(dlldir),g' -e 's,@srcdir\@,$(srcdir),g' -e 's,@PACKAGE_STRING\@,@PACKAGE_STRING@,g' -e 's,@PACKAGE_VERSION\@,@PACKAGE_VERSION@,g' @@ -128,18 +127,12 @@ install-manpages:: manpages # Dependencies between directories # dependencies needed to build any dll or program -__tooldeps__: libs/port libs/wpp +__tooldeps__: libs/wpp __builddeps__: __tooldeps__ libs/wine include po -.PHONY: depend dummy __tooldeps__ install install-lib install-dev +.PHONY: depend dummy install install-lib install-dev dummy: -loader: libs/port libs/wine tools -server: libs/port libs/wine tools include -fonts: tools/sfnt2fon -include: tools tools/widl -libs/wine tools: libs/port -tools/sfnt2fon tools/wmc tools/wrc: tools -tools/widl tools/wmc tools/wrc: libs/wpp +server: include libs/port libs/wine libs/wpp: include/config.h # Misc rules diff --git a/aclocal.m4 b/aclocal.m4 index 15ad1fe017e..c0bdd55652e 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -286,15 +286,8 @@ wine_fn_config_test () wine_fn_config_tool () { ac_dir=$[1] - AS_VAR_IF([enable_tools],[no],[wine_fn_append_file DISABLED_SUBDIRS $ac_dir; return]) - + AS_VAR_IF([enable_tools],[no],[return]) wine_fn_all_rules - - wine_fn_append_rule "__tooldeps__: $ac_dir" - wine_fn_append_rule "$ac_dir: libs/port" - case $ac_dir in - tools/winebuild) wine_fn_append_rule "\$(WINEBUILD): $ac_dir" ;; - esac } wine_fn_config_symlink () diff --git a/configure b/configure index 3dd1b6b3d71..be00e575a89 100755 --- a/configure +++ b/configure @@ -7805,16 +7805,9 @@ wine_fn_config_tool () { ac_dir=$1 if test "x$enable_tools" = xno; then : - wine_fn_append_file DISABLED_SUBDIRS $ac_dir; return + return fi - wine_fn_all_rules - - wine_fn_append_rule "__tooldeps__: $ac_dir" - wine_fn_append_rule "$ac_dir: libs/port" - case $ac_dir in - tools/winebuild) wine_fn_append_rule "\$(WINEBUILD): $ac_dir" ;; - esac } wine_fn_config_symlink () @@ -19348,7 +19341,9 @@ if test "x$enable_tools" != xno then wine_fn_append_rule "tools/makedep$ac_exeext: $srcdir/tools/makedep.c include/config.h config.status @./config.status tools/makedep -Makefile: tools/makedep$ac_exeext" +Makefile: tools/makedep$ac_exeext +fonts: tools/sfnt2fon +include: tools tools/widl" else wine_fn_append_rule "\$(MAKEDEP): @echo \"You need to run make in $TOOLSDIR first\" && false" diff --git a/configure.ac b/configure.ac index 5d09075481b..819a921ce1c 100644 --- a/configure.ac +++ b/configure.ac @@ -3954,7 +3954,9 @@ then WINE_APPEND_RULE( [tools/makedep$ac_exeext: $srcdir/tools/makedep.c include/config.h config.status @./config.status tools/makedep -Makefile: tools/makedep$ac_exeext]) +Makefile: tools/makedep$ac_exeext +fonts: tools/sfnt2fon +include: tools tools/widl]) else WINE_APPEND_RULE( [\$(MAKEDEP): diff --git a/tools/makedep.c b/tools/makedep.c index 658d47f065f..57adf0bc264 100644 --- a/tools/makedep.c +++ b/tools/makedep.c @@ -3409,6 +3409,7 @@ static void output_subdirs( struct makefile *make ) struct strarray testclean_files = empty_strarray; struct strarray distclean_files = empty_strarray; struct strarray tools_deps = empty_strarray; + struct strarray tooldeps_deps = empty_strarray; struct strarray winetest_deps = empty_strarray; struct strarray crosstest_deps = empty_strarray; unsigned int i, j; @@ -3509,6 +3510,30 @@ static void output_subdirs( struct makefile *make ) strarray_add( &builddeps_deps, target ); } } + else + { + if (!strcmp( submake->base_dir, "tools" ) || !strncmp( submake->base_dir, "tools/", 6 )) + { + strarray_add( &tooldeps_deps, submake->base_dir ); + for (j = 0; j < submake->programs.count; j++) + output( "%s/%s%s: %s\n", submake->base_dir, + submake->programs.str[j], tools_ext, submake->base_dir ); + } + if (submake->programs.count || submake->sharedlib) + { + struct strarray libs = get_expanded_make_var_array( submake, "EXTRALIBS" ); + for (j = 0; j < submake->programs.count; j++) + strarray_addall( &libs, get_expanded_file_local_var( submake, + submake->programs.str[j], "LDFLAGS" )); + output( "%s: libs/port", submake->base_dir ); + for (j = 0; j < libs.count; j++) + { + if (!strcmp( libs.str[j], "-lwpp" )) output_filename( "libs/wpp" ); + if (!strcmp( libs.str[j], "-lwine" )) output_filename( "libs/wine" ); + } + output( "\n" ); + } + } if (submake->install_rules[INSTALL_LIB].count) { @@ -3532,6 +3557,13 @@ static void output_subdirs( struct makefile *make ) output( "\n" ); output_filenames( makefile_deps ); output( ":\n" ); + if (tooldeps_deps.count) + { + output( "__tooldeps__:" ); + output_filenames( tooldeps_deps ); + output( "\n" ); + strarray_add( &make->phony_targets, "__tooldeps__" ); + } if (winetest_deps.count) { output( "programs/winetest:" );