+ The LLVM build system is designed to facilitate the building of third party
+ projects that use LLVM header files, libraries, and tools. In order to use
+ these facilities, a Makefile from a project must do the following things:
+
+ <ol>
+ <li>Set environment variables.
+ <p>
+ There are several environment variables that a Makefile needs to set to
+ use the LLVM build system:
+ <dl compact>
+ <dt>LLVM_SRC_ROOT
+ <dd>
+ The root of the LLVM source tree.
+ <p>
+
+ <dt>LLVM_OBJ_ROOT
+ <dd>
+ The root of the LLVM object tree.
+ <p>
+
+ <dt>BUILD_SRC_ROOT
+ <dd>
+ The root of the project's source tree.
+ <p>
+
+ <dt>BUILD_OBJ_ROOT
+ <dd>
+ The root of the project's object tree.
+ <p>
+
+ <dt>BUILD_SRC_DIR
+ <dd>
+ The directory containing the current source to be compiled.
+ <p>
+
+ <dt>BUILD_OBJ_DIR
+ <dd>
+ The directory where the current source will place the new object
+ files. This should always be the current directory.
+ <p>
+
+ <dt>LEVEL
+ <dd>
+ The relative path from the current directory to the root of the
+ object tree.
+ <p>
+ </dl>
+
+ <li>Include the LLVM Makefile.config from $(LLVM_OBJ_ROOT).
+ <p>
+
+ <li>Include the LLVM Makefile.rules from $(LLVM_SRC_ROOT).
+ </ol>
+
+ There are two ways that you can set all of these variables:
+ <ol>
+ <li>
+ You can write your own Makefiles which hard-code these values.
+
+ <li>
+ You can use the pre-made LLVM sample project. This sample project
+ includes Makefiles, a configure script that can be used to configure
+ the location of LLVM, and the ability to support multiple object
+ directories from a single source directory.
+ </ol>
+
+ This document assumes that you will base your project off of the LLVM
+ sample project found in <tt>llvm/projects/sample</tt>. If you want to
+ devise your own build system, studying the sample project and LLVM
+ Makefiles will probably provide enough information on how to write your own
+ Makefiles.
+ <p>
+
+ <!--===============================================================-->
+ <h2><a name="a">Create a Project from the Sample Project</a><hr></h2>
+ <!--===============================================================-->
+
+ Follow these simple steps to start your project: