(rule
 (alias foo)
 (action (echo Hello!)))

(rule
 (targets foo.txt)
 (mode promote-until-clean)
 (action
  (with-stdout-to %{targets} (echo "Foo"))))

(rule
 (targets @bar)
 (mode promote-until-clean)
 (action
  (with-stdout-to %{targets} (echo "Bar"))))
