ide/Makefile generation: Fixed different compilers generating different makefiles...
authorJerome St-Louis <jerome@ecere.com>
Fri, 10 Aug 2012 05:03:52 +0000 (01:03 -0400)
committerJerome St-Louis <jerome@ecere.com>
Fri, 10 Aug 2012 05:03:52 +0000 (01:03 -0400)
(For splitting OBJECTS, was taking into account expanded $(OBJ) for Windows command line limit, now assuming it expands to at most 36 characters)
Cleaned up code to no longer pass round CompilerConfig objects where they should not

documentor/locale/documentor.pot
epj2make/locale/epj2make.pot
ide/locale/ide.pot
ide/src/project/Project.ec
ide/src/project/ProjectNode.ec
ide/src/project/ProjectView.ec

index 6d45fe8..3e84ee6 100644 (file)
@@ -187,7 +187,7 @@ msgstr "File"
 msgid "Functions"
 msgstr "Functions"
 
-#: ./../ide/src/IDESettings.ec:626
+#: ./../ide/src/IDESettings.ec:624
 msgid "GNU Compiler Collection (GCC) / GNU Make"
 msgstr "GNU Compiler Collection (GCC) / GNU Make"
 
@@ -195,15 +195,15 @@ msgstr "GNU Compiler Collection (GCC) / GNU Make"
 msgid "Methods"
 msgstr "Methods"
 
-#: ./../ide/src/IDESettings.ec:629
+#: ./../ide/src/IDESettings.ec:627
 msgid "Microsoft Visual Studio 2005 (8.0) Compiler"
 msgstr "Microsoft Visual Studio 2005 (8.0) Compiler"
 
-#: ./../ide/src/IDESettings.ec:630
+#: ./../ide/src/IDESettings.ec:628
 msgid "Microsoft Visual Studio 2008 (9.0) Compiler"
 msgstr "Microsoft Visual Studio 2008 (9.0) Compiler"
 
-#: ./../ide/src/IDESettings.ec:632
+#: ./../ide/src/IDESettings.ec:630
 msgid "Microsoft Visual Studio 2010 (10.0) Compiler"
 msgstr "Microsoft Visual Studio 2010 (10.0) Compiler"
 
@@ -232,7 +232,7 @@ msgstr "Open..."
 msgid "Parent namespace: <a href=\"api://%08x\" style=\"text-decoration: none;\">%s</a><br>\n"
 msgstr "Parent namespace: <a href=\"api://%08x\" style=\"text-decoration: none;\">%s</a><br>\n"
 
-#: ./../ide/src/IDESettings.ec:628
+#: ./../ide/src/IDESettings.ec:626
 msgid "Portable C Compiler / GNU Make"
 msgstr "Portable C Compiler / GNU Make"
 
@@ -268,7 +268,7 @@ msgstr "Structure"
 msgid "Tahoma"
 msgstr "Tahoma"
 
-#: ./../ide/src/IDESettings.ec:627
+#: ./../ide/src/IDESettings.ec:625
 msgid "Tiny C Compiler / GNU Make"
 msgstr "Tiny C Compiler / GNU Make"
 
index 0e6a816..70c3752 100644 (file)
@@ -90,19 +90,19 @@ msgstr "Error: Project configuration (%s) was not found.\n"
 msgid "Error: Unable to open project file (%s) due to unknown error.\n"
 msgstr "Error: Unable to open project file (%s) due to unknown error.\n"
 
-#: ./../ide/src/IDESettings.ec:626
+#: ./../ide/src/IDESettings.ec:624
 msgid "GNU Compiler Collection (GCC) / GNU Make"
 msgstr "GNU Compiler Collection (GCC) / GNU Make"
 
-#: ./../ide/src/IDESettings.ec:629
+#: ./../ide/src/IDESettings.ec:627
 msgid "Microsoft Visual Studio 2005 (8.0) Compiler"
 msgstr "Microsoft Visual Studio 2005 (8.0) Compiler"
 
-#: ./../ide/src/IDESettings.ec:630
+#: ./../ide/src/IDESettings.ec:628
 msgid "Microsoft Visual Studio 2008 (9.0) Compiler"
 msgstr "Microsoft Visual Studio 2008 (9.0) Compiler"
 
-#: ./../ide/src/IDESettings.ec:632
+#: ./../ide/src/IDESettings.ec:630
 msgid "Microsoft Visual Studio 2010 (10.0) Compiler"
 msgstr "Microsoft Visual Studio 2010 (10.0) Compiler"
 
@@ -110,7 +110,7 @@ msgstr "Microsoft Visual Studio 2010 (10.0) Compiler"
 msgid "Notice: Project configuration (%s) will be used.\n"
 msgstr "Notice: Project configuration (%s) will be used.\n"
 
-#: ./../ide/src/IDESettings.ec:628
+#: ./../ide/src/IDESettings.ec:626
 msgid "Portable C Compiler / GNU Make"
 msgstr "Portable C Compiler / GNU Make"
 
@@ -118,7 +118,7 @@ msgstr "Portable C Compiler / GNU Make"
 msgid "Syntax:\n"
 msgstr "Syntax:\n"
 
