buildsystem;epj2make;ide; (#1035) remove any ECERE_SDK_SRC stuff from Makefiles and...
authorRejean Loyer <redj@ecere.com>
Tue, 21 Jan 2014 15:06:16 +0000 (10:06 -0500)
committerRejean Loyer <redj@ecere.com>
Mon, 3 Feb 2014 18:36:32 +0000 (13:36 -0500)
epj2make/epj2make.ec
ide/src/project/Project.ec
ide/src/project/ProjectNode.ec
ide/src/project/ProjectView.ec

index 8a85b5b..f054fb8 100644 (file)
@@ -359,7 +359,7 @@ class epj2makeApp : GuiApplication
                   }
                   if(valid)
                   {
-                     project.GenerateCompilerCf(defaultCompiler);
+                     project.GenerateCompilerCf(defaultCompiler, project.topNode.ContainsFilesWithExtension("ec", project.config));
                      project.GenerateCrossPlatformMk(null);
                      if(project.GenerateMakefile(makePath, noResources, includemkPath, project.config))
                      {
index bf25e88..33bc9ba 100644 (file)
@@ -2391,7 +2391,7 @@ private:
       return result;
    }
 
-   bool GenerateCompilerCf(CompilerConfig compiler)
+   bool GenerateCompilerCf(CompilerConfig compiler, bool eC)
    {
       bool result = false;
       char path[MAX_LOCATION];
@@ -2457,9 +2457,18 @@ private:
             f.Printf("CPP := $(CCACHE_COMPILE)$(DISTCC_COMPILE)$(GCC_PREFIX)%s$(_SYSROOT)\n", compiler.cppCommand);
             f.Printf("CC := $(CCACHE_COMPILE)$(DISTCC_COMPILE)$(GCC_PREFIX)%s$(_SYSROOT)\n", compiler.ccCommand);
             f.Printf("CXX := $(CCACHE_COMPILE)$(DISTCC_COMPILE)$(GCC_PREFIX)%s$(_SYSROOT)\n", compiler.cxxCommand);
-            f.Printf("ECP := $(if $(ECP_DEBUG),ide -debug-start \"$(ECERE_SDK_SRC)/compiler/ecp/ecp.epj\" -debug-work-dir \"${CURDIR}\" -@,%s)\n", compiler.ecpCommand);
-            f.Printf("ECC := $(if $(ECC_DEBUG),ide -debug-start \"$(ECERE_SDK_SRC)/compiler/ecc/ecc.epj\" -debug-work-dir \"${CURDIR}\" -@,%s)$(if $(CROSS_TARGET), -t $(TARGET_PLATFORM),)\n", compiler.eccCommand);
-            f.Printf("ECS := $(if $(ECS_DEBUG),ide -debug-start \"$(ECERE_SDK_SRC)/compiler/ecs/ecs.epj\" -debug-work-dir \"${CURDIR}\" -@,%s)$(if $(CROSS_TARGET), -t $(TARGET_PLATFORM),)$(if $(OUTPUT_POT), -outputpot,)$(if $(DISABLED_POOLING), -disabled-pooling,)\n", compiler.ecsCommand);
+            if(eC)
+            {
+               f.Printf("ECP := $(if $(ECP_DEBUG),ide -debug-start \"$(ECERE_SDK_SRC)/compiler/ecp/ecp.epj\" -debug-work-dir \"${CURDIR}\" -@,%s)\n", compiler.ecpCommand);
+               f.Printf("ECC := $(if $(ECC_DEBUG),ide -debug-start \"$(ECERE_SDK_SRC)/compiler/ecc/ecc.epj\" -debug-work-dir \"${CURDIR}\" -@,%s)$(if $(CROSS_TARGET), -t $(TARGET_PLATFORM),)\n", compiler.eccCommand);
+               f.Printf("ECS := $(if $(ECS_DEBUG),ide -debug-start \"$(ECERE_SDK_SRC)/compiler/ecs/ecs.epj\" -debug-work-dir \"${CURDIR}\" -@,%s)$(if $(CROSS_TARGET), -t $(TARGET_PLATFORM),)$(if $(OUTPUT_POT), -outputpot,)$(if $(DISABLED_POOLING), -disabled-pooling,)\n", compiler.ecsCommand);
+            }
+            else
+            {
+               f.Printf("ECP := %s\n", compiler.ecpCommand);
+               f.Printf("ECC := %s$(if $(CROSS_TARGET), -t $(TARGET_PLATFORM),)\n", compiler.eccCommand);
+               f.Printf("ECS := %s$(if $(CROSS_TARGET), -t $(TARGET_PLATFORM),)$(if $(OUTPUT_POT), -outputpot,)$(if $(DISABLED_POOLING), -disabled-pooling,)\n", compiler.ecsCommand);
+            }
             f.Printf("EAR := %s\n", compiler.earCommand);
 
             f.Puts("AS := $(GCC_PREFIX)as\n");
@@ -3158,9 +3167,11 @@ private:
          f.Puts("objdir:\n");
          if(!relObjDir)
             f.Puts("\t$(if $(wildcard $(OBJ)),,$(call mkdirq,$(OBJ)))\n");
-
+         if(numCObjects)
+         {
             f.Puts("\t$(if $(ECERE_SDK_SRC),$(if $(wildcard $(call escspace,$(ECERE_SDK_SRC)/crossplatform.mk)),,@$(call echo,Ecere SDK Source Warning: The value of ECERE_SDK_SRC is pointing to an incorrect ($(ECERE_SDK_SRC)) location.)),)\n");
             f.Puts("\t$(if $(ECERE_SDK_SRC),,$(if $(ECP_DEBUG)$(ECC_DEBUG)$(ECS_DEBUG),@$(call echo,ECC Debug Warning: Please define ECERE_SDK_SRC before using ECP_DEBUG, ECC_DEBUG or ECS_DEBUG),))\n");
+         }
          //f.Puts("# PRE-BUILD COMMANDS\n");
          if(options && options.prebuildCommands)
          {
index cee70a6..5638ef9 100644 (file)
@@ -1404,7 +1404,7 @@ private:
       return result;
    }
 
-   bool ContainsFilesWithExtension(char * extension)
+   bool ContainsFilesWithExtension(char * extension, ProjectConfig prjConfig)
    {
       if(type == file)
       {
@@ -1415,10 +1415,14 @@ private:
       }
       else if(files)
       {
-         bool needed = false;
          for(child : files)
-            if(child.ContainsFilesWithExtension(extension))
-               return true;
+         {
+            if(child.type != resources && (child.type == folder || !prjConfig || !child.GetIsExcluded(prjConfig)))
+            {
+               if(child.ContainsFilesWithExtension(extension, prjConfig))
+                  return true;
+            }
+         }
       }
       return false;
    }
@@ -1698,19 +1702,7 @@ private:
       }
       if(files)
       {
-         bool needed = false;
-         if(ContainsFilesWithExtension("ec"))
-         {
-            for(child : files)
-            {
-               if(child.type != resources && (child.type == folder || !child.GetIsExcluded(prjConfig)))
-               {
-                  needed = true;
-                  break;
-               }
-            }
-         }
-         if(needed)
+         if(ContainsFilesWithExtension("ec", prjConfig))
          {
             for(child : files)
             {
@@ -1774,19 +1766,7 @@ private:
       }
       if(files)
       {
-         bool needed = false;
-         if(ContainsFilesWithExtension("ec"))
-         {
-            for(child : files)
-            {
-               if(child.type != resources && (child.type == folder || !child.GetIsExcluded(prjConfig)))
-               {
-                  needed = true;
-                  break;
-               }
-            }
-         }
-         if(needed)
+         if(ContainsFilesWithExtension("ec", prjConfig))
          {
             for(child : files)
             {
@@ -1930,19 +1910,7 @@ private:
       }
       if(files)
       {
-         bool needed = false;
-         if(ContainsFilesWithExtension("ec"))
-         {
-            for(child : files)
-            {
-               if(child.type != resources && (child.type == folder || !child.GetIsExcluded(prjConfig)))
-               {
-                  needed = true;
-                  break;
-               }
-            }
-         }
-         if(needed)
+         if(ContainsFilesWithExtension("ec", prjConfig))
          {
             for(child : files)
             {
@@ -2494,7 +2462,7 @@ private:
             output.concat("\"");
          }
       }
-      else if(type == project && ContainsFilesWithExtension("ec"))
+      else if(type == project && ContainsFilesWithExtension("ec", prjConfig))
       {
          Project prj = property::project;
 
index 17d3ff1..b206050 100644 (file)
@@ -241,7 +241,7 @@ class ProjectView : Window
                      mi = ide.projectInstallItem;
                      MenuItem { pop, $"Install"            , t         , NotifySelect = ProjectInstall    , bitmap = mi.bitmap }.disabled = na;
                   }
-                  if(showDebuggingMenuItems && node.ContainsFilesWithExtension("ec"))
+                  if(showDebuggingMenuItems && node.ContainsFilesWithExtension("ec", node.project.config))
                   {
                      MenuDivider { pop };
                      MenuItem { pop, $"Debug Generate Symbols", l, NotifySelect = FileDebugGenerateSymbols }.disabled = na;
@@ -650,7 +650,8 @@ class ProjectView : Window
 
    bool ProjectPrepareCompiler(Project project, CompilerConfig compiler, bool silent)
    {
-      if((!project.GenerateCrossPlatformMk(app.includeFile) || !project.GenerateCompilerCf(compiler)) && !silent)
+      if((!project.GenerateCrossPlatformMk(app.includeFile) ||
+            !project.GenerateCompilerCf(compiler, project.topNode.ContainsFilesWithExtension("ec", project.config))) && !silent)
          ide.outputView.buildBox.Logf($"Error generating compiler configuration (Is the project/config directory writable?)\n");
       return true;
    }