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);
if(compiler.sysroot && compiler.sysroot[0])
{
f.Printf("SYSROOT := %s\n", compiler.sysroot);
- f.Puts("_SYSROOT := $(space)--sysroot=$(SYSROOT)\n");
+ // Moved this to crossplatform.mk
+ //f.Puts("_SYSROOT := $(space)--sysroot=$(SYSROOT)\n");
f.Puts("\n");
}
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
f.Printf("\nFORCE_64_BIT := %s", compiler.supportsBitDepth ? "-m64" : "");
f.Printf("\nFORCE_32_BIT := %s", compiler.supportsBitDepth ? "-m32" : "");
f.Puts("\n");
+ f.Puts("\nOFLAGS += $(LDFLAGS)");
+ f.Puts("\n");
delete f;
+
+ result = true;
}
}
delete name;
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("PRJ_CFLAGS =\n");
f.Puts("CECFLAGS =\n");
f.Puts("OFLAGS =\n");
- f.Puts("LDFLAGS =\n");
f.Puts("LIBS =\n");
f.Puts("\n");
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);
cflagsVariations, nodeCFlagsMapping,
ecflagsVariations, nodeECFlagsMapping, null);
- GenMakePrintCustomFlags(f, "CFLAGS", false, cflagsVariations);
+ GenMakePrintCustomFlags(f, "PRJ_CFLAGS", false, cflagsVariations);
GenMakePrintCustomFlags(f, "ECFLAGS", true, ecflagsVariations);
if(platforms || (config && config.platforms))
if((projectPlatformOptions && projectPlatformOptions.options.linkerOptions && projectPlatformOptions.options.linkerOptions.count) ||
(configPlatformOptions && configPlatformOptions.options.linkerOptions && configPlatformOptions.options.linkerOptions.count))
{
- f.Puts("CFLAGS +=");
+ f.Puts("PRJ_CFLAGS +=");
// tocheck: does any of that -Wl stuff from linkerOptions have any business being in CFLAGS?
if(projectPlatformOptions && projectPlatformOptions.options.linkerOptions && projectPlatformOptions.options.linkerOptions.count)
{
// tocheck: does any of that -Wl stuff from linkerOptions have any business being in CFLAGS?
if(options && options.linkerOptions && options.linkerOptions.count)
{
- f.Puts("CFLAGS +=");
+ f.Puts("PRJ_CFLAGS +=");
f.Puts(" \\\n\t -Wl");
for(s : options.linkerOptions)
f.Printf(",%s", s);
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");
f.Puts("\n");
// Main Module (Linking) for ECERE C modules
f.Puts("$(OBJ)$(MODULE).main.c: $(OBJ)$(MODULE).main.ec\n");
- f.Puts("\t$(ECP) $(CECFLAGS) $(ECFLAGS) $(CFLAGS)"
+ f.Puts("\t$(ECP) $(CFLAGS) $(CECFLAGS) $(ECFLAGS) $(PRJ_CFLAGS)"
" -c $(OBJ)$(MODULE).main.ec -o $(OBJ)$(MODULE).main.sym -symbols $(OBJ)\n");
- f.Puts("\t$(ECC) $(CECFLAGS) $(ECFLAGS) $(CFLAGS) $(FVISIBILITY)"
+ f.Puts("\t$(ECC) $(CFLAGS) $(CECFLAGS) $(ECFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY)"
" -c $(OBJ)$(MODULE).main.ec -o $(OBJ)$(MODULE).main.c -symbols $(OBJ)\n");
f.Puts("\n");
}
f.Puts("# SYMBOL RULES\n");
f.Puts("\n");
- {
- Map<Platform, bool> excludedPlatforms { };
- topNode.GenMakefilePrintSymbolRules(f, this, config, excludedPlatforms,
- nodeCFlagsMapping, nodeECFlagsMapping);
- delete excludedPlatforms;
- }
+
+ topNode.GenMakefilePrintSymbolRules(f, this, config, nodeCFlagsMapping, nodeECFlagsMapping);
f.Puts("# C OBJECT RULES\n");
f.Puts("\n");
- {
- Map<Platform, bool> excludedPlatforms { };
- topNode.GenMakefilePrintCObjectRules(f, this, config, excludedPlatforms,
- nodeCFlagsMapping, nodeECFlagsMapping);
- delete excludedPlatforms;
- }
+
+ topNode.GenMakefilePrintCObjectRules(f, this, config, nodeCFlagsMapping, nodeECFlagsMapping);
f.Puts("# OBJECT RULES\n");
f.Puts("\n");
// todo call this still but only generate rules whith specific options
// see we-have-file-specific-options in ProjectNode.ec
- {
- Map<Platform, bool> excludedPlatforms { };
- topNode.GenMakefilePrintObjectRules(f, this, namesInfo, config, excludedPlatforms,
- nodeCFlagsMapping, nodeECFlagsMapping);
- delete excludedPlatforms;
- }
+ topNode.GenMakefilePrintObjectRules(f, this, namesInfo, config, nodeCFlagsMapping, nodeECFlagsMapping);
if(numCObjects)
GenMakefilePrintMainObjectRule(f, config);
f.Puts("distclean:\n");
f.Puts("\t$(call rmrq,obj/)\n");
- f.Puts("\n");
delete f;
{
#endif
f.Puts("$(OBJ)$(MODULE).main$(O): $(OBJ)$(MODULE).main.c\n");
+ f.Printf("\t$(CC) $(CFLAGS) $(PRJ_CFLAGS) $(FVISIBILITY) -c $(OBJ)$(MODULE).main.%s -o $(OBJ)$(MODULE).main$(O)\n", extension);
+ f.Puts("\n");
#if 0
}
}
#endif
-
- f.Printf("\t$(CC) $(CFLAGS) $(FVISIBILITY) -c $(OBJ)$(MODULE).main.%s -o $(OBJ)$(MODULE).main$(O)\n", extension);
- f.Puts("\n");
}
void GenMakePrintCustomFlags(File f, String variableName, bool printNonCustom, Map<String, int> cflagsVariations)