-#: ./../ide/src/IDESettings.ec:627
+#: ./../ide/src/IDESettings.ec:625
 msgid "Tiny C Compiler / GNU Make"
 msgstr "Tiny C Compiler / GNU Make"
 
index 3f168e0..3c0e876 100644 (file)
@@ -10,7 +10,7 @@ msgstr ""
 "Content-Transfer-Encoding: 8bit\n"
 "X-Poedit-Basepath: ../\n"
 
-#: ./src/project/Project.ec:1356
+#: ./src/project/Project.ec:1362
 msgid "   %s: No such file or directory\n"
 msgstr "   %s: No such file or directory\n"
 
@@ -54,7 +54,7 @@ msgstr " configuration?"
 msgid " file is not part of any project.\n"
 msgstr " file is not part of any project.\n"
 
-#: ./src/project/ProjectView.ec:1759
+#: ./src/project/ProjectView.ec:1768
 msgid " was "
 msgstr " was "
 
@@ -180,7 +180,7 @@ msgstr "Active Configuration..."
 msgid "Add Files to Folder..."
 msgstr "Add Files to Folder..."
 
-#: ./src/project/ProjectView.ec:1704
+#: ./src/project/ProjectView.ec:1713
 msgid "Add Files to Project"
 msgstr "Add Files to Project"
 
@@ -201,7 +201,7 @@ msgstr "Add New Form..."
 msgid "Add Resources to Folder..."
 msgstr "Add Resources to Folder..."
 
-#: ./src/project/ProjectView.ec:1704
+#: ./src/project/ProjectView.ec:1713
 msgid "Add Resources to Project"
 msgstr "Add Resources to Project"
 
@@ -251,11 +251,11 @@ msgstr "All Debug Views"
 msgid "All files"
 msgstr "All files"
 
-#: ./src/project/ProjectView.ec:1994
+#: ./src/project/ProjectView.ec:2003
 msgid "Are you sure you want to remove the \"%s\" project\nfrom this workspace?"
 msgstr "Are you sure you want to remove the \"%s\" project\nfrom this workspace?"
 
-#: ./src/project/ProjectView.ec:1971
+#: ./src/project/ProjectView.ec:1980
 msgid "Are you sure you want to remove the folder \"%s\"\nand all of its contents from the project?"
 msgstr "Are you sure you want to remove the folder \"%s\"\nand all of its contents from the project?"
 
@@ -285,7 +285,7 @@ msgstr "Attach"
 msgid "Attach %s"
 msgstr "Attach %s"
 
-#: ./src/project/ProjectView.ec:1305
+#: ./src/project/ProjectView.ec:1314
 msgid "Attempting to debug non-debug configuration\nProceed anyways?"
 msgstr "Attempting to debug non-debug configuration\nProceed anyways?"
 
@@ -337,11 +337,11 @@ msgstr "Build project"
 msgid "Builder"
 msgstr "Builder"
 
-#: ./src/project/Project.ec:1433
+#: ./src/project/Project.ec:1439
 msgid "Building library...\n"
 msgstr "Building library...\n"
 
-#: ./src/project/ProjectView.ec:639
+#: ./src/project/ProjectView.ec:648
 msgid "Building project %s using the %s configuration...\n"
 msgstr "Building project %s using the %s configuration...\n"
 
@@ -403,7 +403,7 @@ msgstr "Clean"
 msgid "Clean project"
 msgstr "Clean project"
 
-#: ./src/project/ProjectView.ec:882
+#: ./src/project/ProjectView.ec:891
 msgid "Cleaning project %s using the %s configuration...\n"
 msgstr "Cleaning project %s using the %s configuration...\n"
 
@@ -477,15 +477,15 @@ msgstr "Compilers"
 msgid "Compilers Detection"
 msgstr "Compilers Detection"
 
-#: ./src/project/ProjectView.ec:1035
+#: ./src/project/ProjectView.ec:1044
 msgid "Compiling single file %s in project %s using the %s configuration...\n"
 msgstr "Compiling single file %s in project %s using the %s configuration...\n"
 
-#: ./src/project/ProjectView.ec:1037
+#: ./src/project/ProjectView.ec:1046
 msgid "Compiling single file %s in project %s...\n"
 msgstr "Compiling single file %s in project %s...\n"
 
-#: ./src/project/Project.ec:1404
+#: ./src/project/Project.ec:1410
 msgid "Compiling...\n"
 msgstr "Compiling...\n"
 
@@ -523,7 +523,7 @@ msgstr "Console Application"
 msgid "Copy"
 msgstr "Copy"
 
-#: ./src/project/ProjectView.ec:1740
+#: ./src/project/ProjectView.ec:1749
 msgid "Couldn't create file."
 msgstr "Couldn't create file."
 
@@ -572,7 +572,7 @@ msgstr "Debugger Fatal Error: GDB lost\n"
 msgid "Debugger required for symbol evaluation in \"%s\""
 msgstr "Debugger required for symbol evaluation in \"%s\""
 
-#: ./src/project/ProjectView.ec:1303
+#: ./src/project/ProjectView.ec:1312
 msgid "Debugging compressed applications is not supported\n"
 msgstr "Debugging compressed applications is not supported\n"
 
@@ -612,11 +612,11 @@ msgstr "Delete "
 msgid "Delete %s"
 msgstr "Delete %s"
 
