Skip to content

Commit ab4fc68

Browse files
committed
makedep: Generate dependencies for mo files when supported.
1 parent d19b68f commit ab4fc68

File tree

4 files changed

+41
-42
lines changed

4 files changed

+41
-42
lines changed

Make.vars.in

-2
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ ICOTOOL = @ICOTOOL@
4949
MSGFMT = @MSGFMT@
5050
CROSSTARGET = @CROSSTARGET@
5151
LINGUAS = @LINGUAS@
52-
ALL_MO_FILES = $(LINGUAS:%=@top_builddir@/po/%.mo)
53-
PORCFLAGS = @PORCFLAGS@
5452
RUNTESTFLAGS = -q -P wine
5553
MAKEDEP = $(TOOLSDIR)/tools/makedep$(TOOLSEXT)
5654
SFNT2FNT = $(TOOLSDIR)/tools/sfnt2fnt$(TOOLSEXT)

configure

+2-5
Original file line numberDiff line numberDiff line change
@@ -624,7 +624,6 @@ ac_includes_default="\
624624

625625
ac_subst_vars='LTLIBOBJS
626626
LIBOBJS
627-
PORCFLAGS
628627
LINGUAS
629628
LDAPLIBS
630629
LIBRT
@@ -17383,11 +17382,9 @@ fi
1738317382

1738417383
if test "$MSGFMT" != false
1738517384
then
17386-
PORCFLAGS="--po-dir=\$(top_builddir)/po"
17387-
17388-
wine_fn_append_rule "__builddeps__: \$(ALL_MO_FILES)
17385+
wine_fn_append_rule "__builddeps__: \$(LINGUAS:%=po/%.mo)
1738917386
clean::
17390-
\$(RM) \$(ALL_MO_FILES)"
17387+
\$(RM) \$(LINGUAS:%=po/%.mo)"
1739117388

1739217389
posrc="po"
1739317390
test "$srcdir" = . || posrc="$srcdir/po"

configure.ac

+2-3
Original file line numberDiff line numberDiff line change
@@ -3445,11 +3445,10 @@ fi
34453445

34463446
if test "$MSGFMT" != false
34473447
then
3448-
AC_SUBST([PORCFLAGS],["--po-dir=\$(top_builddir)/po"])
34493448
WINE_APPEND_RULE(
3450-
[__builddeps__: \$(ALL_MO_FILES)
3449+
[__builddeps__: \$(LINGUAS:%=po/%.mo)
34513450
clean::
3452-
\$(RM) \$(ALL_MO_FILES)])
3451+
\$(RM) \$(LINGUAS:%=po/%.mo)])
34533452

34543453
posrc="po"
34553454
test "$srcdir" = . || posrc="$srcdir/po"

tools/makedep.c

+37-32
Original file line numberDiff line numberDiff line change
@@ -1408,13 +1408,15 @@ static struct strarray output_sources(void)
14081408
struct strarray res_files = empty_strarray;
14091409
struct strarray clean_files = empty_strarray;
14101410
struct strarray po_files = empty_strarray;
1411+
struct strarray mo_files = empty_strarray;
14111412
struct strarray mc_files = empty_strarray;
14121413
struct strarray test_files = empty_strarray;
14131414
struct strarray dlldata_files = empty_strarray;
14141415
struct strarray c2man_files = empty_strarray;
14151416
struct strarray implib_objs = empty_strarray;
14161417
struct strarray includes = empty_strarray;
14171418
struct strarray phony_targets = empty_strarray;
1419+
struct strarray linguas = get_expanded_make_var_array( "LINGUAS" );
14181420
struct strarray all_targets = get_expanded_make_var_array( "PROGRAMS" );
14191421
struct strarray targetflags = get_expanded_make_var_array( "TARGETFLAGS" );
14201422
struct strarray delayimports = get_expanded_make_var_array( "DELAYIMPORTS" );
@@ -1429,6 +1431,9 @@ static struct strarray output_sources(void)
14291431
if (module && strendswith( module, ".a" )) staticlib = module;
14301432
for (i = 0; i < extradllflags.count; i++) if (!strcmp( extradllflags.str[i], "-m16" )) is_win16 = 1;
14311433

