hhctrl.ocx: Added Hungarian translation.
[wine] / dlls / make_dlls
index 818b2c4..0a9012b 100755 (executable)
@@ -25,7 +25,9 @@ use strict;
 my $makefiles = `find . -name Makefile.in -print`;
 
 my %directories = ();
-my %implib_dirs = ();
+my %importlibs = ();
+my %static_implibs = ();
+my %staticlib_dirs = ();
 my %altnames = ();
 
 # list of special dlls that can be switched on or off by configure
@@ -63,7 +65,7 @@ foreach my $i (split(/\s/,$makefiles))
             $module = $1;
             if ($module =~ /^lib.*\.a$/)
             {
-                ($implib_dirs{$module} = $i) =~ s/^\.\/(.*)\/[^\/]+$/$1/;
+                ($staticlib_dirs{$module} = $i) =~ s/^\.\/(.*)\/[^\/]+$/$1/;
             }
             else
             {
@@ -71,6 +73,16 @@ foreach my $i (split(/\s/,$makefiles))
             }
             next;
         }
+        if (/^IMPORTLIB\s*=\s*([a-zA-Z0-9_.]+)\.\$\(IMPLIBEXT\)/)
+        {
+            $importlibs{$module} = $1;
+            next;
+        }
+        if (/^IMPLIB_SRCS\s*=/)
+        {
+            $static_implibs{$module} = 1;
+            next;
+        }
         if (/^SPEC_SRCS16\s*=\s*(.*)/)
         {
             my $specs = $1;
@@ -127,8 +139,14 @@ foreach my $dir (sort values %directories)
     printf NEWMAKE " \\\n\t%s", $dir;
 }
 
-printf NEWMAKE "\n\nSUBDIRS = \\\n\t\$(BASEDIRS)";
-foreach my $dir (sort (keys %special_dlls, values %implib_dirs))
+printf NEWMAKE "\n\nIMPLIBSUBDIRS =";
+foreach my $dir (sort values %staticlib_dirs)
+{
+    printf NEWMAKE " \\\n\t%s", $dir;
+}
+
+printf NEWMAKE "\n\nSUBDIRS = \\\n\t\$(BASEDIRS) \\\n\t\$(IMPLIBSUBDIRS)";
+foreach my $dir (sort keys %special_dlls)
 {
     printf NEWMAKE " \\\n\t%s", $dir;
 }
@@ -137,7 +155,7 @@ printf NEWMAKE <<EOF;
 
 BUILDSUBDIRS = \$(BASEDIRS) \$(EXTRADIRS)
 
-INSTALLSUBDIRS = \$(BUILDSUBDIRS)
+INSTALLSUBDIRS = \$(BUILDSUBDIRS) \$(IMPLIBSUBDIRS)
 EOF
 
 ################################################################
@@ -152,10 +170,10 @@ foreach my $mod (sort keys %directories)
     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 %implib_dirs) { $targets{$mod} = 1; }
+foreach my $mod (sort keys %staticlib_dirs) { $targets{$mod} = 1; }
 
 print NEWMAKE <<EOF;
 
@@ -212,63 +230,76 @@ foreach my $mod (sort keys %directories)
         foreach my $i (sort @{$altnames{$mod}})
         {
             if ($count++ == 3) { printf NEWMAKE "\\\n  "; $count = 1; }
-            printf NEWMAKE "%s.so ", $i;
+            printf NEWMAKE "%s16 ", $i;
         }
         printf NEWMAKE ": %s.so\n", $mod;
-        printf NEWMAKE "\t\$(RM) \$@ && \$(LN_S) %s.so \$@\n\n", $mod;
+        printf NEWMAKE "\techo \"%s\" >\$\@\n\n", $mod;
     }
 }
-foreach my $mod (sort keys %implib_dirs)
+foreach my $mod (sort keys %staticlib_dirs)
 {
-    printf NEWMAKE "%s: %s/%s\n", $mod, $implib_dirs{$mod}, $mod;
-    printf NEWMAKE "\t\$(RM) \$@ && \$(LN_S) %s/%s \$@\n\n", $implib_dirs{$mod}, $mod;
+    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;
 }
 
 ################################################################
 # output the import libraries rules
 
-my @implibs = grep /\.dll$/, keys %directories;
-push @implibs, "winspool.drv";
+print NEWMAKE "\n# Import libraries\n\n";
+print NEWMAKE "STATIC_IMPLIBEXT = \$(IMPLIBEXT:def=def.a)\n\n";
 
-print NEWMAKE "\n# Import libraries\n\nIMPORT_LIBS =";
-foreach my $mod (sort @implibs)
+my @lib_symlinks = ();
+foreach my $mod (sort keys %importlibs)
 {
-    my $def = $mod;
-    $def =~ s/\.(dll|drv)$//;
-    printf NEWMAKE " \\\n\tlib%s.\$(IMPLIBEXT)", $def;
+    my $dir = $directories{$mod};
+    my $lib = $importlibs{$mod};
+    if ($lib ne "lib" . $dir) { push @lib_symlinks, $mod; }
 }
-foreach my $mod (sort keys %implib_dirs)
+print NEWMAKE "IMPORT_SYMLINKS =";
+foreach my $mod (sort @lib_symlinks)
+{
+    printf NEWMAKE " \\\n\t%s.\$(IMPLIBEXT)", $importlibs{$mod};
+}
+foreach my $mod (sort keys %staticlib_dirs)
 {
     printf NEWMAKE " \\\n\t%s", $mod;
 }
