Alexandre Julliard : makefiles: Build the tools subdirectories directly from the top-level makefile.

Alexandre Julliard julliard at winehq.org
Tue Feb 9 10:37:53 CST 2010


Module: wine
Branch: master
Commit: 4d3b0205f578446fda891d6425cf749fc767f7a6
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=4d3b0205f578446fda891d6425cf749fc767f7a6

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon Feb  8 20:47:07 2010 +0100

makefiles: Build the tools subdirectories directly from the top-level makefile.

---

 Makefile.in          |   33 ++++++++++++++++++++++++---------
 configure            |   23 ++++++++++++++++-------
 configure.ac         |   15 ++++++++-------
 tools/Makefile.in    |   14 +-------------
 tools/make_makefiles |    4 ++++
 5 files changed, 53 insertions(+), 36 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index 7282cd1..e1279a6 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -27,6 +27,8 @@ VPATH     = @srcdir@
 LIBEXT    = @LIBEXT@
 MODULE    = none
 
+ALL_TOOL_DIRS = @ALL_TOOL_DIRS@
+
 # Sub-directories to run make depend/clean into
 SUBDIRS = \
 	dlls \
@@ -39,10 +41,10 @@ SUBDIRS = \
 	loader \
 	programs \
 	server \
-	tools
+	$(ALL_TOOL_DIRS)
 
 # Sub-directories to run make install/uninstall into
-INSTALLSUBDIRS = libs/wine @ALL_TOP_DIRS@
+INSTALLSUBDIRS = libs/wine $(ALL_TOOL_DIRS) @ALL_TOP_DIRS@
 
 # Sub-directories to run make test into
 TESTSUBDIRS = dlls
@@ -81,15 +83,22 @@ uninstall::
 
 all: $(INSTALLSUBDIRS)
 
-dlls programs: libs/port libs/wine libs/wpp tools include
+# dependencies needed to build any dll or program
+__builddeps__: libs/port libs/wine libs/wpp $(ALL_TOOL_DIRS) include
+.PHONY: __builddeps__
+
+dlls programs: __builddeps__
 loader server: libs/port libs/wine tools
-fonts include: tools
+fonts: tools
+include: tools/widl
 programs: dlls
-tools: libs/port libs/wine libs/wpp
-libs/wine: libs/port
+libs/wine $(ALL_TOOL_DIRS): libs/port
+tools/wmc tools/wrc: tools
+tools tools/wmc tools/wrc: libs/wine
+tools/widl tools/wmc tools/wrc: libs/wpp
 
-dlls/__install__ dlls/__install-lib__ dlls/__install-dev__: libs/port libs/wine libs/wpp tools include
-programs/__install__ programs/__install-lib__: libs/port libs/wine libs/wpp tools include
+dlls/__install__ dlls/__install-lib__ dlls/__install-dev__: __builddeps__
+programs/__install__ programs/__install-lib__: __builddeps__
 fonts/__install__ fonts/__install-lib__: tools
 include/__install__ include/__install-dev__: include
 libs/wine/__install__ libs/wine/__install-lib__ libs/wine/__install-dev__: libs/wine
@@ -98,6 +107,12 @@ server/__install__ server/__install-lib__: libs/port libs/wine tools
 programs/__install__: dlls/__install__
 programs/__install-lib__: dlls/__install-lib__
 tools/__install__ tools/__install-lib__ tools/__install-dev__: tools
+tools/widl/__install__ tools/widl/__install-dev__: tools/widl
+tools/winebuild/__install__ tools/winebuild/__install-dev__: tools/winebuild
+tools/winedump/__install__ tools/winedump/__install-dev__: tools/winedump
+tools/winegcc/__install__ tools/winegcc/__install-dev__: tools/winegcc
+tools/wmc/__install__ tools/wmc/__install-dev__: tools/wmc
+tools/wrc/__install__ tools/wrc/__install-dev__: tools/wrc
 
 RECURSE_TARGETS = \
 	$(SUBDIRS) \
@@ -119,7 +134,7 @@ $(MAKEDEP): include/config.h
 # Test rules
 
 $(TESTSUBDIRS:%=%/__test__): wine
-$(TESTSUBDIRS:%=%/__crosstest__): tools include
+$(TESTSUBDIRS:%=%/__crosstest__): __builddeps__
 
 # Misc rules
 
diff --git a/configure b/configure
index 4bb5081..0adb500 100755
--- a/configure
+++ b/configure
@@ -605,6 +605,7 @@ ALL_IMPORTLIB_RULES
 ALL_IMPORT_LIBS
 ALL_STATIC_LIBS
 ALL_IMPLIB_DIRS
