aboutsummaryrefslogtreecommitdiff
path: root/build
diff options
context:
space:
mode:
Diffstat (limited to 'build')
-rw-r--r--build/b.cxx4
-rw-r--r--build/target.cxx17
2 files changed, 18 insertions, 3 deletions
diff --git a/build/b.cxx b/build/b.cxx
index a71a866..1edce6b 100644
--- a/build/b.cxx
+++ b/build/b.cxx
@@ -182,10 +182,10 @@ main (int argc, char* argv[])
rules[typeid (obj)].emplace ("cxx.gnu.compile", cxx_compile);
dir_rule dir_r;
- rules[typeid (dir)].emplace ("", dir_r);
+ rules[typeid (dir)].emplace ("dir", dir_r);
path_rule path_r;
- rules[typeid (path_target)].emplace ("", path_r);
+ rules[typeid (path_target)].emplace ("path", path_r);
// Build.
//
diff --git a/build/target.cxx b/build/target.cxx
index 197770c..50a7cc6 100644
--- a/build/target.cxx
+++ b/build/target.cxx
@@ -150,6 +150,21 @@ namespace build
return nullptr;
}
+ // dir target
+ //
+ static target*
+ search_alias (prerequisite& p)
+ {
+ // For an alias/action we don't want to silently create a target
+ // since it will do nothing and it most likely not what the author
+ // intended.
+ //
+ if (target* t = search_existing_target (p))
+ return t;
+
+ fail << "no explicit target for prerequisite " << p;
+ }
+
// type info
//
@@ -195,6 +210,6 @@ namespace build
"dir",
&target::static_type,
&target_factory<dir>,
- target::static_type.search
+ &search_alias
};
}