summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 05006d8)
raw | patch | inline | side by side (parent: 05006d8)
author | ishmal <ishmal@users.sourceforge.net> | |
Tue, 21 Nov 2006 20:21:48 +0000 (20:21 +0000) | ||
committer | ishmal <ishmal@users.sourceforge.net> | |
Tue, 21 Nov 2006 20:21:48 +0000 (20:21 +0000) |
buildtool.cpp | patch | blob | history |
diff --git a/buildtool.cpp b/buildtool.cpp
index 25636f1547c87a2f97083c6c2f720dd2c42e08f9..80c43e2c60b1ccf3362068415000aae555fbc567 100644 (file)
--- a/buildtool.cpp
+++ b/buildtool.cpp
int depFileSize;
char *depFileBuf;
-
+
+ static const int readBufSize = 8192;
+ char readBuf[8193];//byte larger
};
return false;
}
String buf;
- while (true)
+ while (!feof(f))
{
- int ch = fgetc(f);
- if (ch < 0)
- break;
- buf.push_back((char)ch);
+ int len = fread(readBuf, 1, readBufSize, f);
+ readBuf[len] = '\0';
+ buf.append(readBuf);
}
fclose(f);
virtual ~TaskCC()
{}
+ virtual bool needsCompiling(const DepRec &depRec,
+ const String &src, const String &dest)
+ {
+ return false;
+ }
+
virtual bool execute()
{
if (!listFiles(parent, fileSet))
String fullName = parent.resolve("build.dep");
if (isNewerThan(parent.getURI().getPath(), fullName))
{
- trace("regenerating cache");
+ status(" : regenerating C/C++ dependency cache");
refreshCache = true;
}
return false;
//## Check whether it needs to be done
- String destFullName = destPath;
- destFullName.append("/");
- destFullName.append(dep.name);
- destFullName.append(".o");
- String srcFullName = srcPath;
- srcFullName.append("/");
- srcFullName.append(dep.name);
- srcFullName.append(".");
- srcFullName.append(dep.suffix);
- if (!isNewerThan(srcFullName, destFullName))
+ String destName;
+ if (destPath.size()>0)
+ {
+ destName.append(destPath);
+ destName.append("/");
+ }
+ destName.append(dep.name);
+ destName.append(".o");
+ String destFullName = parent.resolve(destName);
+ String srcName;
+ if (srcPath.size()>0)
+ {
+ srcName.append(srcPath);
+ srcName.append("/");
+ }
+ srcName.append(dep.name);
+ srcName.append(".");
+ srcName.append(dep.suffix);
+ String srcFullName = parent.resolve(srcName);
+ bool compileMe = false;
+ if (isNewerThan(srcFullName, destFullName))
+ {
+ status(" : compile of %s required by %s",
+ destFullName.c_str(), srcFullName.c_str());
+ compileMe = true;
+ }
+ else
+ {
+ for (unsigned int i=0 ; i<dep.files.size() ; i++)
+ {
+ String depName;
+ if (srcPath.size()>0)
+ {
+ depName.append(srcPath);
+ depName.append("/");
+ }
+ depName.append(dep.files[i]);
+ String depFullName = parent.resolve(depName);
+ if (isNewerThan(depFullName, destFullName))
+ {
+ status(" : compile of %s required by %s",
+ destFullName.c_str(), depFullName.c_str());
+ compileMe = true;
+ break;
+ }
+ }
+ }
+ if (!compileMe)
{
- //trace("%s skipped", srcFullName.c_str());
continue;
}
{
status("##################################");
status("# BuildTool");
- status("# version 0.4");
- status("# 17 Nov 06");
+ status("# version 0.5");
+ status("# 21 Nov 06");
status("##################################");
specifiedTarget = target;
if (!run())