dinput: When handling axes, ignore the ABS_HAT.* as they are handled as POV.
[wine] / dlls / make_dlls
index 2c0eb88..3f60d94 100755 (executable)
@@ -17,7 +17,7 @@
 #
 # You should have received a copy of the GNU Lesser General Public
 # License along with this library; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
 #
 
 use strict;
@@ -33,17 +33,19 @@ my %altnames = ();
 # list of special dlls that can be switched on or off by configure
 my %special_dlls =
 (
-  "ddraw"    => "XFILES",
   "glu32"    => "GLU32FILES",
   "glut32"   => "GLUT32FILES",
   "opengl32" => "OPENGLFILES",
-  "d3d8"     => "OPENGLFILES",
-  "d3d9"     => "OPENGLFILES",
-  "d3dx8"    => "OPENGLFILES",
   "wined3d"  => "OPENGLFILES",
-  "x11drv"   => "XFILES"
+  "winex11.drv" => "XFILES"
 );
 
+sub needs_symlink($)
+{
+    (my $mod = $_[0]) =~ s/\.dll$//;
+    return $mod ne $directories{$_[0]};
+}
+
 foreach my $i (split(/\s/,$makefiles))
 {
     my $module;
@@ -66,6 +68,7 @@ foreach my $i (split(/\s/,$makefiles))
             if ($module =~ /^lib.*\.a$/)
             {
                 ($staticlib_dirs{$module} = $i) =~ s/^\.\/(.*)\/[^\/]+$/$1/;
+                die "invalid module $module in dir $staticlib_dirs{$module}\n" if "lib$staticlib_dirs{$module}.a" ne $module;
             }
             else
             {
@@ -166,14 +169,13 @@ my %targets16 = ();
 foreach my $mod (sort keys %directories)
 {
     next if defined($special_dlls{$directories{$mod}});  # skip special dlls
-    $targets{$mod . ".so"} = 1;
+    $targets{$mod . ".so"} = 1 if needs_symlink($mod);
     next unless defined $altnames{$mod};
     foreach my $i (sort @{$altnames{$mod}})
     {
-        $targets16{sprintf("%s.so",$i)} = 1;
+        $targets16{$i . "16"} = $mod;
     }
 }
-foreach my $mod (sort keys %staticlib_dirs) { $targets{$mod} = 1; }
 
 print NEWMAKE <<EOF;
 
@@ -188,7 +190,6 @@ printf NEWMAKE "\t%s\n", join( " \\\n\t", sort keys %targets16 );
 print NEWMAKE <<EOF;
 
 SYMLINKS_SO = \\
-       \$(EXTRADIRS:%=%.dll.so) \\
        \@WIN16_FILES\@ \\
 EOF
 printf NEWMAKE "\t%s\n", join( " \\\n\t", sort keys %targets );
@@ -197,7 +198,7 @@ print NEWMAKE <<EOF;
 
 # Main target
 
-all: symlinks\$(DLLEXT)
+all: \$(BUILDSUBDIRS) symlinks\$(DLLEXT)
 
 .PHONY: symlinks symlinks.so implib
 
@@ -205,47 +206,31 @@ symlinks.so: \$(SYMLINKS_SO)
 
 symlinks: \$(BUILDSUBDIRS)
 
-x11drv.dll.so: winex11.drv.so
-       \$(RM) \$@ && \$(LN_S) winex11.drv.so \$@
-
 EOF
 
 ################################################################
 # output the lib name -> directory rules
 
-print NEWMAKE <<EOF;
-
-# Map symlink name to the corresponding library
-
-EOF
-
+print NEWMAKE "# Map symlink name to the corresponding library\n\n";
 foreach my $mod (sort keys %directories)
 {
+    next unless needs_symlink($mod);
     printf NEWMAKE "%s.so: %s/%s.so\n", $mod, $directories{$mod}, $mod;
     printf NEWMAKE "\t\$(RM) \$@ && \$(LN_S) %s/%s.so \$@\n\n", $directories{$mod}, $mod;
-
-    if (defined $altnames{$mod})
-    {
-        my $count = 0;
-        foreach my $i (sort @{$altnames{$mod}})
-        {
-            if ($count++ == 3) { printf NEWMAKE "\\\n  "; $count = 1; }
-            printf NEWMAKE "%s.so ", $i;
-        }
-        printf NEWMAKE ": %s.so\n", $mod;
-        printf NEWMAKE "\t\$(RM) \$@ && \$(LN_S) %s.so \$@\n\n", $mod;
-    }
 }
-foreach my $mod (sort keys %staticlib_dirs)
+
+print NEWMAKE "# Placeholders for 16-bit libraries\n\n";
+foreach my $mod (sort keys %directories)
 {
-    printf NEWMAKE "%s: %s/%s\n", $mod, $staticlib_dirs{$mod}, $mod;
-    printf NEWMAKE "\t\$(RM) \$@ && \$(LN_S) %s/%s \$@\n\n", $staticlib_dirs{$mod}, $mod;
+    next unless defined $altnames{$mod};
+    printf NEWMAKE "%s:\n", join(" ", map { $_ . "16"; } sort @{$altnames{$mod}});
+    printf NEWMAKE "\techo \"%s\" >\$\@\n\n", $mod;
 }
 
 ################################################################
 # output the import libraries rules
 
-print NEWMAKE "\n# Import libraries\n\n";
+print NEWMAKE "# Import libraries\n\n";
 print NEWMAKE "STATIC_IMPLIBEXT = \$(IMPLIBEXT:def=def.a)\n\n";
 
 my @lib_symlinks = ();
@@ -260,12 +245,12 @@ foreach my $mod (sort @lib_symlinks)
 {
     printf NEWMAKE " \\\n\t%s.\$(IMPLIBEXT)", $importlibs{$mod};
 }
+
+print NEWMAKE "\n\nIMPORT_LIBS = \\\n\t\$(IMPORT_SYMLINKS)";
 foreach my $mod (sort keys %staticlib_dirs)
 {
-    printf NEWMAKE " \\\n\t%s", $mod;
+    printf NEWMAKE " \\\n\t%s/%s", $staticlib_dirs{$mod}, $mod;
 }
-
-print NEWMAKE "\n\nIMPORT_LIBS = \\\n\t\$(IMPORT_SYMLINKS)";
 foreach my $mod (sort keys %importlibs)
 {
     my $dir = $directories{$mod};
@@ -310,6 +295,7 @@ print NEWMAKE "# Map library name to the corresponding directory\n\n";
 
 foreach my $mod (sort keys %directories)
 {
+    next unless needs_symlink($mod);
     printf NEWMAKE "%s/%s.so: %s\n", $directories{$mod}, $mod, $directories{$mod};
 }
 foreach my $mod (sort keys %staticlib_dirs)
@@ -348,10 +334,10 @@ install-lib:: \$(INSTALLSUBDIRS:%=%/__install-lib__)
 install-dev:: \$(INSTALLSUBDIRS:%=%/__install-dev__)
 
 uninstall::
-       -rmdir \$(dlldir)
+       -rmdir \$(DESTDIR)\$(dlldir)
 
 clean::
-       \$(RM) \$(IMPORT_SYMLINKS)
+       \$(RM) \$(IMPORT_SYMLINKS) \$(WIN16_FILES)
 
 check test:: \$(BUILDSUBDIRS:%=%/__test__)