aboutsummaryrefslogtreecommitdiff
path: root/build/algorithm.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2015-04-24 12:29:20 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2015-04-24 12:29:20 +0200
commit2a0f9e035f673f1ee387924501a31990de37f18d (patch)
treeb8e55ab74bc88b788e99d8649219b931b80432d5 /build/algorithm.cxx
parent4c44c914d898af53152addad5530504548175e85 (diff)
Implement lib/liba/libso{} target group, shared/static library build
Diffstat (limited to 'build/algorithm.cxx')
-rw-r--r--build/algorithm.cxx115
1 files changed, 3 insertions, 112 deletions
diff --git a/build/algorithm.cxx b/build/algorithm.cxx
index 82286f5..9f428b3 100644
--- a/build/algorithm.cxx
+++ b/build/algorithm.cxx
@@ -250,118 +250,9 @@ namespace build
}
target_state
- execute_prerequisites (action a, target& t)
+ noop_action (action, target&)
{
- target_state ts (target_state::unchanged);
-
- if (t.group != nullptr)
- ts = execute_prerequisites (a, *t.group);
-
- for (target* pt: t.prerequisites)
- {
- if (pt == nullptr) // Skip ignored.
- continue;
-
- if (execute (a, *pt) == target_state::changed)
- ts = target_state::changed;
- }
-
- return ts;
- }
-
- target_state
- reverse_execute_prerequisites (action a, target& t)
- {
- target_state ts (target_state::unchanged);
-
- for (target* pt: reverse_iterate (t.prerequisites))
- {
- if (pt == nullptr) // Skip ignored.
- continue;
-
- if (execute (a, *pt) == target_state::changed)
- ts = target_state::changed;
- }
-
- if (t.group != nullptr)
- {
- if (reverse_execute_prerequisites (a, *t.group) == target_state::changed)
- ts = target_state::changed;
- }
-
- return ts;
- }
-
- bool
- execute_prerequisites (action a, target& t, const timestamp& mt)
- {
- bool e (mt == timestamp_nonexistent);
-
- if (t.group != nullptr)
- {
- if (execute_prerequisites (a, *t.group, mt))
- e = true;
- }
-
- for (target* pt: t.prerequisites)
- {
- if (pt == nullptr) // Skip ignored.
- continue;
-
- target_state ts (execute (a, *pt));
-
- if (!e)
- {
- // If this is an mtime-based target, then compare timestamps.
- //
- if (auto mpt = dynamic_cast<const mtime_target*> (pt))
- {
- timestamp mp (mpt->mtime ());
-
- // What do we do if timestamps are equal? This can happen, for
- // example, on filesystems that don't have subsecond resolution.
- // There is not much we can do here except detect the case where
- // the prerequisite was changed in this run which means the
- // action must be executed on the target as well.
- //
- if (mt < mp || (mt == mp && ts == target_state::changed))
- e = true;
- }
- else
- {
- // Otherwise we assume the prerequisite is newer if it was changed.
- //
- if (ts == target_state::changed)
- e = true;
- }
- }
- }
-
- return e;
- }
-
- target_state
- perform_clean_file (action a, target& t)
- {
- // The reverse order of update: first delete the file, then clean
- // prerequisites.
- //
- file& ft (dynamic_cast<file&> (t));
-
- bool r (rmfile (ft.path (), ft));
-
- // Update timestamp in case there are operations after us that
- // could use the information.
- //
- ft.mtime (timestamp_nonexistent);
-
- // Clean prerequisites.
- //
- target_state ts (target_state::unchanged);
-
- if (!t.prerequisites.empty ())
- ts = reverse_execute_prerequisites (a, t);
-
- return r ? target_state::changed : ts;
+ assert (false); // We shouldn't be called, see target::recipe().
+ return target_state::unchanged;
}
}