-#: ./src/project/ProjectView.ec:1972
+#: ./src/project/ProjectView.ec:1981
 msgid "Delete Folder"
 msgstr "Delete Folder"
 
-#: ./src/project/Project.ec:1754
+#: ./src/project/Project.ec:1760
 msgid "Deleting target and object files..."
 msgstr "Deleting target and object files..."
 
@@ -707,7 +707,7 @@ msgstr "Environment Variables"
 msgid "Error creating directory"
 msgstr "Error creating directory"
 
-#: ./src/project/Project.ec:1702
+#: ./src/project/Project.ec:1708
 msgid "Error executing make (%s) command\n"
 msgstr "Error executing make (%s) command\n"
 
@@ -762,7 +762,7 @@ msgstr "Exit"
 msgid "Expression"
 msgstr "Expression"
 
-#: ./src/project/Project.ec:1557
+#: ./src/project/Project.ec:1563
 msgid "Fatal Error: child process terminated unexpectedly\n"
 msgstr "Fatal Error: child process terminated unexpectedly\n"
 
@@ -775,7 +775,7 @@ msgstr "Fatal Error: child process terminated unexpectedly\n"
 msgid "File"
 msgstr "File"
 
-#: ./src/project/ProjectView.ec:1228
+#: ./src/project/ProjectView.ec:1237
 #: ./src/ide.ec:2410
 msgid "File %s is excluded from current build configuration.\n"
 msgstr "File %s is excluded from current build configuration.\n"
@@ -785,7 +785,7 @@ msgstr "File %s is excluded from current build configuration.\n"
 msgid "File doesn't exist."
 msgstr "File doesn't exist."
 
-#: ./src/project/ProjectView.ec:1729
+#: ./src/project/ProjectView.ec:1738
 #: ./src/ide.ec:2034
 msgid "File doesn't exist. Create?"
 msgstr "File doesn't exist. Create?"
@@ -877,7 +877,7 @@ msgstr "GDB Command"
 msgid "GIF Image"
 msgstr "GIF Image"
 
-#: ./src/IDESettings.ec:626
+#: ./src/IDESettings.ec:624
 msgid "GNU Compiler Collection (GCC) / GNU Make"
 msgstr "GNU Compiler Collection (GCC) / GNU Make"
 
@@ -894,7 +894,7 @@ msgstr "Generating "
 msgid "Generating Makefile & Dependencies..."
 msgstr "Generating Makefile & Dependencies..."
 
-#: ./src/project/Project.ec:1409
+#: ./src/project/Project.ec:1415
 msgid "Generating symbols...\n"
 msgstr "Generating symbols...\n"
 
@@ -1045,7 +1045,7 @@ msgstr "License"
 msgid "Linker"
 msgstr "Linker"
 
-#: ./src/project/Project.ec:1469
+#: ./src/project/Project.ec:1475
 msgid "Linker Error"
 msgstr "Linker Error"
 
@@ -1053,7 +1053,7 @@ msgstr "Linker Error"
 msgid "Linker Options"
 msgstr "Linker Options"
 
-#: ./src/project/Project.ec:1422
+#: ./src/project/Project.ec:1428
 msgid "Linking...\n"
 msgstr "Linking...\n"
 
@@ -1106,15 +1106,15 @@ msgstr "Method still contains code. Are you sure you want to delete it?"
 msgid "Methods"
 msgstr "Methods"
 
-#: ./src/IDESettings.ec:629
+#: ./src/IDESettings.ec:627
 msgid "Microsoft Visual Studio 2005 (8.0) Compiler"
 msgstr "Microsoft Visual Studio 2005 (8.0) Compiler"
 
-#: ./src/IDESettings.ec:630
+#: ./src/IDESettings.ec:628
 msgid "Microsoft Visual Studio 2008 (9.0) Compiler"
 msgstr "Microsoft Visual Studio 2008 (9.0) Compiler"
 
-#: ./src/IDESettings.ec:632
+#: ./src/IDESettings.ec:630
 msgid "Microsoft Visual Studio 2010 (10.0) Compiler"
 msgstr "Microsoft Visual Studio 2010 (10.0) Compiler"
 
@@ -1149,7 +1149,7 @@ msgstr "NUM"
 msgid "Name"
 msgstr "Name"
 
-#: ./src/project/ProjectView.ec:1777
+#: ./src/project/ProjectView.ec:1786
 msgid "Name Conflict"
 msgstr "Name Conflict"
 
@@ -1329,7 +1329,7 @@ msgstr "Platforms: "
 msgid "Pointer"
 msgstr "Pointer"
 
-#: ./src/IDESettings.ec:628
+#: ./src/IDESettings.ec:626
 msgid "Portable C Compiler / GNU Make"
 msgstr "Portable C Compiler / GNU Make"
 
@@ -1375,11 +1375,11 @@ msgstr "Project Active Configuration"
 msgid "Project Already Exists"
 msgstr "Project Already Exists"
 
-#: ./src/project/ProjectView.ec:782
+#: ./src/project/ProjectView.ec:791
 msgid "Project Build"
 msgstr "Project Build"
 
-#: ./src/project/ProjectView.ec:878
+#: ./src/project/ProjectView.ec:887
 msgid "Project Clean"
 msgstr "Project Clean"
 
