[Chapel Merge] Make CHPL_LLVM=bundled compiler builds more robust

Branch: refs/heads/main
Revision: c6c0023
Author: mppf
Log Message:

Merge pull request #18389 from mppf/more-robust-llvm-build

Make CHPL_LLVM=bundled compiler builds more robust

This PR improves the robustness of running make with
CHPL_LLVM=bundled.

Adjust cmake-ok.sh to be more flexible

  • just look for version 3 since 2.8 won't do anymore
  • allow version starting with a different name (e.g. on one system, the
    command is cmake3, and this is reported in the version output)

Build all needed LLVM targets before installing any

When we were build/installing LLVM in stages, it can happen that the LLVM
build gets partway through and then fails or is aborted, and then an
incomplete install is left in the install directory. To fix that, this PR
adjusts third-party/llvm/Makefile to only install after all of the
building has succeeded. This better matches the pattern used in other
third-party Makefiles - including with llvm-build and llvm-install
targets.

Reviewed by @daviditen - thanks!