aboutsummaryrefslogtreecommitdiff
path: root/libbuild2/adhoc-rule-buildscript.cxx
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2021-12-14 07:49:54 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2021-12-14 07:49:54 +0200
commit87a8357fe797fd2e2a07c8bfa22353d63b3f8b6c (patch)
tree3611089cf72b71c21168c5c28ffbda9d43542697 /libbuild2/adhoc-rule-buildscript.cxx
parent9d860f46631c1567c62336fcb25cf7b8090855a4 (diff)
Clean .t file in ad hoc recipe
Diffstat (limited to 'libbuild2/adhoc-rule-buildscript.cxx')
-rw-r--r--libbuild2/adhoc-rule-buildscript.cxx21
1 files changed, 18 insertions, 3 deletions
diff --git a/libbuild2/adhoc-rule-buildscript.cxx b/libbuild2/adhoc-rule-buildscript.cxx
index dce82dc..e0e69dc 100644
--- a/libbuild2/adhoc-rule-buildscript.cxx
+++ b/libbuild2/adhoc-rule-buildscript.cxx
@@ -336,7 +336,7 @@ namespace build2
// See if we are providing the standard clean as a fallback.
//
if (me.fallback)
- return &perform_clean_depdb;
+ return &perform_clean_file;
// See if this is not update or not on a file-based target.
//
@@ -926,8 +926,8 @@ namespace build2
if (f.relative ())
{
if (!byp.cwd)
- fail (il) << "relative path " << f << " in make dependency "
- << "declaration" <<
+ fail (il) << "relative path '" << f << "' in make dependency"
+ << " declaration" <<
info << "consider using --cwd to specify relative path "
<< "base";
@@ -1387,6 +1387,21 @@ namespace build2
}
target_state adhoc_buildscript_rule::
+ perform_clean_file (action a, const target& t)
+ {
+ // Besides .d (depdb) also clean .t which is customarily used as a
+ // temporary file, such as make dependency output in depdb-dyndep. In
+ // fact, initially the plan was to only clean it if we have dyndep but
+ // there is no reason it cannot be used for something else.
+ //
+ // Note that the main advantage of using this file over something in the
+ // temporary directory ($~) is that it's next to other output which makes
+ // it easier to examine during recipe troubleshooting.
+ //
+ return perform_clean_extra (a, t.as<file> (), {".d", ".t"});
+ }
+
+ target_state adhoc_buildscript_rule::
default_action (action a,
const target& t,
const optional<timestamp>& deadline) const