X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Finstall.cpp;h=6dcaef0ca9da3c3656ad85723d447438daffcff4;hb=0f5283a54fd188072eca23fbd980a43c6c869913;hp=ca32348f324e02d289159d0030037ab0edb84b31;hpb=b5ad62c2c4c7eeadd881e3f157bde96e4dd2cc0e;p=builder.git diff --git a/source/install.cpp b/source/install.cpp index ca32348..6dcaef0 100644 --- a/source/install.cpp +++ b/source/install.cpp @@ -1,3 +1,10 @@ +/* $Id$ + +This file is part of builder +Copyright © 2006-2007 Mikko Rasa, Mikkosoft Productions +Distributed under the LGPL +*/ + #include #include "builder.h" #include "copy.h" @@ -11,7 +18,7 @@ using namespace std; using namespace Msp; -Install::Install(Builder &b, const Package &p, Target &tgt): +Install::Install(Builder &b, const SourcePackage &p, Target &tgt): Target(b, &p, generate_target_name(tgt)) { buildable=true; @@ -26,9 +33,9 @@ void Install::check_rebuild() { Target *dep=depends.front(); if(dep->get_mtime()>mtime) - mark_rebuild(Path::basename(dep->get_name())+" has changed"); + mark_rebuild(basename(dep->get_name())+" has changed"); else if(dep->get_rebuild()) - mark_rebuild(Path::basename(dep->get_name())+" needs rebuilding"); + mark_rebuild(basename(dep->get_name())+" needs rebuilding"); } } @@ -39,7 +46,9 @@ Action *Install::build() string Install::generate_target_name(const Target &tgt) { - Path::Path base=tgt.get_package()->get_prefix(); + const SourcePackage *spkg=dynamic_cast(tgt.get_package()); + + Path base=spkg->get_builder().get_prefix(); string tgtname=tgt.get_name().substr(tgt.get_name().rfind('/')+1); string mid;