1434+
for (i = 0; i < linguas.count; i++)
1435+
strarray_add( &mo_files, strmake( "%s/po/%s.mo", top_obj_dir, linguas.str[i] ));
1436+
14321437
strarray_add( &includes, "-I." );
14331438
if (src_dir) strarray_add( &includes, strmake( "-I%s", src_dir ));
14341439
if (parent_dir) strarray_add( &includes, strmake( "-I%s", src_dir_path( parent_dir )));
@@ -1491,47 +1496,47 @@ static struct strarray output_sources(void)
14911496
}
14921497
else if (!strcmp( ext, "rc" )) /* resource file */
14931498
{
1494-
if (source->flags & FLAG_RC_PO)
1499+
strarray_add( &res_files, strmake( "%s.res", obj ));
1500+
output( "%s.res: %s %s\n", obj, tools_path( "wrc" ), source->filename );
1501+
if (subdir) output( "\t$(MKDIR_P) -m 755 %s\n", subdir );
1502+
output( "\t%s -o $@ %s", tools_path( "wrc" ), source->filename );
1503+
if (is_win16) output_filename( "-m16" );
1504+
else output_filenames( targetflags );
1505+
output_filename( "--nostdinc" );
1506+
output_filenames( includes );
1507+
output_filenames( define_args );
1508+
output_filenames( extradefs );
1509+
if (mo_files.count && (source->flags & FLAG_RC_PO))
14951510
{
1496-
output( "%s.res: %s $(ALL_MO_FILES) %s\n", obj, tools_path( "wrc" ), source->filename );
1497-
if (subdir) output( "\t$(MKDIR_P) -m 755 %s\n", subdir );
1498-
output( "\t%s -o $@ %s", tools_path( "wrc" ), source->filename );
1499-
if (is_win16) output_filename( "-m16" );
1500-
else output_filenames( targetflags );
1501-
output_filename( "--nostdinc" );
1502-
output_filenames( includes );
1503-
output_filenames( define_args );
1504-
output_filenames( extradefs );
1505-
output_filename( "$(PORCFLAGS)" );
1506-
output( "\n" );
1507-
output( "%s.res rsrc.pot:", obj );
15081511
strarray_add( &po_files, source->filename );
1509-
}
1510-
else
1511-
{
1512-
output( "%s.res: %s %s\n", obj, tools_path( "wrc" ), source->filename );
1513-
if (subdir) output( "\t$(MKDIR_P) -m 755 %s\n", subdir );
1514-
output( "\t%s -o $@ %s", tools_path( "wrc" ), source->filename );
1515-
if (is_win16) output_filename( "-m16" );
1516-
else output_filenames( targetflags );
1517-
output_filename( "--nostdinc" );
1518-
output_filenames( includes );
1519-
output_filenames( define_args );
1520-
output_filenames( extradefs );
1521-
output_filename( "$(PORCFLAGS)" );
1512+
output_filename( strmake( "--po-dir=%s/po", top_obj_dir ));
15221513
output( "\n" );
15231514
output( "%s.res:", obj );
1515+
output_filenames( mo_files );
1516+
output( "\n" );
1517+
output( "rsrc.pot " );
15241518
}
1525-
strarray_add( &res_files, strmake( "%s.res", obj ));
1519+
else output( "\n" );
1520+
output( "%s.res:", obj );
15261521
}
15271522
else if (!strcmp( ext, "mc" )) /* message file */
15281523
{
1529-
output( "%s.res: %s $(ALL_MO_FILES) %s\n", obj, tools_path( "wmc" ), source->filename );
1530-
if (subdir) output( "\t$(MKDIR_P) -m 755 %s\n", subdir );
1531-
output( "\t%s -U -O res $(PORCFLAGS) -o $@ %s\n", tools_path( "wmc" ), source->filename );
15321524
strarray_add( &res_files, strmake( "%s.res", obj ));
1533-
strarray_add( &mc_files, source->filename );
1534-
output( "msg.pot %s.res:", obj );
1525+
output( "%s.res: %s %s\n", obj, tools_path( "wmc" ), source->filename );
1526+
if (subdir) output( "\t$(MKDIR_P) -m 755 %s\n", subdir );
1527+
output( "\t%s -U -O res -o $@ %s", tools_path( "wmc" ), source->filename );
1528+
if (mo_files.count)
1529+
{
1530+
strarray_add( &mc_files, source->filename );
1531+
output_filename( strmake( "--po-dir=%s/po", top_obj_dir ));
1532+
output( "\n" );
1533+
output( "%s.res:", obj );
1534+
output_filenames( mo_files );
1535+
output( "\n" );
1536+
output( "msg.pot " );
1537+
}
1538+
else output( "\n" );
1539+
output( "%s.res:", obj );
15351540
}
15361541
else if (!strcmp( ext, "idl" )) /* IDL file */
15371542
{

0 commit comments

Comments
 (0)