-print NEWMAKE "\n\n";
-print NEWMAKE "implib: \$(IMPORT_LIBS)\n\n";
 
-foreach my $mod (sort @implibs)
+print NEWMAKE "\n\nIMPORT_LIBS = \\\n\t\$(IMPORT_SYMLINKS)";
+foreach my $mod (sort keys %importlibs)
 {
     my $dir = $directories{$mod};
     my $def = $mod;
-    my $spec = $mod;
-    $spec =~ s/\.dll$//;
     $def =~ s/\.(dll|drv)$//;
-    printf NEWMAKE "lib%s.def: %s/%s.spec.def\n", $def, $dir, $spec;
-    printf NEWMAKE "\t\$(RM) \$@ && \$(LN_S) %s/%s.spec.def \$@\n", $dir, $spec;
-    printf NEWMAKE "lib%s.a: %s/%s.spec.def\n", $def, $dir, $spec;
-    printf NEWMAKE "\t\$(DLLTOOL) -k -l \$@ -d %s/%s.spec.def\n\n", $dir, $spec;
+    printf NEWMAKE " \\\n\t%s/lib%s.\$(IMPLIBEXT)", $dir, $def;
+    printf NEWMAKE " \\\n\t%s/lib%s.\$(STATIC_IMPLIBEXT)", $dir, $def if $static_implibs{$mod};
 }
-foreach my $mod (sort @implibs)
+print NEWMAKE "\n\n";
+print NEWMAKE "implib: \$(IMPORT_LIBS)\n\n";
+
+foreach my $mod (sort keys %importlibs)
 {
     my $dir = $directories{$mod};
+    my $lib = $importlibs{$mod};
     my $spec = $mod;
     $spec =~ s/\.dll$//;
-    printf NEWMAKE "%s/%s.spec.def: \$(WINEBUILD)\n", $dir, $spec;
+    printf NEWMAKE "%s/%s.\$(IMPLIBEXT): %s/%s.spec \$(WINEBUILD)\n", $dir, $lib, $dir, $spec;
+    printf NEWMAKE "\t\@cd %s && \$(MAKE) %s.\$(IMPLIBEXT)\n\n", $dir, $lib;
+    next unless $static_implibs{$mod};
+    printf NEWMAKE "%s/%s.\$(STATIC_IMPLIBEXT): dummy\n", $dir, $lib, $dir, $spec;
+    printf NEWMAKE "\t\@cd %s && \$(MAKE) %s.\$(STATIC_IMPLIBEXT)\n\n", $dir, $lib;
+}
+foreach my $mod (sort @lib_symlinks)
+{
+    my $dir = $directories{$mod};
+    my $lib = $importlibs{$mod} . ".\$(IMPLIBEXT)";
+    printf NEWMAKE "%s: %s/%s\n", $lib, $dir, $lib;
+    printf NEWMAKE "\t\$(RM) \$@ && \$(LN_S) %s/%s \$@\n\n", $dir, $lib;
 }
-
 
 print NEWMAKE <<EOF;
-
 \$(BUILDSUBDIRS): \$(IMPORT_LIBS)
-\$(INSTALLSUBDIRS:%=%/__install__): \$(IMPORT_LIBS)
+\$(INSTALLSUBDIRS:%=%/__install__) \$(INSTALLSUBDIRS:%=%/__install-lib__): \$(IMPORT_LIBS)
 
 EOF
 
@@ -281,9 +312,9 @@ foreach my $mod (sort keys %directories)
 {
     printf NEWMAKE "%s/%s.so: %s\n", $directories{$mod}, $mod, $directories{$mod};
 }
-foreach my $mod (sort keys %implib_dirs)
+foreach my $mod (sort keys %staticlib_dirs)
 {
-    printf NEWMAKE "%s/%s: %s\n", $implib_dirs{$mod}, $mod, $implib_dirs{$mod};
+    printf NEWMAKE "%s/%s: %s\n", $staticlib_dirs{$mod}, $mod, $staticlib_dirs{$mod};
 }
 
 ################################################################
@@ -312,18 +343,15 @@ doc-sgml: \$(SUBDIRS:%=%/__doc_sgml__)
 
 # Misc rules
 
-install install-dev:: \$(IMPORT_LIBS)
-       \$(MKINSTALLDIRS) \$(dlldir)
-       for f in \$(IMPORT_LIBS); do \$(INSTALL_DATA) \$\$f \$(dlldir)/\$\$f; done
+install-lib:: \$(INSTALLSUBDIRS:%=%/__install-lib__)
 
-install install-lib:: \$(INSTALLSUBDIRS:%=%/__install__)
+install-dev:: \$(INSTALLSUBDIRS:%=%/__install-dev__)
 
 uninstall::
-       -cd \$(dlldir) && \$(RM) \$(IMPORT_LIBS)
-       -rmdir \$(dlldir)
+       -rmdir \$(DESTDIR)\$(dlldir)
 
 clean::
-       \$(RM) \$(IMPORT_LIBS) \$(SYMLINKS)
+       \$(RM) \$(IMPORT_SYMLINKS) \$(WIN16_FILES)
 
 check test:: \$(BUILDSUBDIRS:%=%/__test__)