@@ -1396,7 +1396,7 @@ msgstr "Project File"
 msgid "Project Files (*.epj)"
 msgstr "Project Files (*.epj)"
 
-#: ./src/project/ProjectView.ec:809
+#: ./src/project/ProjectView.ec:818
 msgid "Project Link"
 msgstr "Project Link"
 
@@ -1404,11 +1404,11 @@ msgstr "Project Link"
 msgid "Project Name"
 msgstr "Project Name"
 
-#: ./src/project/ProjectView.ec:917
+#: ./src/project/ProjectView.ec:926
 msgid "Project Real Clean"
 msgstr "Project Real Clean"
 
-#: ./src/project/ProjectView.ec:842
+#: ./src/project/ProjectView.ec:851
 msgid "Project Rebuild"
 msgstr "Project Rebuild"
 
@@ -1483,7 +1483,7 @@ msgstr "Rebuild"
 msgid "Rebuild project"
 msgstr "Rebuild project"
 
-#: ./src/project/ProjectView.ec:846
+#: ./src/project/ProjectView.ec:855
 msgid "Rebuilding project %s using the %s configuration...\n"
 msgstr "Rebuilding project %s using the %s configuration...\n"
 
@@ -1516,7 +1516,7 @@ msgstr "Relink"
 msgid "Relink project"
 msgstr "Relink project"
 
-#: ./src/project/ProjectView.ec:813
+#: ./src/project/ProjectView.ec:822
 msgid "Relinking project %s using the %s configuration...\n"
 msgstr "Relinking project %s using the %s configuration...\n"
 
@@ -1525,7 +1525,7 @@ msgstr "Relinking project %s using the %s configuration...\n"
 msgid "Remove"
 msgstr "Remove"
 
-#: ./src/project/ProjectView.ec:1995
+#: ./src/project/ProjectView.ec:2004
 msgid "Remove Project"
 msgstr "Remove Project"
 
@@ -1533,7 +1533,7 @@ msgstr "Remove Project"
 msgid "Remove project from workspace"
 msgstr "Remove project from workspace"
 
-#: ./src/project/ProjectView.ec:921
+#: ./src/project/ProjectView.ec:930
 msgid "Removing intermediate objects directory for project %s using the %s configuration...\n"
 msgstr "Removing intermediate objects directory for project %s using the %s configuration...\n"
 
@@ -1575,7 +1575,7 @@ msgstr "Restart"
 msgid "Resume"
 msgstr "Resume"
 
-#: ./src/project/ProjectView.ec:1301
+#: ./src/project/ProjectView.ec:1310
 #: ./src/ide.ec:250
 #: ./src/ide.ec:898
 msgid "Run"
@@ -1689,7 +1689,7 @@ msgstr "Settings..."
 msgid "Shared Library"
 msgstr "Shared Library"
 
-#: ./src/project/ProjectView.ec:1301
+#: ./src/project/ProjectView.ec:1310
 msgid "Shared and static libraries cannot be run like executables."
 msgstr "Shared and static libraries cannot be run like executables."
 
@@ -1720,8 +1720,8 @@ msgstr "Stack Depth"
 msgid "Start"
 msgstr "Start"
 
-#: ./src/project/ProjectView.ec:1303
-#: ./src/project/ProjectView.ec:1305
+#: ./src/project/ProjectView.ec:1312
+#: ./src/project/ProjectView.ec:1314
 msgid "Starting Debug"
 msgstr "Starting Debug"
 
@@ -1808,7 +1808,7 @@ msgstr "Target Platform"
 msgid "Target Type"
 msgstr "Target Type"
 
-#: ./src/project/Project.ec:1758
+#: ./src/project/Project.ec:1764
 msgid "Target and object files deleted\n"
 msgstr "Target and object files deleted\n"
 
@@ -1846,7 +1846,7 @@ msgstr "The "
 msgid "The document %s was modified by another application.\nWould you like to reload it and lose your changes?"
 msgstr "The document %s was modified by another application.\nWould you like to reload it and lose your changes?"
 
-#: ./src/project/ProjectView.ec:1758
+#: ./src/project/ProjectView.ec:1767
 msgid "The following file"
 msgstr "The following file"
 
@@ -1899,7 +1899,7 @@ msgstr "Tile Horizontally"
 msgid "Tile Vertically"
 msgstr "Tile Vertically"
 
-#: ./src/IDESettings.ec:627
+#: ./src/IDESettings.ec:625
 msgid "Tiny C Compiler / GNU Make"
 msgstr "Tiny C Compiler / GNU Make"
 
@@ -1948,7 +1948,7 @@ msgstr "Unknown output"
 msgid "Unknown prompt"
 msgstr "Unknown prompt"
 
-#: ./src/project/ProjectView.ec:1062
+#: ./src/project/ProjectView.ec:1071
 #: ./src/designer/CodeEditor.ec:2417
 msgid "Untitled %d"
 msgstr "Untitled %d"
@@ -2059,7 +2059,7 @@ msgstr "Would you like to save changes made to the project options?"
 msgid "Would you like to save changes made to the workspace options?"
 msgstr "Would you like to save changes made to the workspace options?"
 
-#: ./src/project/Project.ec:1435
+#: ./src/project/Project.ec:1441
 msgid "Writing symbol loader...\n"
 msgstr "Writing symbol loader...\n"
 
