Makefiles/ide: Added $(FORCE_32_BIT) to ecs calls
[sdk] / ide / src / project / Project.ec
old mode 100755 (executable)
new mode 100644 (file)
index c9a43c6..97caf2d
@@ -1248,7 +1248,7 @@ private:
       char temp[MAX_LOCATION];
       bool result = false;
       strcpy(cfDir, topNode.path);
-      if(ideSettings.compilerConfigsDir && ideSettings.compilerConfigsDir[0])
+      if(ideSettings && ideSettings.compilerConfigsDir && ideSettings.compilerConfigsDir[0])
       {
          PathCatSlash(cfDir, ideSettings.compilerConfigsDir);
          result = true;
@@ -2661,21 +2661,30 @@ private:
          f.Puts("\n");
          f.Puts("\n");
 
-         f.Puts("ifndef STATIC_LIBRARY_TARGET\n");
-         f.Puts("OFLAGS +=");
          forceBitDepth = (options && options.buildBitDepth) || numCObjects;
-         if(forceBitDepth)
-            f.Puts((!options || !options.buildBitDepth || options.buildBitDepth == bits32) ? " $(FORCE_32_BIT)" : " $(FORCE_64_BIT) \\\n");
-
-         if(GetProfile(config))
-            f.Puts(" -pg");
-         if(config && config.options && config.options.libraryDirs)
-            OutputListOption(f, "L", config.options.libraryDirs, lineEach, true);
-         if(options && options.libraryDirs)
-            OutputListOption(f, "L", options.libraryDirs, lineEach, true);
-         f.Puts("\n");
-         f.Puts("endif\n");
-         f.Puts("\n");
+         if(forceBitDepth || GetProfile(config))
+         {
+            f.Puts("OFLAGS +=");
+            if(forceBitDepth)
+               f.Puts((!options || !options.buildBitDepth || options.buildBitDepth == bits32) ? " $(FORCE_32_BIT)" : " $(FORCE_64_BIT)");
+            if(GetProfile(config))
+               f.Puts(" -pg");
+            f.Puts("\n");
+            f.Puts("\n");
+         }
+
+         if((config && config.options && config.options.libraryDirs) || (options && options.libraryDirs))
+         {
+            f.Puts("ifndef STATIC_LIBRARY_TARGET\n");
+            f.Puts("OFLAGS +=");
+            if(config && config.options && config.options.libraryDirs)
+               OutputListOption(f, "L", config.options.libraryDirs, lineEach, true);
+            if(options && options.libraryDirs)
+               OutputListOption(f, "L", options.libraryDirs, lineEach, true);
+            f.Puts("\n");
+            f.Puts("endif\n");
+            f.Puts("\n");
+         }
 
          f.Puts("# TARGETS\n");
          f.Puts("\n");
@@ -2746,7 +2755,7 @@ private:
             // Main Module (Linking) for ECERE C modules
             f.Puts("$(OBJ)$(MODULE).main.ec: $(SYMBOLS) $(COBJECTS)\n");
             // use of objDirExpNoSpaces used instead of $(OBJ) to prevent problematic joining of arguments in ecs
-            f.Printf("\t$(ECS)%s $(ECSLIBOPT) $(SYMBOLS) $(IMPORTS) -symbols %s -o $(OBJ)$(MODULE).main.ec\n", 
+            f.Printf("\t$(ECS)%s $(FORCE_32_BIT) $(ECSLIBOPT) $(SYMBOLS) $(IMPORTS) -symbols %s -o $(OBJ)$(MODULE).main.ec\n", 
                GetConsole(config) ? " -console" : "", objDirExpNoSpaces);
             f.Puts("\n");
             // Main Module (Linking) for ECERE C modules