Problem of building llvm/clang using CMake

Hi,

I am trying to build llvm/clang on my macbook. But it always failed for me.

First, I git clone the code to /usr/local/llvm-src/ folder:

$ git clone http://llvm.org/git/llvm.git
$ cd llvm/tools
$ git clone http://llvm.org/git/clang.git
$ cd …/projects
$ git clone http://llvm.org/git/compiler-rt.git
$ cd …/tools/clang/tools
$ git clone http://llvm.org/git/clang-tools-extra.git

Then, I generate the Xcode from the /usr/local/llvm-src/build folder and specify the target install directory of /usr/local/llvm-src/install:
cmake -G Xcode -DCMAKE_INSTALL_PREFIX=/usr/local/llvm-src/install /usr/local/llvm-src/llvm

Finally, I open the generated project file in Xcode, switch the schema to “Install” and run “Build” from Product menu. But it failed in Xcode with error below:

CMake Error at projects/compiler-rt/lib/builtins/cmake_install.cmake:31 (file):

file INSTALL cannot find

“/usr/local/llvm-src/build/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/lib/clang/3.8.0/lib/darwin/libclang_rt.cc_kext.a”.

Call Stack (most recent call first):

projects/compiler-rt/lib/cmake_install.cmake:32 (include)

projects/compiler-rt/cmake_install.cmake:33 (include)

projects/cmake_install.cmake:32 (include)

cmake_install.cmake:55 (include)

make: *** [install_buildpart_0] Error 1

Command /bin/sh failed with exit code 2

Any ideas?

Jeffrey