1 1.1 joerg //===----------------------------------------------------------------------===// 2 1.1 joerg // Clang Installation Instructions 3 1.1 joerg //===----------------------------------------------------------------------===// 4 1.1 joerg 5 1.1 joerg These instructions describe how to build and install Clang. 6 1.1 joerg 7 1.1 joerg //===----------------------------------------------------------------------===// 8 1.1 joerg // Step 1: Organization 9 1.1 joerg //===----------------------------------------------------------------------===// 10 1.1 joerg 11 1.1 joerg Clang is designed to be built as part of an LLVM build. Assuming that the LLVM 12 1.1 joerg source code is located at $LLVM_SRC_ROOT, then the clang source code should be 13 1.1 joerg installed as: 14 1.1 joerg 15 1.1 joerg $LLVM_SRC_ROOT/tools/clang 16 1.1 joerg 17 1.1 joerg The directory is not required to be called clang, but doing so will allow the 18 1.1 joerg LLVM build system to automatically recognize it and build it along with LLVM. 19 1.1 joerg 20 1.1 joerg //===----------------------------------------------------------------------===// 21 1.1 joerg // Step 2: Configure and Build LLVM 22 1.1 joerg //===----------------------------------------------------------------------===// 23 1.1 joerg 24 1.1 joerg Configure and build your copy of LLVM (see $LLVM_SRC_ROOT/GettingStarted.html 25 1.1 joerg for more information). 26 1.1 joerg 27 1.1 joerg Assuming you installed clang at $LLVM_SRC_ROOT/tools/clang then Clang will 28 1.1 joerg automatically be built with LLVM. Otherwise, run 'make' in the Clang source 29 1.1 joerg directory to build Clang. 30 1.1 joerg 31 1.1 joerg //===----------------------------------------------------------------------===// 32 1.1 joerg // Step 3: (Optional) Verify Your Build 33 1.1 joerg //===----------------------------------------------------------------------===// 34 1.1 joerg 35 1.1 joerg It is a good idea to run the Clang tests to make sure your build works 36 1.1 joerg correctly. From inside the Clang build directory, run 'make test' to run the 37 1.1 joerg tests. 38 1.1 joerg 39 1.1 joerg //===----------------------------------------------------------------------===// 40 1.1 joerg // Step 4: Install Clang 41 1.1 joerg //===----------------------------------------------------------------------===// 42 1.1 joerg 43 1.1 joerg From inside the Clang build directory, run 'make install' to install the Clang 44 1.1 joerg compiler and header files into the prefix directory selected when LLVM was 45 1.1 joerg configured. 46 1.1 joerg 47 1.1 joerg The Clang compiler is available as 'clang' and 'clang++'. It supports a gcc like 48 1.1 joerg command line interface. See the man page for clang for more information. 49