+ALL_TOOL_DIRS
 ALL_DLL_DIRS
 ALL_TOP_DIRS
 ALL_MAKEFILE_DEPENDS
@@ -13663,6 +13664,8 @@ ALL_TOP_DIRS=""
 
 ALL_DLL_DIRS=""
 
+ALL_TOOL_DIRS=""
+
 ALL_IMPLIB_DIRS=""
 
 ALL_STATIC_LIBS=""
@@ -18859,7 +18862,7 @@ ac_config_files="$ac_config_files server/Makefile"
 
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	tools/Makefile"
-test "x$enable_tools" != xno && ALL_TOP_DIRS="$ALL_TOP_DIRS \\
+test "x$enable_tools" != xno && ALL_TOOL_DIRS="$ALL_TOOL_DIRS \\
 	tools"
 ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
 tools/Makefile: tools/Makefile.in Make.rules config.status"
@@ -18867,42 +18870,48 @@ ac_config_files="$ac_config_files tools/Makefile"
 
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	tools/widl/Makefile"
-
+test "x$enable_tools" != xno && ALL_TOOL_DIRS="$ALL_TOOL_DIRS \\
+	tools/widl"
 ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
 tools/widl/Makefile: tools/widl/Makefile.in Make.rules config.status"
 ac_config_files="$ac_config_files tools/widl/Makefile"
 
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	tools/winebuild/Makefile"
-
+test "x$enable_tools" != xno && ALL_TOOL_DIRS="$ALL_TOOL_DIRS \\
+	tools/winebuild"
 ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
 tools/winebuild/Makefile: tools/winebuild/Makefile.in Make.rules config.status"
 ac_config_files="$ac_config_files tools/winebuild/Makefile"
 
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	tools/winedump/Makefile"
-
+test "x$enable_tools" != xno && ALL_TOOL_DIRS="$ALL_TOOL_DIRS \\
+	tools/winedump"
 ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
 tools/winedump/Makefile: tools/winedump/Makefile.in Make.rules config.status"
 ac_config_files="$ac_config_files tools/winedump/Makefile"
 
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	tools/winegcc/Makefile"
-
+test "x$enable_tools" != xno && ALL_TOOL_DIRS="$ALL_TOOL_DIRS \\
+	tools/winegcc"
 ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
 tools/winegcc/Makefile: tools/winegcc/Makefile.in Make.rules config.status"
 ac_config_files="$ac_config_files tools/winegcc/Makefile"
 
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	tools/wmc/Makefile"
-
+test "x$enable_tools" != xno && ALL_TOOL_DIRS="$ALL_TOOL_DIRS \\
+	tools/wmc"
 ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
 tools/wmc/Makefile: tools/wmc/Makefile.in Make.rules config.status"
 ac_config_files="$ac_config_files tools/wmc/Makefile"
 
 ALL_MAKEFILES="$ALL_MAKEFILES \\
 	tools/wrc/Makefile"
-
+test "x$enable_tools" != xno && ALL_TOOL_DIRS="$ALL_TOOL_DIRS \\
+	tools/wrc"
 ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS
 tools/wrc/Makefile: tools/wrc/Makefile.in Make.rules config.status"
 ac_config_files="$ac_config_files tools/wrc/Makefile"
diff --git a/configure.ac b/configure.ac
index 63b3cfe..0549119 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2101,6 +2101,7 @@ AC_SUBST(ALL_MAKEFILE_DEPENDS,["# Makefile dependencies"])
 
 AC_SUBST(ALL_TOP_DIRS,"")
 AC_SUBST(ALL_DLL_DIRS,"")
+AC_SUBST(ALL_TOOL_DIRS,"")
 AC_SUBST(ALL_IMPLIB_DIRS,"")
 AC_SUBST(ALL_STATIC_LIBS,"")
 AC_SUBST(ALL_IMPORT_LIBS,"")
@@ -2666,13 +2667,13 @@ WINE_CONFIG_PROGRAM(wordpad,[ALL_PROGRAM_DIRS,ALL_PROGRAM_INSTALL_DIRS])
 WINE_CONFIG_PROGRAM(write,[ALL_PROGRAM_DIRS,ALL_PROGRAM_INSTALL_DIRS])
 WINE_CONFIG_PROGRAM(xcopy,[ALL_PROGRAM_DIRS,ALL_PROGRAM_INSTALL_DIRS])
 WINE_CONFIG_MAKEFILE([server/Makefile],[Make.rules],[],[ALL_TOP_DIRS])