@@ -2079,8 +2079,8 @@ msgstr "You must provide a valid source directory in order to place a breakpoint
 msgid "You must specify a search location."
 msgstr "You must specify a search location."
 
-#: ./src/project/Project.ec:1287
-#: ./src/project/Project.ec:1549
+#: ./src/project/Project.ec:1293
+#: ./src/project/Project.ec:1555
 msgid "\nBuild cancelled by user.\n"
 msgstr "\nBuild cancelled by user.\n"
 
@@ -2116,11 +2116,11 @@ msgstr "eC/C/C++ Files (*.ec, *.eh, *.c, *.cpp, *.cc, *.cxx, *.h, *.hpp, *.hh, *
 msgid "eC/C/C++ Source Files (*.ec, *.c, *.cpp, *.cc, *.cxx)"
 msgstr "eC/C/C++ Source Files (*.ec, *.c, *.cpp, *.cc, *.cxx)"
 
-#: ./src/project/Project.ec:1564
+#: ./src/project/Project.ec:1570
 msgid "error"
 msgstr "error"
 
-#: ./src/project/Project.ec:1564
+#: ./src/project/Project.ec:1570
 msgid "errors"
 msgstr "errors"
 
@@ -2138,15 +2138,15 @@ msgstr "found"
 msgid "inside %s, %s\n"
 msgstr "inside %s, %s\n"
 
-#: ./src/project/Project.ec:1566
+#: ./src/project/Project.ec:1572
 msgid "no error, "
 msgstr "no error, "
 
-#: ./src/project/Project.ec:1571
+#: ./src/project/Project.ec:1577
 msgid "no warning\n"
 msgstr "no warning\n"
 
-#: ./src/project/ProjectView.ec:1761
+#: ./src/project/ProjectView.ec:1770
 msgid "not added because of identical file name conflict within the project.\n\n"
 msgstr "not added because of identical file name conflict within the project.\n\n"
 
@@ -2159,7 +2159,7 @@ msgstr "replaced"
 msgid "s"
 msgstr "s"
 
-#: ./src/project/ProjectView.ec:1760
+#: ./src/project/ProjectView.ec:1769
 msgid "s were "
 msgstr "s were "
 
@@ -2167,11 +2167,11 @@ msgstr "s were "
 msgid "unknown source\n"
 msgstr "unknown source\n"
 
-#: ./src/project/Project.ec:1569
+#: ./src/project/Project.ec:1575
 msgid "warning"
 msgstr "warning"
 
-#: ./src/project/Project.ec:1569
+#: ./src/project/Project.ec:1575
 msgid "warnings"
 msgstr "warnings"
 
index 50266c3..5157db1 100644 (file)
@@ -910,7 +910,7 @@ private:
    }
 
 
