Alexandre Julliard : makefiles: Bypass the normal substitution mechanism for the makefile dependencies.

Alexandre Julliard julliard at winehq.org
Fri Mar 26 12:11:48 CDT 2010


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Thu Mar 25 22:13:03 2010 +0100

makefiles: Bypass the normal substitution mechanism for the makefile dependencies.

This avoids performance problems with large substitutions.

---

 Makefile.in  |   17 +----------------
 aclocal.m4   |    9 +++++++--
 configure    |   34 ++++++++++++++++++++++++++++------
 configure.ac |   16 +++++++++++++++-
 4 files changed, 51 insertions(+), 25 deletions(-)

diff --git a/Makefile.in b/Makefile.in
index 75e74be..2697d2b 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -18,14 +18,10 @@
 # sgmlpages:       compile sgml source for the Wine API Guide
 # xmlpages:        compile xml source for the Wine API Guide
 
-# Directories
-
 TOPSRCDIR = @top_srcdir@
 TOPOBJDIR = .
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
-LIBEXT    = @LIBEXT@
-MODULE    = none
 
 # Sub-directories that don't have a makefile
 EXTRASUBDIRS = dlls libs
@@ -61,7 +57,7 @@ clean:: __clean__
 	$(RM) tools/makedep$(EXEEXT)
 
 distclean:: clean
-	$(RM) config.* configure.lineno TAGS tags include/config.h include/stamp-h Makefile
+	$(RM) config.* configure.lineno TAGS tags include/config.h include/stamp-h Makefile Make.tmp
 	$(RM) -r autom4te.cache
 
 # Dependencies between directories
@@ -91,14 +87,3 @@ TAGS etags:
 tags ctags:
 	$(RM) tags
 	(test -d .git && git ls-files '*.[chly]' '*.idl' || find -L $(TOPSRCDIR) -name '*.[ch]' -print) | xargs ctags -a
-
-# Makefile rules
-
-.INIT: Makefile
-.BEGIN: Makefile
-.MAKEFILEDEPS:
-
- at ALL_MAKEFILE_DEPENDS@
-
-uninstall::
-	-rmdir $(DESTDIR)$(datadir)/wine $(DESTDIR)$(fakedlldir) $(DESTDIR)$(dlldir)
diff --git a/aclocal.m4 b/aclocal.m4
index 11fe076..08f0bcd 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -140,9 +140,14 @@ dnl
 dnl Usage: AC_REQUIRE([WINE_CONFIG_HELPERS])
 dnl
 AC_DEFUN([WINE_CONFIG_HELPERS],
-[AC_SUBST(ALL_MAKEFILE_DEPENDS,["# Makefile dependencies
+[ALL_MAKEFILE_DEPENDS="
+# Rules automatically generated by configure
+
+.INIT: Makefile
+.BEGIN: Makefile
+.MAKEFILEDEPS:
 Makefile: Makefile.in Make.rules config.status
-	@./config.status Makefile"])
+	@./config.status Make.tmp Makefile"
 
 AC_SUBST(ALL_WINETEST_DEPENDS,["# Test binaries"])
 AC_SUBST(ALL_TEST_BINARIES,"")
diff --git a/configure b/configure
index 89341e5..7461096 100755
--- a/configure
+++ b/configure
@@ -599,7 +599,6 @@ LIBOBJS
 ALL_PROGRAM_BIN_INSTALL_DIRS
 ALL_TEST_BINARIES
 ALL_WINETEST_DEPENDS
-ALL_MAKEFILE_DEPENDS
 LDAPLIBS
 LIBPOLL
 LIBDL
@@ -13842,10 +13841,14 @@ esac
 ac_config_commands="$ac_config_commands include/stamp-h"
 
 
-ALL_MAKEFILE_DEPENDS="# Makefile dependencies
-Makefile: Makefile.in Make.rules config.status
-	@./config.status Makefile"
+ALL_MAKEFILE_DEPENDS="
+# Rules automatically generated by configure
 
+.INIT: Makefile
+.BEGIN: Makefile
+.MAKEFILEDEPS:
+Makefile: Makefile.in Make.rules config.status
+	@./config.status Make.tmp Makefile"
 
 ALL_WINETEST_DEPENDS="# Test binaries"
 
@@ -14695,11 +14698,17 @@ wine_fn_config_tool tools/winegcc
 wine_fn_config_tool tools/wmc
 wine_fn_config_tool tools/wrc
 
-ac_config_files="$ac_config_files Makefile"
+ac_config_commands="$ac_config_commands Makefile"
+
+
+ac_config_files="$ac_config_files Make.tmp:Makefile.in"
 
 
 test -n "$DLLEXT" || ALL_PROGRAM_BIN_INSTALL_DIRS=""
 
+wine_fn_append_rule ALL_MAKEFILE_DEPENDS "uninstall::
+	-rmdir \$(DESTDIR)\$(datadir)/wine \$(DESTDIR)\$(fakedlldir) \$(DESTDIR)\$(dlldir)"
+
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
 # tests run on this system so they can be shared between configure
@@ -15384,6 +15393,17 @@ _ASBOX
 
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#
+# INIT-COMMANDS
+#
+wine_fn_output_makefile ()
+{
+    cat Make.tmp - <<\_WINE_EOF >\$tmp/makefile && mv -f \$tmp/makefile \$1 && rm -f Make.tmp && return
+$ALL_MAKEFILE_DEPENDS
+_WINE_EOF
+    as_fn_error "could not create Makefile" "$LINENO" 5
+}
+
 _ACEOF
 
 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
@@ -15411,7 +15431,8 @@ do
     "dlls/Makedll.rules") CONFIG_FILES="$CONFIG_FILES dlls/Makedll.rules" ;;
     "dlls/Makeimplib.rules") CONFIG_FILES="$CONFIG_FILES dlls/Makeimplib.rules" ;;
     "programs/Makeprog.rules") CONFIG_FILES="$CONFIG_FILES programs/Makeprog.rules" ;;
-    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+    "Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile" ;;
+    "Make.tmp") CONFIG_FILES="$CONFIG_FILES Make.tmp:Makefile.in" ;;
 
   *) as_fn_error "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
   esac
