Author: rmottola
Date: Sun Dec 14 23:36:09 2014
New Revision: 38250

URL: http://svn.gna.org/viewcvs/gnustep?rev=38250&view=rev
Log:
Create mm sections in makefiles for Objective-C++

Modified:
    apps/projectcenter/trunk/ChangeLog
    apps/projectcenter/trunk/Framework/PCMakefileFactory.m

Modified: apps/projectcenter/trunk/ChangeLog
URL: 
http://svn.gna.org/viewcvs/gnustep/apps/projectcenter/trunk/ChangeLog?rev=38250&r1=38249&r2=38250&view=diff
==============================================================================
--- apps/projectcenter/trunk/ChangeLog  (original)
+++ apps/projectcenter/trunk/ChangeLog  Sun Dec 14 23:36:09 2014
@@ -1,3 +1,8 @@
+2014-12-15 Riccardo Mottola <[email protected]>
+
+       * Framework/PCMakefileFactory.m
+       Create mm sections in makefiles for Objective-C++
+
 2014-12-08 Riccardo Mottola <[email protected]>
 
        * Framework/PCProject.m

Modified: apps/projectcenter/trunk/Framework/PCMakefileFactory.m
URL: 
http://svn.gna.org/viewcvs/gnustep/apps/projectcenter/trunk/Framework/PCMakefileFactory.m?rev=38250&r1=38249&r2=38250&view=diff
==============================================================================
--- apps/projectcenter/trunk/Framework/PCMakefileFactory.m      (original)
+++ apps/projectcenter/trunk/Framework/PCMakefileFactory.m      Sun Dec 14 
23:36:09 2014
@@ -1,10 +1,11 @@
 /*
    GNUstep ProjectCenter - http://www.gnustep.org/experience/ProjectCenter.html
 
-   Copyright (C) 2002-2010 Free Software Foundation
+   Copyright (C) 2002-2014 Free Software Foundation
 
    Authors: Philippe C.D. Robert
             Serg Stoyan
+            Riccardo Mottola
 
    This file is part of GNUstep.
 
@@ -33,7 +34,8 @@
 
 #define COMMENT_HEADERS      @"\n\n#\n# Header files\n#\n"
 #define COMMENT_RESOURCES    @"\n\n#\n# Resource files\n#\n"
-#define COMMENT_CLASSES      @"\n\n#\n# Class files\n#\n"
+#define COMMENT_CLASSES      @"\n\n#\n# Objective-C Class files\n#\n"
+#define COMMENT_OCPPCLASSES  @"\n\n#\n# Objective-C++ Class files\n#\n"
 #define COMMENT_CFILES       @"\n\n#\n# Other sources\n#\n"
 #define COMMENT_SUBPROJECTS  @"\n\n#\n# Subprojects\n#\n"
 #define COMMENT_APP          @"\n\n#\n# Main application\n#\n"
@@ -337,41 +339,16 @@
 
 - (void)appendClasses:(NSArray *)array forTarget:(NSString *)target
 {
-  if (array == nil || [array count] == 0)
-    {
-      return;
-    }
-
-  [self appendString:COMMENT_CLASSES];
-  [self appendString:
-    [NSString stringWithFormat: @"%@_OBJC_FILES = \\\n",target]];
-
-  [self appendString: [array componentsJoinedByString: @" \\\n"]];
-}
-
-- (void)appendOtherSources:(NSArray *)array
-{
-  if (array == nil || [array count] == 0)
-    {
-      return;
-    }
-
-  [self appendOtherSources: array forTarget: pnme];
-}
-
-- (void)appendOtherSources:(NSArray *)array forTarget: (NSString *)target
-{
+  NSEnumerator   *oenum;
   NSMutableArray *marray = nil;
-  NSMutableArray *oarray = nil;
-  NSEnumerator   *oenum;
-  NSString       *file;
-  
-  if (array == nil || [array count] == 0)
-    {
-      return;
-    }
-
-  // Other Sources can have both .m files and non .m files
+  NSMutableArray *mmarray = nil;
+    NSString       *file;
+  
+  if (array == nil || [array count] == 0)
+    {
+      return;
+    }
+
   oenum = [array objectEnumerator];
   while ((file = [oenum nextObject]))
     {
@@ -383,6 +360,72 @@
            }
          [marray addObject: file];
        }
+      else if ([file hasSuffix: @".mm"])
+       {
+         if (mmarray == nil)
+           {
+             mmarray = [NSMutableArray array];
+           }
+         [mmarray addObject: file];
+       }
+    }
+
+  [self appendString:COMMENT_CLASSES];
+  [self appendString:
+    [NSString stringWithFormat: @"%@_OBJC_FILES = \\\n",target]];
+
+  [self appendString: [marray componentsJoinedByString: @" \\\n"]];
+
+  [self appendString:COMMENT_OCPPCLASSES];
+  [self appendString:
+    [NSString stringWithFormat: @"%@_OBJCC_FILES = \\\n",target]];
+
+  [self appendString: [mmarray componentsJoinedByString: @" \\\n"]];  
+}
+
+- (void)appendOtherSources:(NSArray *)array
+{
+  if (array == nil || [array count] == 0)
+    {
+      return;
+    }
+
+  [self appendOtherSources: array forTarget: pnme];
+}
+
+- (void)appendOtherSources:(NSArray *)array forTarget: (NSString *)target
+{
+  NSMutableArray *marray = nil;
+  NSMutableArray *mmarray = nil;
+  NSMutableArray *oarray = nil;
+  NSEnumerator   *oenum;
+  NSString       *file;
+  
+  if (array == nil || [array count] == 0)
+    {
+      return;
+    }
+
+  // Other Sources can have both .m files and non .m files
+  oenum = [array objectEnumerator];
+  while ((file = [oenum nextObject]))
+    {
+      if ([file hasSuffix: @".m"])
+       {
+         if (marray == nil)
+           {
+             marray = [NSMutableArray array];
+           }
+         [marray addObject: file];
+       }
+      else if ([file hasSuffix: @".mm"])
+       {
+         if (mmarray == nil)
+           {
+             mmarray = [NSMutableArray array];
+           }
+         [mmarray addObject: file];
+       }
       else // non .m file
        {
          if (oarray == nil)
@@ -415,6 +458,19 @@
       oenum = [marray objectEnumerator];
        
       [self appendString: [NSString stringWithFormat: @"%@_OBJC_FILES += 
",pnme]];
+
+      while ((file = [oenum nextObject])) 
+       {
+         [self appendString: [NSString stringWithFormat: @"\\\n%@ ", file]];
+       }
+    }
+
+  // Add .mm files if any
+  if (mmarray && [marray count] != 0)
+    {
+      oenum = [mmarray objectEnumerator];
+       
+      [self appendString: [NSString stringWithFormat: @"%@_OBJCC_FILES += 
",pnme]];
 
       while ((file = [oenum nextObject])) 
        {


_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs

Reply via email to