-   char * GetObjDirExpression(CompilerConfig compiler, ProjectConfig config)
+   char * GetObjDirExpression(ProjectConfig config)
    {
       // TODO: Support platform options
       char * expression = localObjectsDirectory;
@@ -921,13 +921,13 @@ private:
 
    DirExpression GetObjDir(CompilerConfig compiler, ProjectConfig config)
    {
-      char * expression = GetObjDirExpression(compiler, config);
+      char * expression = GetObjDirExpression(config);
       DirExpression objDir { type = intermediateObjectsDir };
       objDir.Evaluate(expression, this, compiler, config);
       return objDir;
    }
 
-   char * GetTargetDirExpression(CompilerConfig compiler, ProjectConfig config)
+   char * GetTargetDirExpression(ProjectConfig config)
    {
       // TODO: Support platform options
       char * expression = localTargetDirectory;
@@ -938,7 +938,7 @@ private:
 
    DirExpression GetTargetDir(CompilerConfig compiler, ProjectConfig config)
    {
-      char * expression = GetTargetDirExpression(compiler, config);
+      char * expression = GetTargetDirExpression(config);
       DirExpression targetDir { type = DirExpressionType::targetDir /*intermediateObjectsDir*/};
       targetDir.Evaluate(expression, this, compiler, config);
       return targetDir;
@@ -1181,6 +1181,12 @@ private:
          PathCatSlash(cfDir, ideSettings.compilerConfigsDir);
          result = true;
       }
+      else
+      {
+         // Default to <ProjectDir>/configs if unset
+         PathCatSlash(cfDir, "configs");
+         result = true;
+      }
       if(cfDir && cfDir[0] && cfDir[strlen(cfDir)-1] != '/')
          strcat(cfDir, "/");
       return result;
@@ -1909,7 +1915,7 @@ private:
             f.Printf("# TOOLCHAIN\n\n");
 
             //f.Printf("SHELL := %s\n", "ar"/*compiler.arCommand*/); // is this really needed?
-            f.Printf("CPP := $(CCACHE_COMPILE) $(DISTCC_COMPILE) %s\n", compiler.cppCommand);
+            f.Printf("CPP := %s\n", compiler.cppCommand);
             f.Printf("CC := $(CCACHE_COMPILE) $(DISTCC_COMPILE) %s\n", compiler.ccCommand);
             f.Printf("CXX := $(CCACHE_COMPILE) $(DISTCC_COMPILE) %s\n", compiler.cxxCommand);
             f.Printf("ECP := %s\n", compiler.ecpCommand);
@@ -1943,6 +1949,11 @@ private:
                f.Printf("\nPLATFORM = %s\n", (char *)compiler.targetPlatform);
             }
 
+            if(gccCompiler)
+            {
+               f.Printf("\nCFLAGS += -fmessage-length=0\n");
+            }
+
             if(compiler.includeDirs && compiler.includeDirs.count)
             {
                f.Printf("\nCFLAGS +=");
@@ -1979,8 +1990,7 @@ private:
       return result;
    }
 
-   bool GenerateMakefile(char * altMakefilePath, bool noResources, char * includemkPath,
-      CompilerConfig compiler, ProjectConfig config)
+   bool GenerateMakefile(char * altMakefilePath, bool noResources, char * includemkPath, ProjectConfig config)
    {
       bool result = false;
       char filePath[MAX_LOCATION];
@@ -1996,14 +2006,6 @@ private:
          PathCatSlash(filePath, makeFile);
       }
 
-#if defined(__WIN32__) && !defined(MAKEFILE_GENERATOR)
-      if(compiler.type.isVC)
-      {
-         GenerateVSSolutionFile(this, compiler);
-         GenerateVCProjectFile(this, compiler);
-      }
-      else
-#endif
       f = FileOpen(altMakefilePath ? altMakefilePath : filePath, write);
 
       /*SetPath(false, compiler, config);
@@ -2023,20 +2025,15 @@ private:
          char targetDirExpNoSpaces[MAX_LOCATION];
          char fixedModuleName[MAX_FILENAME];
          char fixedConfigName[MAX_FILENAME];
-         char fixedCompilerName[MAX_FILENAME];
          int c, len;
          // Non-zero if we're building eC code
          // We'll have to be careful with this when merging configs where eC files can be excluded in some configs and included in others
          int numCObjects = 0;
          bool containsCXX = false; // True if the project contains a C++ file
          bool sameObjTargetDirs;
-         DirExpression objDirExp = GetObjDir(compiler, config);
+         String objDirExp = GetObjDirExpression(config);
          TargetTypes targetType = GetTargetType(config);
 
-         bool crossCompiling = compiler.targetPlatform != runtimePlatform;
-         bool gccCompiler = compiler.ccCommand && (strstr(compiler.ccCommand, "gcc") != null || strstr(compiler.ccCommand, "g++") != null);
-         bool tccCompiler = compiler.ccCommand && strstr(compiler.ccCommand, "tcc") != null;
-         bool defaultPreprocessor = compiler.cppCommand && (strstr(compiler.cppCommand, "gcc") != null || compiler.cppCommand && strstr(compiler.cppCommand, "cpp") != null);
          char cfDir[MAX_LOCATION];
          int objectsParts, eCsourcesParts;
          Array<String> listItems { };
@@ -2044,21 +2041,17 @@ private:
          Map<String, NameCollisionInfo> namesInfo { };
          bool forceBitDepth = false;
 
-         ReplaceSpaces(objDirNoSpaces, objDirExp.dir);
-         strcpy(targetDir, GetTargetDirExpression(compiler, config));
+         ReplaceSpaces(objDirNoSpaces, objDirExp);
+         strcpy(targetDir, GetTargetDirExpression(config));
          ReplaceSpaces(targetDirExpNoSpaces, targetDir);
 
-         strcpy(objDirExpNoSpaces, GetObjDirExpression(compiler, config));
+         strcpy(objDirExpNoSpaces, GetObjDirExpression(config));
          ChangeCh(objDirExpNoSpaces, '\\', '/'); // TODO: this is a hack, paths should never include win32 path seperators - fix this in ProjectSettings and ProjectLoad instead
          ReplaceSpaces(objDirExpNoSpaces, objDirExpNoSpaces);
          ReplaceSpaces(resDirNoSpaces, resNode.path ? resNode.path : "");
-         //ReplaceSpaces(fixedPrjName, name);
          ReplaceSpaces(fixedModuleName, moduleName);
          ReplaceSpaces(fixedConfigName, GetConfigName(config));
-         ReplaceSpaces(fixedCompilerName, compiler.name);
-         //CamelCase(fixedModuleName); // case is important for static linking
          CamelCase(fixedConfigName);
-         CamelCase(fixedCompilerName);
 
          sameObjTargetDirs = !fstrcmp(objDirExpNoSpaces, targetDirExpNoSpaces);
 
@@ -2159,7 +2152,7 @@ private:
          f.Printf("# INCLUDES\n\n");
 
          f.Printf("include %s\n", includemkPath ? includemkPath : "$(_CF_DIR)crossplatform.mk");
-         f.Printf("include $(_CF_DIR)$(PLATFORM)-$(COMPILER).cf\n", (char*)runtimePlatform, fixedCompilerName);
+         f.Printf("include $(_CF_DIR)$(PLATFORM)-$(COMPILER).cf\n");
          f.Printf("\n");
 
          f.Printf("# VARIABLES\n\n");
@@ -2215,7 +2208,9 @@ private:
          }
          f.Printf("\n");
 
-         varStringLenDiffs["$(OBJ)"] = strlen(objDirNoSpaces) - 6;
+         // Use something fixed here, to not cause Makefile differences across compilers...
+         varStringLenDiffs["$(OBJ)"] = 30; // strlen("obj/memoryGuard.android.gcc-4.6.2") - 6;
+         // varStringLenDiffs["$(OBJ)"] = strlen(objDirNoSpaces) - 6;
 
          topNode.GenMakefileGetNameCollisionInfo(namesInfo, config);
 
@@ -2377,17 +2372,13 @@ private:
          }
 
          f.Printf("CFLAGS +=");
-         if(gccCompiler)
+         //if(gccCompiler)
          {
-            f.Printf(" -fmessage-length=0 $(OPTIMIZE)");
-            //if(compiler.targetPlatform.is32Bits)
+            f.Printf(" $(OPTIMIZE)");
             forceBitDepth = (options && options.buildBitDepth) || numCObjects;
             if(forceBitDepth)
                f.Printf((!options || !options.buildBitDepth || options.buildBitDepth == bits32) ? " -m32" : " -m64");
-            //else if(compiler.targetPlatform.is64Bits)
-            //   f.Printf(" -m64");
             f.Printf(" $(FPIC)");
-            //f.Printf(" -fpack-struct");
          }
          switch(GetWarnings(config))
          {
@@ -2413,8 +2404,7 @@ private:
             OutputListOption(f, "I", options.includeDirs, lineEach, true);
          f.Printf("\n\n");
 
-         f.Printf("CECFLAGS +=%s%s%s%s", defaultPreprocessor ? "" : " -cpp ", defaultPreprocessor ? "" : compiler.cppCommand,
-               crossCompiling ? " -t " : "", crossCompiling ? (char*)compiler.targetPlatform : "");
+         f.Printf("CECFLAGS += -cpp $(call escspace,$(CPP)) -t $(PLATFORM)");
          f.Printf("\n\n");
 
          f.Printf("ECFLAGS +=");
@@ -2614,14 +2604,14 @@ private:
          f.Printf("# SYMBOL RULES\n\n");
          {
             Map<Platform, bool> excludedPlatforms { };
-            topNode.GenMakefilePrintSymbolRules(f, this, compiler, config, excludedPlatforms);
+            topNode.GenMakefilePrintSymbolRules(f, this, config, excludedPlatforms);
             delete excludedPlatforms;
          }
 
          f.Printf("# C OBJECT RULES\n\n");
          {
             Map<Platform, bool> excludedPlatforms { };
-            topNode.GenMakefilePrintCObjectRules(f, this, compiler, config, excludedPlatforms);
+            topNode.GenMakefilePrintCObjectRules(f, this, config, excludedPlatforms);
             delete excludedPlatforms;
          }
 
@@ -2630,12 +2620,12 @@ private:
          // see we-have-file-specific-options in ProjectNode.ec
          {
             Map<Platform, bool> excludedPlatforms { };
-            topNode.GenMakefilePrintObjectRules(f, this, namesInfo, compiler, config, excludedPlatforms);
+            topNode.GenMakefilePrintObjectRules(f, this, namesInfo, config, excludedPlatforms);
             delete excludedPlatforms;
          }
 
          if(numCObjects)
-            GenMakefilePrintMainObjectRule(f, compiler, config);
+            GenMakefilePrintMainObjectRule(f, config);
 
          f.Printf("clean: objdir%s\n", sameObjTargetDirs ? "" : " targetdir");
          f.Printf("\t$(call rmq,%s$(TARGET))\n", numCObjects ? "$(OBJ)$(MODULE).main.c $(OBJ)$(MODULE).main.ec $(OBJ)$(MODULE).main$(I) $(OBJ)$(MODULE).main$(S) " : "");
@@ -2656,7 +2646,7 @@ private:
          f.Printf("\n");
 
          delete f;
-         delete objDirExp;
+
          listItems.Free();
          delete listItems;
          varStringLenDiffs.Free();
@@ -2675,7 +2665,7 @@ private:
       return result;
    }
 
-   void GenMakefilePrintMainObjectRule(File f, CompilerConfig compiler, ProjectConfig config)
+   void GenMakefilePrintMainObjectRule(File f, ProjectConfig config)
    {
       char extension[MAX_EXTENSION] = "c";
       char modulePath[MAX_LOCATION];
@@ -2683,9 +2673,9 @@ private:
       DualPipe dep;
       char command[2048];
       char objDirNoSpaces[MAX_LOCATION];
-      DirExpression objDirExp = GetObjDir(compiler, config);
+      String objDirExp = GetObjDirExpression(config);
 
-      ReplaceSpaces(objDirNoSpaces, objDirExp.dir);
+      ReplaceSpaces(objDirNoSpaces, objDirExp);
       ReplaceSpaces(fixedModuleName, moduleName);
       
       //sprintf(fixedModuleName, "%s.main", fixedPrjName);
@@ -2767,8 +2757,6 @@ private:
 #endif
 
       f.Printf("\t$(CC) $(CFLAGS) $(FVISIBILITY) -c $(OBJ)$(MODULE).main.%s -o $(OBJ)$(MODULE).main$(O)\n\n", extension);
-
-      delete objDirExp;
    }
 
    void MatchProjectAndConfigPlatformOptions(ProjectConfig config, Platform platform,
index 9f21cb1..3bad78b 100644 (file)
@@ -1488,7 +1488,7 @@ private:
       return count;
    }
 
-   void GenMakefilePrintSymbolRules(File f, Project project, CompilerConfig compiler,
+   void GenMakefilePrintSymbolRules(File f, Project project,
          ProjectConfig prjConfig, Map<Platform, bool> parentExcludedPlatforms)
    {
       int ifCount = 0;
@@ -1648,7 +1648,7 @@ private:
                for(child : files)
                {
                   if(child.type != resources && (child.type == folder || !child.GetIsExcluded(prjConfig)))
-                     child.GenMakefilePrintSymbolRules(f, project, compiler, prjConfig, excludedPlatforms);
+                     child.GenMakefilePrintSymbolRules(f, project, prjConfig, excludedPlatforms);
                }
             }
             CloseRulesPlatformExclusionIfs(f, ifCount);
@@ -1658,7 +1658,7 @@ private:
       delete platforms;
    }
 
-   void GenMakefilePrintPrepecsRules(File f, Project project, CompilerConfig compiler,
+   void GenMakefilePrintPrepecsRules(File f, Project project,
          ProjectConfig prjConfig, Map<Platform, bool> parentExcludedPlatforms)
    {
       int ifCount = 0;
@@ -1744,7 +1744,7 @@ private:
                for(child : files)
                {
                   if(child.type != resources && (child.type == folder || !child.GetIsExcluded(prjConfig)))
-                     child.GenMakefilePrintPrepecsRules(f, project, compiler, prjConfig, excludedPlatforms);
+                     child.GenMakefilePrintPrepecsRules(f, project, prjConfig, excludedPlatforms);
                }
             }
             CloseRulesPlatformExclusionIfs(f, ifCount);
@@ -1754,7 +1754,7 @@ private:
       delete platforms;
    }
 
-   void GenMakefilePrintCObjectRules(File f, Project project, CompilerConfig compiler,
+   void GenMakefilePrintCObjectRules(File f, Project project,
       ProjectConfig prjConfig, Map<Platform, bool> parentExcludedPlatforms)
    {
       int ifCount = 0;
@@ -1917,7 +1917,7 @@ private:
                for(child : files)
                {
                   if(child.type != resources && (child.type == folder || !child.GetIsExcluded(prjConfig)))
-                     child.GenMakefilePrintCObjectRules(f, project, compiler, prjConfig, excludedPlatforms);
+                     child.GenMakefilePrintCObjectRules(f, project, prjConfig, excludedPlatforms);
                }
             }
             CloseRulesPlatformExclusionIfs(f, ifCount);
@@ -1929,7 +1929,7 @@ private:
 
    void GenMakefilePrintObjectRules(File f, Project project,
       Map<String, NameCollisionInfo> namesInfo,
-      CompilerConfig compiler, ProjectConfig prjConfig,
+      ProjectConfig prjConfig,
       Map<Platform, bool> parentExcludedPlatforms)
    {
       int ifCount = 0;
@@ -1969,9 +1969,9 @@ private:
 
             // *** Dependency command ***
             if(!strcmpi(extension, "ec"))
-               sprintf(command, "%s -MT $(OBJ)%s.o -MM $(OBJ)%s.c", compiler.ccCommand, moduleName, moduleName);
+               sprintf(command, "%s -MT $(OBJ)%s.o -MM $(OBJ)%s.c", "$(CPP)", moduleName, moduleName);
             else
-               sprintf(command, "%s -MT $(OBJ)%s.o -MM %s%s.%s", (!strcmpi(extension, "cc") || !strcmpi(extension, "cxx") || !strcmpi(extension, "cpp")) ? compiler.cxxCommand : compiler.ccCommand,
+               sprintf(command, "%s -MT $(OBJ)%s.o -MM %s%s.%s", (!strcmpi(extension, "cc") || !strcmpi(extension, "cxx") || !strcmpi(extension, "cpp")) ? "$(CXX)" : "$(CC)",
                   moduleName, modulePath, moduleName, extension);
 
             if(!strcmpi(extension, "ec"))
@@ -2093,7 +2093,7 @@ private:
                for(child : files)
                {
                   if(child.type != resources && (child.type == folder || !child.GetIsExcluded(prjConfig)))
-                     child.GenMakefilePrintObjectRules(f, project, namesInfo, compiler, prjConfig, excludedPlatforms);
+                     child.GenMakefilePrintObjectRules(f, project, namesInfo, prjConfig, excludedPlatforms);
                }
             }
             CloseRulesPlatformExclusionIfs(f, ifCount);
index e25ff2c..b89ebaf 100644 (file)
@@ -623,7 +623,16 @@ class ProjectView : Window
 
          project.GenerateCrossPlatformCf();
          project.GenerateCompilerMk(compiler);
-         project.GenerateMakefile(null, false, null, compiler, config);
+
+#if defined(__WIN32__)  // I'm guessing we'll want to support generating VS files on Linux as well...
+         if(compiler.type.isVC)
+         {
+            GenerateVSSolutionFile(project, compiler);
+            GenerateVCProjectFile(project, compiler);
+         }
+         else
+#endif
+            project.GenerateMakefile(null, false, null, config);
 
          ide.statusBar.text = null;
          app.UpdateDisplay();