@@ -16040,6 +16061,7 @@ $as_echo "$as_me: creating dlls/user32/resources" >&6;}; as_dir="dlls/user32/res
 $as_echo "$as_me: creating dlls/wineps.drv/data" >&6;}; as_dir="dlls/wineps.drv/data"; as_fn_mkdir_p; } ;;
     "include/wine":C) test -d "include/wine" || { { $as_echo "$as_me:${as_lineno-$LINENO}: creating include/wine" >&5
 $as_echo "$as_me: creating include/wine" >&6;}; as_dir="include/wine"; as_fn_mkdir_p; } ;;
+    "Makefile":C) wine_fn_output_makefile Makefile ;;
 
   esac
 done # for ac_tag
diff --git a/configure.ac b/configure.ac
index fe11a04..142d32a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2702,11 +2702,25 @@ WINE_CONFIG_TOOL(tools/wmc)
 WINE_CONFIG_TOOL(tools/wrc)
 dnl End of auto-generated output commands
 
-AC_CONFIG_FILES([Makefile])
+AC_CONFIG_COMMANDS([Makefile], [wine_fn_output_makefile Makefile],
+[wine_fn_output_makefile ()
+{
+    cat Make.tmp - <<\_WINE_EOF >\$tmp/makefile && mv -f \$tmp/makefile \$[]1 && rm -f Make.tmp && return
+$ALL_MAKEFILE_DEPENDS
+_WINE_EOF
+    AS_ERROR([could not create Makefile])
+}])
+
+AC_CONFIG_FILES([Make.tmp:Makefile.in])
 
 dnl Don't install in bin dir for Windows build
 test -n "$DLLEXT" || ALL_PROGRAM_BIN_INSTALL_DIRS=""
 
+dnl Some final makefile rules
+WINE_APPEND_RULE([ALL_MAKEFILE_DEPENDS],
+[uninstall::
+	-rmdir \$(DESTDIR)\$(datadir)/wine \$(DESTDIR)\$(fakedlldir) \$(DESTDIR)\$(dlldir)])
+
 AC_OUTPUT
 
 if test "$no_create" = "yes"




More information about the wine-cvs mailing list