define ProjectExtension = "epj";
define stringInFileIncludedFrom = "In file included from ";
+define stringFrom = " from ";
+// This function cannot accept same pointer for source and output
void ReplaceSpaces(char * output, char * source)
{
int c, dc;
output[dc] = '\0';
}
+// This function cannot accept same pointer for source and output
void ReplaceUnwantedMakeChars(char * output, char * source)
{
int c, dc;
float version;
String moduleName;
+ property char * moduleVersion
+ {
+ set { delete moduleVersion; if(value && value[0]) moduleVersion = CopyString(value); } // TODO: use CopyString function that filters chars
+ get { return moduleVersion ? moduleVersion : ""; } // version number should only use digits and dots
+ isset { return moduleVersion != null && moduleVersion[0]; } // add leading/trailing 0 if value start/ends with dot(s)
+ }
+
+ property char * description
+ {
+ set { delete description; if(value && value[0]) description = CopyString(value); }
+ get { return description ? description : ""; }
+ isset { return description != null && description[0]; }
+ }
+
+ property char * license
+ {
+ set { delete license; if(value && value[0]) license = CopyString(value); }
+ get { return license ? license : ""; }
+ isset { return license != null && license[0]; }
+ }
+
+ property char * compilerConfigsDir
+ {
+ set { delete compilerConfigsDir; if(value && value[0]) compilerConfigsDir = CopyString(value); }
+ get { return compilerConfigsDir ? compilerConfigsDir : ""; }
+ isset { return compilerConfigsDir && compilerConfigsDir[0]; }
+ }
+
property ProjectOptions options { get { return options; } set { options = value; } isset { return options && !options.isEmpty; } }
property Array<PlatformOptions> platforms
{
String resourcesPath;
LinkList<ProjectNode> resources;
- property char * description
- {
- set { delete description; if(value && value[0]) description = CopyString(value); }
- get { return description ? description : ""; }
- isset { return description != null && description[0]; }
- }
-
- property char * license
- {
- set { delete license; if(value && value[0]) license = CopyString(value); }
- get { return license ? license : ""; }
- isset { return license != null && license[0]; }
- }
-
- property char * compilerConfigsDir
- {
- set { delete compilerConfigsDir; if(value && value[0]) compilerConfigsDir = CopyString(value); }
- get { return compilerConfigsDir ? compilerConfigsDir : ""; }
- isset { return compilerConfigsDir && compilerConfigsDir[0]; }
- }
-
- property char * moduleVersion
- {
- set { delete moduleVersion; if(value && value[0]) moduleVersion = CopyString(value); } // TODO: use CopyString function that filters chars
- get { return moduleVersion ? moduleVersion : ""; } // version number should only use digits and dots
- isset { return moduleVersion != null && moduleVersion[0]; } // add leading/trailing 0 if value start/ends with dot(s)
- }
-
private:
// topNode.name holds the file name (.epj)
ProjectOptions options;
strcpy(objDir, objDirExp.dir);
delete objDirExp;
ChangeCh(objDir, '\\', '/'); // TODO: this is a hack, paths should never include win32 path seperators - fix this in ProjectSettings and ProjectLoad instead
- ReplaceSpaces(objDir, objDir);
- strcpy(relativePath, objDir);
+ ReplaceSpaces(relativePath, objDir);
*sl = '.';
PathCatSlash(relativePath, moduleName);
return true;
if(c && ((c.options && cfg.options && cfg.options.console != c.options.console) ||
(!c.options || !cfg.options)))
cfg.symbolGenModified = true;
+ if(c && ((c.options && cfg.options &&
+ ( (cfg.options.libraries && c.options.libraries && cfg.options.libraries.OnCompare(c.options.libraries)) || (!cfg.options.libraries || !c.options.libraries)) )
+ || (!c.options || !cfg.options)))
+ cfg.linkingModified = true;
cfg.makingModified = true;
}
DynamicString cxx { };
DynamicString strip { };
DynamicString ar { };
-
+ /*
if(bitDepth == 64 && compiler.targetPlatform == win32)
gnuToolchainPrefix = "x86_64-w64-mingw32-";
else if(bitDepth == 32 && compiler.targetPlatform == win32)
gnuToolchainPrefix = "i686-w64-mingw32-";
-
+ */
ecp.concatx(compiler.ecpCommand, " ");
ecc.concatx(compiler.eccCommand, " ");
ecs.concatx(compiler.ecsCommand, " ");
{
char * message = null;
char * inFileIncludedFrom = strstr(line, stringInFileIncludedFrom);
+ char * from = strstr(line, stringFrom);
test.copyLenSingleBlankReplTrim(line, ' ', true, testLen);
if(strstr(line, compiler.makeCommand) == line && line[lenMakeCommand] == ':')
{
ide.outputView.buildBox.Logf("%s\n", line);
if(strstr(line, "warning:") || strstr(line, "note:"))
numWarnings++;
- else if(!gotCC && !strstr(line, "At top level") && !strstr(line, "In file included from"))
+ else if(!gotCC && !strstr(line, "At top level") && !strstr(line, "In file included from") && !strstr(line, stringFrom))
numErrors++;
}
colon = strstr(colon + 1, ":");
if(colon)
{
+ char * sayError = "";
char moduleName[MAX_LOCATION], temp[MAX_LOCATION];
char * pointer;
char * error;
- char * start = inFileIncludedFrom ? line + strlen(stringInFileIncludedFrom) : line;
+ char * start = inFileIncludedFrom ? inFileIncludedFrom + strlen(stringInFileIncludedFrom) : from ? from + strlen(stringFrom) : line;
int len = (int)(colon - start);
+ char ext[MAX_EXTENSION];
len = Min(len, MAX_LOCATION-1);
// Don't be mistaken by the drive letter colon
// Cut module name
//if(bracket) *bracket = '\0';
GetLastDirectory(moduleName, temp);
+ GetExtension(temp, ext);
+
+ if(linking && (!strcmp(ext, "o") || !strcmp(ext, "a") || !strcmp(ext, "lib")))
+ {
+ char * cColon = strstr(colon+1, ":");
+ if(cColon && (cColon[1] == '/' || cColon[1] == '\\'))
+ cColon = strstr(cColon + 1, ":");
+ if(cColon)
+ {
+ int len = (int)(cColon - (colon+1));
+ char mName[MAX_LOCATION];
+ len = Min(len, MAX_LOCATION-1);
+ strncpy(mName, colon+1, len);
+ mName[len] = '\0';
+ GetLastDirectory(mName, temp);
+ GetExtension(temp, ext);
+ if(!strcmp(ext, "c") || !strcmp(ext, "cpp") || !strcmp(ext, "cxx") || !strcmp(ext, "ec"))
+ {
+ colon = cColon;
+ strcpy(moduleName, mName);
+ }
+ }
+ }
if(linking && (!strcmp(temp, "ld") || !strcmp(temp, "ld.exe")))
{
+ moduleName[0] = 0;
if(strstr(colon, "skipping incompatible") || strstr(colon, "Recognised but unhandled"))
- message = $"Linker Message";
+ {
+ message = $"Linker Message: ";
+ colon = line;
+ }
else
{
numErrors++;
message = $"Linker Error";
}
}
+ else if(linking && (!strcmp(ext, "") || !strcmp(ext, "exe")))
+ {
+ moduleName[0] = 0;
+ colon = line;
+ if(!strstr(line, "error:"))
+ {
+ message = $"Linker Error: ";
+ numErrors++;
+ }
+ }
else
{
strcpy(temp, topNode.path);
MakePathRelative(temp, topNode.path, moduleName);
}
error = strstr(line, "error:");
- if(error && error > colon)
+ if(!message && error && error > colon)
numErrors++;
else
{
- // Silence warnings for compiled EC
+ // Silence warnings for compiled eC
char * objDir = strstr(moduleName, objDirExp.dir);
if(linking)
{
if((pointer = strstr(line, "undefined")) ||
+ (pointer = strstr(line, "multiple definition")) ||
(pointer = strstr(line, "No such file")) ||
(pointer = strstr(line, "token")))
{
strncat(moduleName, colon, pointer - colon);
- strcat(moduleName, "error: ");
+ sayError = "error: ";
colon = pointer;
numErrors++;
}
else if((pointer = strstr(line, "No such file")))
{
strncat(moduleName, colon, pointer - colon);
- strcat(moduleName, "error: ");
+ sayError = "error: ";
colon = pointer;
numErrors++;
}
}
}
if(message)
- ide.outputView.buildBox.Logf(" %s: %s\n", message, line);
- else if(this == ide.workspace.projects.firstIterator.data)
- ide.outputView.buildBox.Logf(" %s%s\n", moduleName, colon);
+ ide.outputView.buildBox.Logf(" %s%s\n", message, colon);
+ /*else if(this == ide.workspace.projects.firstIterator.data)
+ ide.outputView.buildBox.Logf(" %s%s%s\n", moduleName, sayError, colon);*/
else
{
char fullModuleName[MAX_LOCATION];
- strcpy(fullModuleName, topNode.path);
- PathCat(fullModuleName, moduleName);
- MakePathRelative(fullModuleName, ide.workspace.projects.firstIterator.data.topNode.path, fullModuleName);
- MakeSystemPath(fullModuleName);
- ide.outputView.buildBox.Logf(" %s%s%s\n", inFileIncludedFrom ? stringInFileIncludedFrom : "", fullModuleName, colon);
+ FileAttribs found = 0;
+ Project foundProject = this;
+ if(moduleName[0])
+ {
+ char * loc = strstr(moduleName, ":");
+ if(loc) *loc = 0;
+ strcpy(fullModuleName, topNode.path);
+ PathCat(fullModuleName, moduleName);
+ found = FileExists(fullModuleName);
+ if(!found && !strcmp(ext, "c"))
+ {
+ char ecName[MAX_LOCATION];
+ ChangeExtension(fullModuleName, "ec", ecName);
+ found = FileExists(ecName);
+ }
+ if(!found)
+ {
+ char path[MAX_LOCATION];
+ if(ide && ide.workspace)
+ {
+ for(prj : ide.workspace.projects)
+ {
+ ProjectNode node;
+ MakePathRelative(fullModuleName, prj.topNode.path, path);
+
+ if((node = prj.topNode.FindWithPath(path, false)))
+ {
+ strcpy(fullModuleName, prj.topNode.path);
+ PathCatSlash(fullModuleName, node.path);
+ PathCatSlash(fullModuleName, node.name);
+ found = FileExists(fullModuleName);
+ if(found)
+ {
+ foundProject = prj;
+ break;
+ }
+ }
+ }
+ if(!found && !strchr(moduleName, '/') && !strchr(moduleName, '\\'))
+ {
+ for(prj : ide.workspace.projects)
+ {
+ ProjectNode node;
+ if((node = prj.topNode.Find(moduleName, false)))
+ {
+ strcpy(fullModuleName, prj.topNode.path);
+ PathCatSlash(fullModuleName, node.path);
+ PathCatSlash(fullModuleName, node.name);
+ found = FileExists(fullModuleName);
+ if(found)
+ {
+ foundProject = prj;
+ break;
+ }
+ }
+ }
+ }
+ }
+ }
+ if(found)
+ {
+ MakePathRelative(fullModuleName, ide.workspace.projects.firstIterator.data.topNode.path, fullModuleName);
+ MakeSystemPath(fullModuleName);
+ }
+ else
+ strcpy(fullModuleName, moduleName);
+ if(loc)
+ {
+ strcat(fullModuleName, ":");
+ strcat(fullModuleName, loc + 1);
+ }
+ }
+ else
+ fullModuleName[0] = 0;
+ ide.outputView.buildBox.Logf(" %s%s%s%s\n", inFileIncludedFrom ? stringInFileIncludedFrom : from ? stringFrom : "", fullModuleName, sayError, colon);
}
}
else
crossCompiling ? " TARGET_PLATFORM=" : "",
targetPlatform,
bitDepth ? " ARCH=" : "", bitDepth == 32 ? "32" : bitDepth == 64 ? "64" : "",
- (bitDepth == 64 && compiler.targetPlatform == win32) ? " GCC_PREFIX=x86_64-w64-mingw32-" : (bitDepth == 32 && compiler.targetPlatform == win32) ? " GCC_PREFIX=i686-w64-mingw32-" : "",
+ /*(bitDepth == 64 && compiler.targetPlatform == win32) ? " GCC_PREFIX=x86_64-w64-mingw32-" : (bitDepth == 32 && compiler.targetPlatform == win32) ? " GCC_PREFIX=i686-w64-mingw32-" : */"",
compilerName, topNode.path, justPrint ? " -n" : "", makeFilePath);
if(justPrint)
targetPlatform,
bitDepth ? " ARCH=" : "",
bitDepth == 32 ? "32" : bitDepth == 64 ? "64" : "",
- (bitDepth == 64 && compiler.targetPlatform == win32) ? " GCC_PREFIX=x86_64-w64-mingw32-" : (bitDepth == 32 && compiler.targetPlatform == win32) ? " GCC_PREFIX=i686-w64-mingw32-" : "",
+ /*(bitDepth == 64 && compiler.targetPlatform == win32) ? " GCC_PREFIX=x86_64-w64-mingw32-" : (bitDepth == 32 && compiler.targetPlatform == win32) ? " GCC_PREFIX=i686-w64-mingw32-" :*/ "",
compilerName, numJobs,
compiler.ccacheEnabled ? "CCACHE=y " : "",
compiler.distccEnabled ? "DISTCC=y " : "",
(String)makeTargets, topNode.path, (justPrint || (mode != normal && mode != cObject)) ? " -n" : "", makeFilePath);
if(justPrint)
ide.outputView.buildBox.Logf("%s\n", command);
+
if((f = DualPipeOpen(PipeOpenMode { output = true, error = true, input = true }, command)))
{
bool found = false;
{
f.Printf("export %s := %s\n", e.name, e.string);
}
+ f.Puts("\n");
}
f.Puts("# TOOLCHAIN\n");
strcpy(objDirExpNoSpaces, GetObjDirExpression(config));
ChangeCh(objDirExpNoSpaces, '\\', '/'); // TODO: this is a hack, paths should never include win32 path seperators - fix this in ProjectSettings and ProjectLoad instead
- ReplaceSpaces(objDirExpNoSpaces, objDirExpNoSpaces);
+ {
+ char temp[MAX_LOCATION];
+ ReplaceSpaces(temp, objDirExpNoSpaces);
+ strcpy(objDirExpNoSpaces, temp);
+ }
ReplaceSpaces(resDirNoSpaces, resNode.path ? resNode.path : "");
ReplaceSpaces(fixedModuleName, moduleName);
ReplaceSpaces(fixedConfigName, GetConfigName(config));
// test = GetTargetTypeIsSetByPlatform(config);
{
char target[MAX_LOCATION];
- char targetNoSpaces[MAX_LOCATION];
+ char temp[MAX_LOCATION];
if(test)
{
TargetTypes type;
f.Printf("ifeq \"$(TARGET_TYPE)\" \"%s\"\n", TargetTypeToMakefileVariable(type));
GetMakefileTargetFileName(type, target, config);
- strcpy(targetNoSpaces, targetDir);
- PathCatSlash(targetNoSpaces, target);
- ReplaceSpaces(targetNoSpaces, targetNoSpaces);
- f.Printf("TARGET = %s\n", targetNoSpaces);
+ strcpy(temp, targetDir);
+ PathCatSlash(temp, target);
+ ReplaceSpaces(target, temp);
+ f.Printf("TARGET = %s\n", target);
}
}
f.Puts("else\n");
}
GetMakefileTargetFileName(targetType, target, config);
- strcpy(targetNoSpaces, targetDir);
- PathCatSlash(targetNoSpaces, target);
- ReplaceSpaces(targetNoSpaces, targetNoSpaces);
- f.Printf("TARGET = %s\n", targetNoSpaces);
+ strcpy(temp, targetDir);
+ PathCatSlash(temp, target);
+ ReplaceSpaces(target, temp);
+ f.Printf("TARGET = %s\n", target);
if(test)
{