summaryrefslogtreecommitdiffabout
authorMichael Krelin <hacker@klever.net>2005-04-03 13:07:33 (UTC)
committer Michael Krelin <hacker@klever.net>2005-04-03 13:07:33 (UTC)
commit197174ead5e273bd0c8684d92752e1e8599d6656 (patch) (side-by-side diff)
tree7f464c0fd17593e723b13766307c54ceb0ee326f
parentf2ddc6833252f106cf9aa589bc13216ba25ee4e6 (diff)
downloadsitecing-197174ead5e273bd0c8684d92752e1e8599d6656.zip
sitecing-197174ead5e273bd0c8684d92752e1e8599d6656.tar.gz
sitecing-197174ead5e273bd0c8684d92752e1e8599d6656.tar.bz2
yet another fix to handling dependencies
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--include/sitecing/component_factory.h4
-rw-r--r--lib/component_factory.cc25
2 files changed, 25 insertions, 4 deletions
diff --git a/include/sitecing/component_factory.h b/include/sitecing/component_factory.h
index a208ed1..9ddf70d 100644
--- a/include/sitecing/component_factory.h
+++ b/include/sitecing/component_factory.h
@@ -55,4 +55,8 @@ namespace sitecing {
*/
virtual void build(const string& dst);
+ /**
+ * @overload file_factory::make()
+ */
+ virtual void make(const string& dst);
/**
diff --git a/lib/component_factory.cc b/lib/component_factory.cc
index 5c18bb7..b5e95af 100644
--- a/lib/component_factory.cc
+++ b/lib/component_factory.cc
@@ -116,5 +116,4 @@ namespace sitecing {
bool component_factory::is_uptodate(const string& dst,file_list_t *deps) {
string dp = normalize_path(dst,strip_trailing_slash);
- // XXX: or just compare it off, instead of throwing things around.
try {
string noro = strip_prefix(dp,root_intermediate);
@@ -128,4 +127,5 @@ namespace sitecing {
return rv;
}catch(utility_no_prefix& unp) { }
+ // XXX: or just compare it off, instead of throwing things around.
try {
strip_prefix(dp,root_so);
@@ -148,4 +148,5 @@ namespace sitecing {
string noro = strip_prefix(noso,root_so);
string o = root_intermediate+noro+".o";
+ cerr << "Linking " << noro << endl;
if(access(o.c_str(),R_OK))
throw konforka::exception(CODEPOINT,string("can't access compiled component code (")+o+")");
@@ -192,4 +193,5 @@ namespace sitecing {
string cc = root_intermediate+nos+".cc";
string o = root_intermediate+nos+".o";
+ cerr << "Compiling " << nos << endl;
if(access(cc.c_str(),R_OK))
throw konforka::exception(CODEPOINT,string("can't access preprocessed component code (")+cc+")");
@@ -231,4 +233,5 @@ namespace sitecing {
string nos = strip_suffix(noro,pp_targets[ppt]);
string src = root_source+nos;
+ cerr << "Preprocessing " << nos << endl;
if(access(src.c_str(),R_OK))
throw konforka::exception(CODEPOINT,string("can't access component source (")+src+")");
@@ -265,15 +268,29 @@ namespace sitecing {
}
+ void component_factory::make(const string& dst) {
+ string dp = normalize_path(dst,strip_trailing_slash);
+ try {
+ string noso = strip_suffix(dp,".so");
+ string noro = strip_prefix(noso,root_so);
+ file_list_t a;
+ get_ancestors(noro,a);
+ for(file_list_t::const_iterator i=a.begin();i!=a.end();++i) {
+ make(root_so+*i+".so");
+ }
+ }catch(utility_no_affix& una) { }
+ file_factory::make(dst);
+ }
+
int component_factory::execute(const string& cmd, const list<string>& args,int stdo,int stde) {
// XXX: is it right that we do stdio/stderr tricks outside of the function?
- cerr << "executing: " << cmd;
+ // cerr << "executing: " << cmd;
vector<const char*> argv(args.size()+2);
argv[0]=cmd.c_str();
int an = 1;
for(list<string>::const_iterator i=args.begin();i!=args.end();i++) {
- cerr << " " << *i ;
+ // cerr << " " << *i ;
argv[an++] = i->c_str();
}
- cerr << endl;
+ // cerr << endl;
argv[an++]=NULL;
pid_t pid = vfork();