aboutsummaryrefslogtreecommitdiff
path: root/build/rule.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'build/rule.cxx')
-rw-r--r--build/rule.cxx21
1 files changed, 5 insertions, 16 deletions
diff --git a/build/rule.cxx b/build/rule.cxx
index 413676b..884b28d 100644
--- a/build/rule.cxx
+++ b/build/rule.cxx
@@ -55,25 +55,14 @@ namespace build
//
path_target& pt (dynamic_cast<path_target&> (t));
+ // Assign the path. While nromally we shouldn't do this in match(),
+ // no other rule should ever be ambiguous with the fallback one.
+ //
if (pt.path ().empty ())
{
- path p (t.dir / path (pt.name));
-
- // @@ TMP: target name as an extension.
- //
- const string& e (pt.ext != nullptr ? *pt.ext : pt.type ().name);
-
- if (!e.empty ())
- {
- p += '.';
- p += e;
- }
-
- // While strictly speaking we shouldn't do this in match(),
- // no other rule should ever be ambiguous with the fallback
- // one.
+ // @@ TMP: using target name as the default extension.
//
- pt.path (move (p));
+ pt.path (pt.derived_path (pt.type ().name));
}
return pt.mtime () != timestamp_nonexistent ? &t : nullptr;