description "Mikkosoft Productions software builder";
require "mspcore";
- require "mspstrings";
require "mspdatafile";
require "mspfs";
require "sigc++-2.0";
set -e
-REQUIRED="core datafile fs strings io"
+REQUIRED="core datafile"
CFLAGS="-Iinclude `pkg-config --cflags sigc++-2.0`"
LIBS="`pkg-config --libs sigc++-2.0` -lpthread"
if [ -e /usr/lib/libdl.so ]; then
Loader loader(*this, fn.subpath(0, fn.size()-1));
loader.load(parser);
}
- catch(const IO::FileNotFound &)
+ catch(const IO::file_not_found &)
{
return -1;
}
}
}
-Application::RegApp<Builder> Builder::reg;
string Builder::usagemsg;
string Builder::helpmsg;
/**
The main application class. Controls and owns everything. Rules the world.
*/
-class Builder: public Msp::Application
+class Builder: public Msp::RegisteredApplication<Builder>
{
private:
class Loader: public Msp::DataFile::Loader
Msp::FS::Path prefix;
StringList warnings;
- static Msp::Application::RegApp<Builder> reg;
static std::string usagemsg;
static std::string helpmsg;
in.getline(profile);
set_option("profile", profile);
}
- catch(const IO::FileNotFound &)
+ catch(const IO::file_not_found &)
{ }
freeze_mtime = true;
Loader loader(*this);
loader.load(parser);
}
- catch(const IO::FileNotFound &)
+ catch(const IO::file_not_found &)
{ }
}
mtime = Time::TimeStamp::from_unixtime(FS::stat(fn).st_mtime);
}
- catch(const IO::FileNotFound &)
+ catch(const IO::file_not_found &)
{ }
}
using namespace Msp;
ObjectFile::ObjectFile(Builder &b, const Component &c, SourceFile &s):
- FileTarget(b, &c.get_package(), generate_target_path(c, FS::basename(s.get_path()))),
+ FileTarget(b, &c.get_package(), generate_target_path(c, FS::relative(s.get_path(), c.get_package().get_source()).str())),
comp(c),
source(s)
{
FS::Path ObjectFile::generate_target_path(const Component &comp, const string &src)
{
const SourcePackage &pkg = comp.get_package();
- return pkg.get_temp_dir()/comp.get_name()/(FS::basepart(src)+".o");
+ string fn = FS::basepart(src)+".o";
+ if(!fn.compare(0, 2, "./"))
+ fn.erase(0, 2);
+ for(string::iterator i=fn.begin(); i!=fn.end(); ++i)
+ if(*i=='/')
+ *i = '_';
+ return pkg.get_temp_dir()/comp.get_name()/fn;
}
deps_cache.set_deps(relname, includes);
}
- catch(const IO::FileNotFound &)
+ catch(const IO::file_not_found &)
{
if(builder.get_verbose()>=4)
IO::print("Failed to read includes from %s\n", path.str());