Alexandre Julliard : makefiles: Generate the common rules for dlls from configure.

Alexandre Julliard julliard at winehq.org
Thu Oct 10 13:26:52 CDT 2013


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Thu Oct 10 11:05:21 2013 +0200

makefiles: Generate the common rules for dlls from configure.

---

 .gitignore            |    1 -
 aclocal.m4            |    4 ++--
 configure             |   29 +++++++++++++++++++++--------
 configure.ac          |   19 ++++++++++++++++++-
 dlls/Makedll.rules.in |   17 -----------------
 tools/make_makefiles  |   15 +++++++++++----
 6 files changed, 52 insertions(+), 33 deletions(-)

diff --git a/.gitignore b/.gitignore
index f5133b7..1d35e05 100644
--- a/.gitignore
+++ b/.gitignore
@@ -21,7 +21,6 @@
 Makefile
 dlldata.c
 dlls/*/*.def
-dlls/Makedll.rules
 dlls/actxprxy/actxprxy_activscp.h
 dlls/actxprxy/actxprxy_activscp_p.c
 dlls/actxprxy/actxprxy_comcat.h
diff --git a/aclocal.m4 b/aclocal.m4
index 0058603..fb013fb 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -393,14 +393,14 @@ wine_fn_config_dll ()
               dnl enable_win16 is special in that it disables import libs too
               [if wine_fn_has_flag implib && test "$ac_enable" != enable_win16
                then
-                   wine_fn_depend_rules dlls/Makedll.rules
+                   wine_fn_depend_rules Make.rules.in
                    wine_fn_clean_rules $ac_clean
                else
                    wine_fn_disabled_rules $ac_clean
                    return
                fi],
 
-              [wine_fn_all_rules dlls/Makedll.rules
+              [wine_fn_all_rules Make.rules.in
                wine_fn_clean_rules $ac_clean
                wine_fn_append_rule \
 "$ac_dir: __builddeps__
diff --git a/configure b/configure
index 4744a1a..da3d922 100755
--- a/configure
+++ b/configure
@@ -627,6 +627,7 @@ LIBOBJS
 PORCFLAGS
 LINGUAS
 ALL_TEST_RESOURCES
+MAKE_DLL_RULES
 MAKE_IMPLIB_RULES
 LDAPLIBS
 LIBRT
@@ -801,7 +802,6 @@ PATH_SEPARATOR
 SHELL'
 ac_subst_files='MAKE_RULES
 MAKE_TEST_RULES
-MAKE_DLL_RULES
 MAKE_PROG_RULES'
 ac_user_opts='
 enable_option_checking
@@ -16065,6 +16065,24 @@ all: \$(STATICLIB:.a=.cross.a)
 fi
 
 
+if test -n "$DLLEXT"
+then
+    deps="\$(MODULE)$DLLEXT \$(MODULE).fake"
+else
+    deps="\$(MODULE)"
+fi
+
+MAKE_DLL_RULES="
+DLLFLAGS    = $DLLFLAGS
+MAINSPEC    = \$(MODULE:%.dll=%).spec
+IDL_TLB_RES = \$(IDL_TLB_SRCS:.idl=_t.res)
+MODULEFLAGS = -shared \$(srcdir)/\$(MAINSPEC) \$(EXTRADLLFLAGS)
+
+all: $deps
+"
+
+
+
 wine_rules_file=conf$$rules.make
 rm -f $wine_rules_file
 ALL_POT_FILES=""
@@ -16266,14 +16284,14 @@ wine_fn_config_dll ()
     if eval test \"x\$"$ac_enable"\" = x"no"; then :
                 if wine_fn_has_flag implib && test "$ac_enable" != enable_win16
                then
-                   wine_fn_depend_rules dlls/Makedll.rules
+                   wine_fn_depend_rules Make.rules.in
                    wine_fn_clean_rules $ac_clean
                else
                    wine_fn_disabled_rules $ac_clean
                    return
                fi
 else
-  wine_fn_all_rules dlls/Makedll.rules
+  wine_fn_all_rules Make.rules.in
                wine_fn_clean_rules $ac_clean
                wine_fn_append_rule \
 "$ac_dir: __builddeps__
@@ -16605,10 +16623,6 @@ wine_fn_config_makerules Maketest.rules Make.rules
 MAKE_TEST_RULES=Maketest.rules
 ac_config_files="$ac_config_files Maketest.rules"
 
-wine_fn_config_makerules dlls/Makedll.rules Make.rules
-MAKE_DLL_RULES=dlls/Makedll.rules
-ac_config_files="$ac_config_files dlls/Makedll.rules"
-
 wine_fn_config_makerules programs/Makeprog.rules Make.rules
 MAKE_PROG_RULES=programs/Makeprog.rules
 ac_config_files="$ac_config_files programs/Makeprog.rules"
@@ -18180,7 +18194,6 @@ do
     "include/wine") CONFIG_COMMANDS="$CONFIG_COMMANDS include/wine" ;;
     "Make.rules") CONFIG_FILES="$CONFIG_FILES Make.rules" ;;
     "Maketest.rules") CONFIG_FILES="$CONFIG_FILES Maketest.rules" ;;
-    "dlls/Makedll.rules") CONFIG_FILES="$CONFIG_FILES dlls/Makedll.rules" ;;
     "programs/Makeprog.rules") CONFIG_FILES="$CONFIG_FILES programs/Makeprog.rules" ;;
     "Makefile") CONFIG_COMMANDS="$CONFIG_COMMANDS Makefile" ;;
     "Make.tmp") CONFIG_FILES="$CONFIG_FILES Make.tmp:Make.vars.in:Makefile.in" ;;
diff --git a/configure.ac b/configure.ac
index 90feb73..6bc985a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2608,6 +2608,24 @@ all: \$(STATICLIB:.a=.cross.a)
 ")
 fi
 
+dnl Dll rules
+
+if test -n "$DLLEXT"
+then
+    deps="\$(MODULE)$DLLEXT \$(MODULE).fake"
+else
+    deps="\$(MODULE)"
+fi
+
+AC_SUBST(MAKE_DLL_RULES,"
+DLLFLAGS    = $DLLFLAGS
+MAINSPEC    = \$(MODULE:%.dll=%).spec
+IDL_TLB_RES = \$(IDL_TLB_SRCS:.idl=_t.res)
+MODULEFLAGS = -shared \$(srcdir)/\$(MAINSPEC) \$(EXTRADLLFLAGS)
+
+all: $deps
+")
+
 dnl Main makefile
 
 WINE_APPEND_RULE([
@@ -2636,7 +2654,6 @@ WINE_CONFIG_EXTRA_DIR(include/wine)
 
 WINE_CONFIG_MAKERULES([Make.rules],[MAKE_RULES])
 WINE_CONFIG_MAKERULES([Maketest.rules],[MAKE_TEST_RULES],[Make.rules])
-WINE_CONFIG_MAKERULES([dlls/Makedll.rules],[MAKE_DLL_RULES],[Make.rules])
 WINE_CONFIG_MAKERULES([programs/Makeprog.rules],[MAKE_PROG_RULES],[Make.rules])
 
 WINE_CONFIG_DLL(acledit)
diff --git a/dlls/Makedll.rules.in b/dlls/Makedll.rules.in
deleted file mode 100644
index 82322e3..0000000
--- a/dlls/Makedll.rules.in
+++ /dev/null
@@ -1,17 +0,0 @@
-# Global rules for building dlls     -*-Makefile-*-
-#
-# Each individual makefile should define the following variables:
-# MODULE       : name of the main module being built
-# EXTRALIBS    : extra libraries to link in (optional)
-#
-# plus all variables required by the global Make.rules.in
-#
-
-DLLFLAGS    = @DLLFLAGS@
-MAINSPEC    = $(MODULE:%.dll=%).spec
-IDL_TLB_RES = $(IDL_TLB_SRCS:.idl=_t.res)
-MODULEFLAGS = -shared $(srcdir)/$(MAINSPEC) $(EXTRADLLFLAGS)
-
-all: $(MODULE)$(DLLEXT) $(MODULE)$(FAKEEXT)
-
- at MAKE_RULES@
diff --git a/tools/make_makefiles b/tools/make_makefiles
index 8785326..dc1f92a 100755
--- a/tools/make_makefiles
+++ b/tools/make_makefiles
@@ -25,7 +25,6 @@ use strict;
 my %makerules =
 (
  "MAKE_RULES" => "Make.rules",
- "MAKE_DLL_RULES" => "dlls/Makedll.rules",
  "MAKE_TEST_RULES" => "Maketest.rules",
  "MAKE_PROG_RULES" => "programs/Makeprog.rules",
 );
@@ -351,7 +350,7 @@ sub parse_makefile($)
     }
 
     if (defined $make{"=flags"} && defined $make{"=rules"} &&
-        ($make{"=rules"} eq $makerules{"MAKE_DLL_RULES"} ||
+        ($make{"=rules"} eq "MAKE_DLL_RULES" ||
          $make{"=rules"} eq $makerules{"MAKE_PROG_RULES"}))
     {
         die "Custom install-lib rule not allowed in $file" if defined ${$make{"=flags"}}{"install-lib"};
@@ -377,6 +376,14 @@ sub assign_sources_to_makefiles(@)
         $subdirs{"$dir/ $subdir"} = 1 if $subdir;
         next unless $dir;
 
+        my $basedir = dirname( $dir );
+        if ($basedir && !defined $makefiles{"$basedir/Makefile"})
+        {
+            $subdir = $basedir;
+            $basedir = dirname( $basedir );
+            $subdirs{"$basedir/ $subdir"} = 1;
+        }
+
         die "no makefile found for $file\n" unless defined $makefiles{"$dir/Makefile"};
 
         my $make = $makefiles{"$dir/Makefile"};
@@ -447,7 +454,7 @@ sub update_makefiles(@)
         my $args = "";
         my $is_win16 = $make{"MODULE"} && ($make{"MODULE"} =~ /16$/ || $modules16{$make{"MODULE"}});
         my $flag_args = defined $make{"=flags"} ? ",[" . join(",",sort keys %{$make{"=flags"}}) ."]" : "";
-        if ($rules eq $makerules{"MAKE_DLL_RULES"})
+        if ($rules eq "MAKE_DLL_RULES")
         {
             (my $name = $file) =~ s/^dlls\/(.*)\/Makefile/$1/;
             if ($name =~ /\./)
@@ -546,7 +553,7 @@ sub update_ignores(@)
         {
             my @pattern = @{$src};
             next unless defined $makefile{$pattern[0]};
-            next if $pattern[0] eq "IDL_TLB_SRCS" && $makefile{"=rules"} eq "dlls/Makedll.rules";
+            next if $pattern[0] eq "IDL_TLB_SRCS" && $makefile{"=rules"} eq "MAKE_DLL_RULES";
             push @list, map { (my $ret = $_) =~ s/$pattern[1]$/$pattern[2]/; $ret; } @{$makefile{$pattern[0]}};
         }
         foreach my $f (@list)




More information about the wine-cvs mailing list