-WINE_CONFIG_MAKEFILE([tools/Makefile],[Make.rules],[],[ALL_TOP_DIRS])
-WINE_CONFIG_MAKEFILE([tools/widl/Makefile],[Make.rules])
-WINE_CONFIG_MAKEFILE([tools/winebuild/Makefile],[Make.rules])
-WINE_CONFIG_MAKEFILE([tools/winedump/Makefile],[Make.rules])
-WINE_CONFIG_MAKEFILE([tools/winegcc/Makefile],[Make.rules])
-WINE_CONFIG_MAKEFILE([tools/wmc/Makefile],[Make.rules])
-WINE_CONFIG_MAKEFILE([tools/wrc/Makefile],[Make.rules])
+WINE_CONFIG_MAKEFILE([tools/Makefile],[Make.rules],[],[ALL_TOOL_DIRS],[enable_tools])
+WINE_CONFIG_MAKEFILE([tools/widl/Makefile],[Make.rules],[],[ALL_TOOL_DIRS],[enable_tools])
+WINE_CONFIG_MAKEFILE([tools/winebuild/Makefile],[Make.rules],[],[ALL_TOOL_DIRS],[enable_tools])
+WINE_CONFIG_MAKEFILE([tools/winedump/Makefile],[Make.rules],[],[ALL_TOOL_DIRS],[enable_tools])
+WINE_CONFIG_MAKEFILE([tools/winegcc/Makefile],[Make.rules],[],[ALL_TOOL_DIRS],[enable_tools])
+WINE_CONFIG_MAKEFILE([tools/wmc/Makefile],[Make.rules],[],[ALL_TOOL_DIRS],[enable_tools])
+WINE_CONFIG_MAKEFILE([tools/wrc/Makefile],[Make.rules],[],[ALL_TOOL_DIRS],[enable_tools])
 
 dnl Build dependencies for test files compiled into winetest
 
diff --git a/tools/Makefile.in b/tools/Makefile.in
index 496d7bf..2d5190b 100644
--- a/tools/Makefile.in
+++ b/tools/Makefile.in
@@ -30,16 +30,6 @@ C_SRCS = \
 	relpath.c \
 	sfnt2fnt.c
 
-INSTALLSUBDIRS = \
-	widl \
-	winebuild \
-	winedump \
-	winegcc \
-	wmc \
-	wrc
-
-SUBDIRS = $(INSTALLSUBDIRS)
-
 EXTRASUBDIRS = winapi
 
 INSTALLDIRS = \
@@ -50,7 +40,7 @@ INSTALLDIRS = \
 
 UPDATE_DESKTOP_DATABASE = update-desktop-database
 
-all: $(PROGRAMS) $(MANPAGES) $(SUBDIRS)
+all: $(PROGRAMS) $(MANPAGES)
 
 @MAKE_RULES@
 
@@ -94,8 +84,6 @@ uninstall::
 	$(RM) $(DESTDIR)$(bindir)/winemaker $(DESTDIR)$(bindir)/wineprefixcreate $(DESTDIR)$(mandir)/man$(prog_manext)/winemaker.$(prog_manext) $(DESTDIR)$(mandir)/man$(prog_manext)/wineprefixcreate.$(prog_manext) $(DESTDIR)$(datadir)/wine/wine.inf $(DESTDIR)$(datadir)/applications/wine.desktop
 	-$(UPDATE_DESKTOP_DATABASE)
 
-wmc wrc: relpath$(EXEEXT)
-
 @DEPENDENCIES@  # everything below this line is overwritten by make depend
 
 Makefile: makedep$(EXEEXT)
diff --git a/tools/make_makefiles b/tools/make_makefiles
index 2a05442..793b226 100755
--- a/tools/make_makefiles
+++ b/tools/make_makefiles
@@ -389,6 +389,10 @@ sub update_makefiles(@)
             (my $name = $file) =~ s/^dlls\/(.*)\/Makefile/$1/;
             push @lines, "WINE_CONFIG_LIB($name)\n";
         }
+        elsif ($file =~ /^tools.*\/Makefile$/)
+        {
+            push @lines, "WINE_CONFIG_MAKEFILE([$file],[$rules],[],[ALL_TOOL_DIRS],[enable_tools])\n";
+        }
         elsif ($file =~ /^[^\/]*\/Makefile$/)
         {
             push @lines, "WINE_CONFIG_MAKEFILE([$file],[$rules],[],[ALL_TOP_DIRS])\n";




More information about the wine-cvs mailing list