Alexandre Julliard : makefiles: Generate top-level rules for building mo files.

Alexandre Julliard julliard at wine.codeweavers.com
Thu Feb 25 10:56:04 CST 2016


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Thu Feb 25 17:46:56 2016 +0900

makefiles: Generate top-level rules for building mo files.

Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 configure       | 21 +++++----------------
 configure.ac    | 25 ++++++-------------------
 tools/makedep.c | 35 +++++++++++++++++++++++++----------
 3 files changed, 36 insertions(+), 45 deletions(-)

diff --git a/configure b/configure
index b11d5fb..6342d91 100755
--- a/configure
+++ b/configure
@@ -18308,23 +18308,12 @@ include/stamp-h.in: configure.ac aclocal.m4
 	@echo timestamp > \$@"
 fi
 
-if test "$MSGFMT" != false
-then
-    wine_fn_append_rule "__builddeps__: \$(LINGUAS:%=po/%.mo)
-clean::
-	\$(RM) \$(LINGUAS:%=po/%.mo)"
+test "$MSGFMT" != false || LINGUAS=
 
-    posrc="po"
-    test "$srcdir" = . || posrc="$srcdir/po"
-    for i in $LINGUAS
-    do
-        wine_fn_ignore_file "po/$i.mo"
-        wine_fn_append_rule "po/$i.mo: $posrc/$i.po
-	\$(MSGFMT) -o \$@ $posrc/$i.po"
-    done
-else
-    LINGUAS=
-fi
+for i in $LINGUAS
+do
+    wine_fn_ignore_file "po/$i.mo"
+done
 
 if test "x$enable_tools" != xno
 then
diff --git a/configure.ac b/configure.ac
index 288224c..9e0dcd9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3650,25 +3650,12 @@ include/stamp-h.in: configure.ac aclocal.m4
 	@echo timestamp > \$[@]])
 fi
 
-if test "$MSGFMT" != false
-then
-    WINE_APPEND_RULE(
-[__builddeps__: \$(LINGUAS:%=po/%.mo)
-clean::
-	\$(RM) \$(LINGUAS:%=po/%.mo)])
-
-    posrc="po"
-    test "$srcdir" = . || posrc="$srcdir/po"
-    for i in $LINGUAS
-    do
-        WINE_IGNORE_FILE("po/$i.mo")
-        WINE_APPEND_RULE(
-[po/$i.mo: $posrc/$i.po
-	\$(MSGFMT) -o \$@ $posrc/$i.po])
-    done
-else
-    LINGUAS=
-fi
+test "$MSGFMT" != false || LINGUAS=
+
+for i in $LINGUAS
+do
+    WINE_IGNORE_FILE("po/$i.mo")
+done
 
 if test "x$enable_tools" != xno
 then
diff --git a/tools/makedep.c b/tools/makedep.c
index 70dd753..79ad71d 100644
--- a/tools/makedep.c
+++ b/tools/makedep.c
@@ -146,6 +146,7 @@ static const char *convert;
 static const char *rsvg;
 static const char *icotool;
 static const char *dlltool;
+static const char *msgfmt;
 
 struct makefile
 {
@@ -2988,16 +2989,6 @@ static struct strarray output_sources( const struct makefile *make )
     strarray_addall( &clean_files, all_targets );
     strarray_addall( &clean_files, get_expanded_make_var_array( make, "EXTRA_TARGETS" ));
 
-    if (clean_files.count)
-    {
-        output( "%s::\n", obj_dir_path( make, "clean" ));
-        output( "\trm -f" );
-        output_filenames_obj_dir( make, clean_files );
-        output( "\n" );
-        if (make->obj_dir) output( "__clean__: %s\n", obj_dir_path( make, "clean" ));
-        strarray_add( &phony_targets, obj_dir_path( make, "clean" ));
-    }
-
     if (make->subdirs.count)
     {
         struct strarray makefile_deps = empty_strarray;
@@ -3022,9 +3013,32 @@ static struct strarray output_sources( const struct makefile *make )
         output( "\n" );
         strarray_add( &phony_targets, "distclean" );
 
+        if (msgfmt && strcmp( msgfmt, "false" ))
+        {
+            strarray_addall( &clean_files, mo_files );
+            output( "__builddeps__:" );
+            output_filenames( mo_files );
+            output( "\n" );
+            for (i = 0; i < linguas.count; i++)
+            {
+                output( "%s/%s.mo:", obj_dir_path( make, "po" ), linguas.str[i] );
+                output( " %s/%s.po\n", src_dir_path( make, "po" ), linguas.str[i] );
+                output( "\t%s -o $@ %s/%s.po\n", msgfmt, src_dir_path( make, "po" ), linguas.str[i] );
+            }
+        }
         if (get_expanded_make_variable( make, "GETTEXTPO_LIBS" )) output_po_files( make );
     }
 
+    if (clean_files.count)
+    {
+        output( "%s::\n", obj_dir_path( make, "clean" ));
+        output( "\trm -f" );
+        output_filenames_obj_dir( make, clean_files );
+        output( "\n" );
+        if (make->obj_dir) output( "__clean__: %s\n", obj_dir_path( make, "clean" ));
+        strarray_add( &phony_targets, obj_dir_path( make, "clean" ));
+    }
+
     if (phony_targets.count)
     {
         output( ".PHONY:" );
@@ -3472,6 +3486,7 @@ int main( int argc, char *argv[] )
     rsvg         = get_expanded_make_variable( top_makefile, "RSVG" );
     icotool      = get_expanded_make_variable( top_makefile, "ICOTOOL" );
     dlltool      = get_expanded_make_variable( top_makefile, "DLLTOOL" );
+    msgfmt       = get_expanded_make_variable( top_makefile, "MSGFMT" );
 
     if (root_src_dir && !strcmp( root_src_dir, "." )) root_src_dir = NULL;
     if (tools_dir && !strcmp( tools_dir, "." )) tools_dir = NULL;




More information about the wine-cvs mailing list