@@ -1408,13 +1408,15 @@ static struct strarray output_sources(void)
1408
1408
struct strarray res_files = empty_strarray ;
1409
1409
struct strarray clean_files = empty_strarray ;
1410
1410
struct strarray po_files = empty_strarray ;
1411
+ struct strarray mo_files = empty_strarray ;
1411
1412
struct strarray mc_files = empty_strarray ;
1412
1413
struct strarray test_files = empty_strarray ;
1413
1414
struct strarray dlldata_files = empty_strarray ;
1414
1415
struct strarray c2man_files = empty_strarray ;
1415
1416
struct strarray implib_objs = empty_strarray ;
1416
1417
struct strarray includes = empty_strarray ;
1417
1418
struct strarray phony_targets = empty_strarray ;
1419
+ struct strarray linguas = get_expanded_make_var_array ( "LINGUAS" );
1418
1420
struct strarray all_targets = get_expanded_make_var_array ( "PROGRAMS" );
1419
1421
struct strarray targetflags = get_expanded_make_var_array ( "TARGETFLAGS" );
1420
1422
struct strarray delayimports = get_expanded_make_var_array ( "DELAYIMPORTS" );
@@ -1429,6 +1431,9 @@ static struct strarray output_sources(void)
1429
1431
if (module && strendswith ( module , ".a" )) staticlib = module ;
1430
1432
for (i = 0 ; i < extradllflags .count ; i ++ ) if (!strcmp ( extradllflags .str [i ], "-m16" )) is_win16 = 1 ;
1431
1433
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
+
1432
1437
strarray_add ( & includes , "-I." );
1433
1438
if (src_dir ) strarray_add ( & includes , strmake ( "-I%s" , src_dir ));
1434
1439
if (parent_dir ) strarray_add ( & includes , strmake ( "-I%s" , src_dir_path ( parent_dir )));
@@ -1491,47 +1496,47 @@ static struct strarray output_sources(void)
1491
1496
}
1492
1497
else if (!strcmp ( ext , "rc" )) /* resource file */
1493
1498
{
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 ))
1495
1510
{
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 );
1508
1511
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 ));
1522
1513
output ( "\n" );
1523
1514
output ( "%s.res:" , obj );
1515
+ output_filenames ( mo_files );
1516
+ output ( "\n" );
1517
+ output ( "rsrc.pot " );
1524
1518
}
1525
- strarray_add ( & res_files , strmake ( "%s.res" , obj ));
1519
+ else output ( "\n" );
1520
+ output ( "%s.res:" , obj );
1526
1521
}
1527
1522
else if (!strcmp ( ext , "mc" )) /* message file */
1528
1523
{
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 );
1532
1524
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 );
1535
1540
}
1536
1541
else if (!strcmp ( ext , "idl" )) /* IDL file */
1537
1542
{
0 commit comments