X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Ftarget.cpp;h=c9c23ad9116165297d602978b9be04c13f902530;hb=7aeaa4ba965f596edad438c02e345a8843f7469a;hp=e8ed647477fcf82823f06195cfa8a7e43edf7441;hpb=57bdb055acb0453c75b22cb64f35cc0e817a2827;p=builder.git diff --git a/source/target.cpp b/source/target.cpp index e8ed647..c9c23ad 100644 --- a/source/target.cpp +++ b/source/target.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 #include "action.h" @@ -36,6 +43,8 @@ Target *Target::get_buildable_target() void Target::add_depend(Target *dep) { + if(dep==this) + throw InvalidParameterValue("A target can't depend on itself"); depends.push_back(dep); dep->rdepends.push_back(this); } @@ -93,6 +102,8 @@ Target::Target(Builder &b, const Package *p, const string &n): prepared(false), counted(false) { + builder.add_target(this); + struct stat st; if(!Path::stat(name, st)) mtime=Time::TimeStamp::from_unixtime(st.st_mtime);