From ef2b2a9ce0c7ba6f05754e3da1e5e9fbbdf88d15 Mon Sep 17 00:00:00 2001 From: "Richard W.M. Jones" Date: Fri, 3 Jan 2020 08:02:29 +0000 Subject: [PATCH] eval: Goals with no targets always need a rebuild. --- src/eval.ml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/eval.ml b/src/eval.ml index 1520dcb..39b0893 100644 --- a/src/eval.ml +++ b/src/eval.ml @@ -92,8 +92,11 @@ and run_goal env loc name args (params, patterns, deps, code) = (* Check all dependencies have been updated. *) evaluate_targets env deps; - (* Check if any target (ie. pattern) needs to be rebuilt. *) - let rebuild = List.exists (needs_rebuild env loc deps) patterns in + (* Check if any target (ie. pattern) needs to be rebuilt. + * As with make, a goal with no targets is always run. + *) + let rebuild = + patterns = [] || List.exists (needs_rebuild env loc deps) patterns in if rebuild then ( (* Run the code (if any). *) -- 1.8.3.1