Alexandre Julliard : makefiles: Generate explicit build rules for message files from makedep.

Alexandre Julliard julliard at winehq.org
Tue Oct 15 13:27:10 CDT 2013


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon Oct 14 20:18:18 2013 +0200

makefiles: Generate explicit build rules for message files from makedep.

---

 Make.rules.in   |    9 +--------
 tools/makedep.c |   21 +++++++++++++++++++--
 2 files changed, 20 insertions(+), 10 deletions(-)

diff --git a/Make.rules.in b/Make.rules.in
index a7da5ef..06dea78 100644
--- a/Make.rules.in
+++ b/Make.rules.in
@@ -36,7 +36,7 @@ CROSSOBJS = $(OBJS:.o=.cross.o)
 
 # Implicit rules
 
-.SUFFIXES: .mc .rc .res .idl .tlb .h .ok .man.in .man _c.c _i.c _p.c _s.c _r.res _t.res .cross.o .po .mo @MAINTAINER_MODE@ .sfd .ttf .svg .ico .bmp
+.SUFFIXES: .rc .res .idl .tlb .h .ok .man.in .man _c.c _i.c _p.c _s.c _r.res _t.res .cross.o .po .mo @MAINTAINER_MODE@ .sfd .ttf .svg .ico .bmp
 
 .c.o:
 	$(CC) -c $(ALLCFLAGS) -o $@ $<
@@ -47,9 +47,6 @@ CROSSOBJS = $(OBJS:.o=.cross.o)
 .c.cross.o:
 	$(CROSSCC) -c $(INCLUDES) $(DEFS) -DWINE_CROSSTEST $(CPPFLAGS) $(CFLAGS) -o $@ $<
 
-.mc.res:
-	$(WMC) -U -O res $(PORCFLAGS) -o $@ $<
-
 .rc.res:
 	$(WRC) $(RCFLAGS) -o $@ $<
 
@@ -218,10 +215,6 @@ install install-lib install-dev uninstall::
 rsrc.pot: $(WRC)
 	$(WRC) $(RCFLAGS) -O pot -o $@ $(PO_SRCS)
 
-msg.pot: $(WMC)
-	$(WMC) -O pot -o $@ $(MC_SRCS)
-
-$(MC_SRCS:.mc=.res): $(WMC) $(ALL_MO_FILES)
 $(RC_SRCS:.rc=.res): $(WRC)
 $(PO_SRCS:.rc=.res): $(ALL_MO_FILES)
 
diff --git a/tools/makedep.c b/tools/makedep.c
index b7c70d2..db92d53 100644
--- a/tools/makedep.c
+++ b/tools/makedep.c
@@ -926,7 +926,7 @@ static void output_include( struct incl_file *pFile, struct incl_file *owner, in
 static void output_sources(void)
 {
     struct incl_file *source;
-    int i, column;
+    int i, column, mc_srcs = 0;
 
     LIST_FOR_EACH_ENTRY( source, &sources, struct incl_file, entry )
     {
@@ -966,7 +966,10 @@ static void output_sources(void)
         }
         else if (!strcmp( ext, "mc" ))  /* message file */
         {
-            column += output( "msg.pot %s.res: %s", obj, source->filename );
+            output( "%s.res: $(WMC) $(ALL_MO_FILES) %s\n", obj, source->filename );
+            output( "\t$(WMC) -U -O res $(PORCFLAGS) -o $@ %s\n", source->filename );
+            mc_srcs++;
+            column += output( "msg.pot %s.res:", obj );
         }
         else if (!strcmp( ext, "idl" ))  /* IDL file */
         {
@@ -1018,6 +1021,20 @@ static void output_sources(void)
             if (source->files[i]) output_include( source->files[i], source, &column );
         output( "\n" );
     }
+
+    /* rules for files that depend on multiple sources */
+
+    if (mc_srcs)
+    {
+        column = output( "msg.pot: $(WMC)" );
+        LIST_FOR_EACH_ENTRY( source, &sources, struct incl_file, entry )
+            if (strendswith( source->name, ".mc" )) output_filename( source->filename, &column );
+        output( "\n" );
+        column = output( "\t$(WMC) -O pot -o $@" );
+        LIST_FOR_EACH_ENTRY( source, &sources, struct incl_file, entry )
+            if (strendswith( source->name, ".mc" )) output_filename( source->filename, &column );
+        output( "\n" );
+    }
 }
 
 




More information about the wine-cvs mailing list