extern int __ecereVMethodID_class_OnCompare;
extern int __ecereVMethodID_class_OnFree;
-#ifdef __WIN32__
-define cfDir = "C:/temp/";
-#else
-define cfDir = "/home/redj/.ecereIDE/";
-#endif
-
IDESettings ideSettings;
IDESettingsContainer settingsContainer
}
}
- void CatMakeFileName(char * string, CompilerConfig compiler, ProjectConfig config)
+ void GetCompilerConfigsDir(char * cfDir)
+ {
+ strcpy(cfDir, topNode.path);
+ PathCatSlash(cfDir, ideSettings.compilerConfigsDir);
+ if(cfDir && cfDir[0] && cfDir[strlen(cfDir)-1] != '/')
+ strcat(cfDir, "/");
+ }
+
+ void CatMakeFileName(char * string, ProjectConfig config)
{
char projectName[MAX_LOCATION];
strcpy(projectName, name);
- if(strcmpi(compiler.name, defaultCompilerName))
- sprintf(string, "%s-%s-%s.Makefile", projectName, compiler.name, config.name);
- else
- sprintf(string, "%s%s%s.Makefile", projectName, config ? "-" : "", config ? config.name : "");
+ sprintf(string, "%s%s%s.Makefile", projectName, config ? "-" : "", config ? config.name : "");
}
#ifndef MAKEFILE_GENERATOR
CatTargetFileName(targetFileName, compiler, config);
strcpy(makeFilePath, topNode.path);
- CatMakeFileName(makeFile, compiler, config);
+ CatMakeFileName(makeFile, config);
PathCatSlash(makeFilePath, makeFile);
// TODO: TEST ON UNIX IF \" around makeTarget is ok
{
int len;
char pushD[MAX_LOCATION];
+ char cfDir[MAX_LOCATION];
+ GetCompilerConfigsDir(cfDir);
GetWorkingDir(pushD, sizeof(pushD));
ChangeWorkingDir(topNode.path);
// Create object dir if it does not exist already
}
else
{
+ char cfDir[MAX_LOCATION];
+ GetCompilerConfigsDir(cfDir);
sprintf(command, "%s E_IDE_CF_DIR=%s COMPILER=%s -j%d %s%s%s -C \"%s\" -f \"%s\"", compiler.makeCommand, cfDir, compilerName, numJobs,
compiler.ccacheEnabled ? "CCACHE=y " : "",
compiler.distccEnabled ? "DISTCC=y " : "",
SetPath(false, compiler, config);
strcpy(makeFilePath, topNode.path);
- CatMakeFileName(makeFile, compiler, config);
+ CatMakeFileName(makeFile, config);
PathCatSlash(makeFilePath, makeFile);
if(compiler.type.isVC)
}
else
{
+ char cfDir[MAX_LOCATION];
+ GetCompilerConfigsDir(cfDir);
sprintf(command, "%s E_IDE_CF_DIR=%s COMPILER=%s %sclean -C \"%s\" -f \"%s\"", compiler.makeCommand, cfDir, compilerName, realclean ? "real" : "", topNode.path, makeFilePath);
if((f = DualPipeOpen(PipeOpenMode { output = 1, error = 1, input = 2 }, command)))
{
bool result = false;
char path[MAX_LOCATION];
- GetWorkingDir(path, sizeof(path));
- PathCatSlash(path, cfDir);
+ GetCompilerConfigsDir(path);
+ if(!FileExists(path).isDirectory)
+ MakeDir(path);
PathCatSlash(path, "debug.cf");
- if(!FileExists(path))
+ if(FileExists(path))
+ DeleteFile(path);
{
File f = FileOpen(path, write);
if(f)
bool result = false;
char path[MAX_LOCATION];
- GetWorkingDir(path, sizeof(path));
- PathCatSlash(path, cfDir);
+ GetCompilerConfigsDir(path);
+ if(!FileExists(path).isDirectory)
+ MakeDir(path);
PathCatSlash(path, "crossplatform.cf");
- if(!FileExists(path))
+ if(FileExists(path))
+ DeleteFile(path);
{
File include = FileOpen(":crossplatform.cf", read);
if(include)
CamelCase(compilerName);
name = PrintString(platform, "-", compilerName, ".cf");
- GetWorkingDir(path, sizeof(path));
- PathCatSlash(path, cfDir);
+ GetCompilerConfigsDir(path);
+ if(!FileExists(path).isDirectory)
+ MakeDir(path);
PathCatSlash(path, name);
- if(!FileExists(path))
+ if(FileExists(path))
+ DeleteFile(path);
{
File f = FileOpen(path, write);
if(f)
if(!altMakefilePath)
{
strcpy(filePath, topNode.path);
- CatMakeFileName(makeFile, compiler, config);
+ CatMakeFileName(makeFile, config);
PathCatSlash(filePath, makeFile);
}