]> git.tdb.fi Git - builder.git/commitdiff
Rename Target::get_rebuild to needs_rebuild
authorMikko Rasa <tdb@tdb.fi>
Tue, 1 May 2012 11:19:43 +0000 (14:19 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sun, 8 Jul 2012 21:08:50 +0000 (00:08 +0300)
source/analyzer.cpp
source/builder.cpp
source/filetarget.cpp
source/installedfile.cpp
source/target.cpp
source/target.h
source/virtualtarget.cpp

index 70f5f2076f3a68de00f74479f5f36f2565edee14..98e71a88f32963648aff12e416231198bb11c8e0 100644 (file)
@@ -66,7 +66,7 @@ void Analyzer::build_depend_table(Target &tgt, unsigned depth)
                if(const ObjectFile *obj = dynamic_cast<const ObjectFile *>(&tgt))
                        return build_depend_table(obj->get_source(), depth);
        }
-       else if(mode==REBUILD && !tgt.get_rebuild() && !real->get_rebuild())
+       else if(mode==REBUILD && !tgt.needs_rebuild() && !real->needs_rebuild())
                /* All targets that depend on to-be-built targets will be rebuilt
                themselves, so we can stop here. */
                return;
@@ -94,7 +94,7 @@ void Analyzer::build_depend_table(Target &tgt, unsigned depth)
        else
                row.push_back("");
 
-       if(tgt.get_rebuild())
+       if(tgt.needs_rebuild())
        {
                if(tgt.get_rebuild_reason().empty())
                        row.push_back("Yes (no reason)");
index 6623c2d033423981a5930016936756cc67c6fb3d..1bff8761dd49d2a4a1da3b1f2b2d90bc42a19970 100644 (file)
@@ -269,7 +269,7 @@ int Builder::main()
                                if(j->second->get_package()==i->second)
                                {
                                        ++count;
-                                       if(j->second->get_rebuild())
+                                       if(j->second->needs_rebuild())
                                                ++to_be_built;
                                }
                        if(count)
@@ -565,7 +565,7 @@ int Builder::do_build()
 
        unsigned total = 0;
        for(map<string, Target *>::const_iterator i=targets.begin(); i!=targets.end(); ++i)
-               if(i->second->is_buildable() && i->second->get_rebuild())
+               if(i->second->is_buildable() && i->second->needs_rebuild())
                        ++total;
 
        if(!total)
index 054be8143dec5c090098c0bff0405aba42168bf4..f04e3101281d4a8f9cb10791503591c3a7caf0cb 100644 (file)
@@ -44,12 +44,12 @@ void FileTarget::check_rebuild()
                        FileTarget *ft = dynamic_cast<FileTarget *>(*i);
                        if(ft && ft->get_mtime()>mtime)
                                mark_rebuild((*i)->get_name()+" has changed");
-                       else if((*i)->get_rebuild())
+                       else if((*i)->needs_rebuild())
                                mark_rebuild((*i)->get_name()+" needs rebuilding");
                        else
                        {
                                Target *real = ft->get_real_target();
-                               if(real->get_rebuild())
+                               if(real->needs_rebuild())
                                        mark_rebuild(real->get_name()+" needs rebuilding");
                        }
                }
index 24ba6e1ddc4e5af3e63ce1ab1bd0f211e46c4f01..5ed3139cd38d5d9fdd407dafb5813e1b3d7cd896 100644 (file)
@@ -37,7 +37,7 @@ void InstalledFile::check_rebuild()
                mark_rebuild("Does not exist");
        else if(source.get_mtime()>mtime || source.get_size()!=size)
                mark_rebuild(source.get_name()+" has changed");
-       else if(source.get_rebuild())
+       else if(source.needs_rebuild())
                mark_rebuild(source.get_name()+" needs rebuilding");
 }
 
index adde0cd180727b8ceb0a18d46455c60e3cf1f244..65d801f91421a3544d6f077f9683f40032ce7d3f 100644 (file)
@@ -35,7 +35,7 @@ Target *Target::get_buildable_target()
                Target *tgt = (*i)->get_buildable_target();
                if(tgt)
                        return tgt;
-               else if((*i)->get_rebuild())
+               else if((*i)->needs_rebuild())
                        self_ok = false;
        }
 
index 2df56a4a49b9403fb5b5df87a43b6da1c0cf5d39..2c14ea1ae3064ef394e0bcff951dafddf8360b61 100644 (file)
@@ -67,7 +67,7 @@ public:
        const Tool *get_tool() const { return tool; }
 
        bool is_buildable() const { return tool!=0; }
-       bool get_rebuild() const { return rebuild; }
+       bool needs_rebuild() const { return rebuild; }
        const std::string &get_rebuild_reason() const { return rebuild_reason; }
        bool is_installable() const { return !install_location.empty(); }
        const std::string &get_install_location() const { return install_location; }
index e3974d57c426a311879964850994a506e4d8236b..5d388ded5e5393202a4b947f9560cbeb6aac012d 100644 (file)
@@ -14,6 +14,6 @@ void VirtualTarget::check_rebuild()
 {
        // Virtual targets are only rebuilt if their dependencies need rebuilding.
        for(Dependencies::iterator i=depends.begin(); (i!=depends.end() && !rebuild); ++i)
-               if((*i)->get_rebuild())
+               if((*i)->needs_rebuild())
                        mark_rebuild((*i)->get_name()+" needs rebuilding");
 }