From: Richard W.M. Jones Date: Fri, 3 Jan 2020 08:02:29 +0000 (+0000) Subject: eval: Goals with no targets always need a rebuild. X-Git-Tag: v'0.2'~105 X-Git-Url: http://git.annexia.org/?a=commitdiff_plain;h=ef2b2a9ce0c7ba6f05754e3da1e5e9fbbdf88d15;p=goals.git eval: Goals with no targets always need a rebuild. --- 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). *)