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