sdk/Build System: Took out extra inclusion of LDFLAGS; Moved $(CPPFLAGS) and -D_DEBUG...
[sdk] / ide / src / project / Project.ec
index 61b64bc..9778dbc 100755 (executable)
@@ -1373,21 +1373,18 @@ private:
       char * cxx = compiler.cxxCommand;
       char * cpp = compiler.cppCommand;
       char * strip = compiler.cppCommand;
-      sprintf(cppCommand, "%s%s%s%s%s ",
+      sprintf(cppCommand, "%s%s%s%s ",
             compiler.ccacheEnabled ? "ccache " : "",
-            compiler.ccacheEnabled && !compiler.distccEnabled ? " " : "",
             compiler.distccEnabled ? "distcc " : "",
             compiler.gccPrefix ? compiler.gccPrefix : "",
             compiler.cppCommand);
-      sprintf(ccCommand, "%s%s%s%s%s ",
+      sprintf(ccCommand, "%s%s%s%s ",
             compiler.ccacheEnabled ? "ccache " : "",
-            compiler.ccacheEnabled && !compiler.distccEnabled ? " " : "",
             compiler.distccEnabled ? "distcc " : "",
             compiler.gccPrefix ? compiler.gccPrefix : "",
             compiler.ccCommand);
-      sprintf(cxxCommand, "%s%s%s%s%s ",
+      sprintf(cxxCommand, "%s%s%s%s ",
             compiler.ccacheEnabled ? "ccache " : "",
-            compiler.ccacheEnabled && !compiler.distccEnabled ? " " : "",
             compiler.distccEnabled ? "distcc " : "",
             compiler.gccPrefix ? compiler.gccPrefix : "",
             compiler.cxxCommand);
@@ -2047,11 +2044,11 @@ private:
             }
 
             //f.Printf("SHELL := %s\n", "sh"/*compiler.shellCommand*/); // is this really needed?
-            f.Printf("CPP := $(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("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 := %s\n", compiler.ecpCommand);
-            f.Printf("ECC := %s\n", compiler.eccCommand);
+            f.Printf("ECC := %s$(if $(CROSS_TARGET), -t $(TARGET_PLATFORM),)\n", compiler.eccCommand);
             f.Printf("ECS := %s$(if $(CROSS_TARGET), -t $(TARGET_PLATFORM),)\n", compiler.ecsCommand);
             f.Printf("EAR := %s\n", compiler.earCommand);
 
@@ -2079,7 +2076,7 @@ private:
             f.Puts("\n");
 
             f.Puts("# HARD CODED TARGET_PLATFORM-SPECIFIC OPTIONS\n");
-            f.Printf("LDFLAGS +=$(if $(%s), -Wl,--no-undefined,)\n", PlatformToMakefileTargetVariable(tux));
+            f.Printf("LDFLAGS +=$(if $(%s), -Wl$(comma)--no-undefined,)\n", PlatformToMakefileTargetVariable(tux));
             f.Puts("\n");
 
             // JF's
@@ -2130,6 +2127,8 @@ private:
             f.Puts("\n");
 
             delete f;
+
+            result = true;
          }
       }
       delete name;
@@ -2253,10 +2252,9 @@ private:
          f.Puts("# FLAGS\n\n");
 
          f.Puts("ECFLAGS =\n");
-         f.Puts("ifndef DEBIAN_PACKAGE\n" "CFLAGS =\n" "endif\n");
+         f.Puts("ifndef DEBIAN_PACKAGE\n" "CFLAGS =\n" "LDFLAGS =\n" "endif\n");
          f.Puts("CECFLAGS =\n");
          f.Puts("OFLAGS =\n");
-         f.Puts("LDFLAGS =\n");
          f.Puts("LIBS =\n");
          f.Puts("\n");
 
@@ -2392,7 +2390,7 @@ private:
          f.Puts("\n");
 
          topNode.GenMakefilePrintNode(f, this, sources, null, listItems, config, null);
-         OutputFileList(f, "SOURCES", listItems, varStringLenDiffs, "$(ECSOURCES)");
+         OutputFileList(f, "SOURCES", listItems, varStringLenDiffs, numCObjects ? "$(ECSOURCES)" : null);
 
          if(!noResources)
             resNode.GenMakefilePrintNode(f, this, resources, null, listItems, config, null);
@@ -2521,7 +2519,7 @@ private:
          f.Puts("\n");
          f.Puts("\n");
 
-         f.Puts("CECFLAGS += -cpp $(CPP)");
+         f.Puts("CECFLAGS += -cpp $(_CPP)");
          f.Puts("\n");
          f.Puts("\n");
 
@@ -2538,7 +2536,6 @@ private:
          if(options && options.libraryDirs)
             OutputListOption(f, "L", options.libraryDirs, lineEach, true);
          f.Puts("\n");
-         f.Puts("OFLAGS += $(LDFLAGS)\n");
          f.Puts("endif\n");
          f.Puts("\n");
 
@@ -2762,7 +2759,6 @@ private:
 
          f.Puts("distclean:\n");
          f.Puts("\t$(call rmrq,obj/)\n");
-         f.Puts("\n");
 
          delete f;