+# 5. SourceDir - If specified, this specifies a directory that the source files
+# are in, if they are not in the current directory. This should include a
+# trailing / character.
+#
+# 6. LLVM_SRC_ROOT - If specified, points to the top of the LLVM source tree.
+#
+# 7. LLVM_OBJ_ROOT - If specified, points to the top directory where LLVM
+# object files are placed.
+#
+# 8. BUILD_SRC_DIR - The directory which contains the current set of Makefiles
+# and usually the source code too (unless SourceDir is set).
+#
+# 9. BUILD_SRC_ROOT - The root directory of the source code being compiled.
+#
+# 10. BUILD_OBJ_DIR - The directory where object code should be placed.
+#
+# 11. BUILD_OBJ_ROOT - The root directory for where object code should be
+# placed.
+#
+# For building,
+# LLVM, LLVM_SRC_ROOT = BUILD_SRC_ROOT, and
+# LLVM_OBJ_ROOT = BUILD_OBJ_ROOT.
+#===-----------------------------------------------------------------------====
+
+#
+# Configuration file to set paths specific to local installation of LLVM
+#
+include $(LEVEL)/Makefile.config
+
+###########################################################################
+# Directory Configuration
+# This section of the Makefile determines what is where. To be
+# specific, there are several locations that need to be defined:
+#
+# o LLVM_SRC_ROOT : The root directory of the LLVM source code.
+# o LLVM_OBJ_ROOT : The root directory containing the built LLVM code.
+#
+# o BUILD_SRC_DIR : The directory containing the code to build.
+# o BUILD_SRC_ROOT : The root directory of the code to build.
+#
+# o BUILD_OBJ_DIR : The directory in which compiled code will be placed.
+# o BUILD_OBJ_ROOT : The root directory in which compiled code is placed.
+#
+###########################################################################
+
+#
+# Set the source build directory. That is almost always the current directory.
+#
+ifndef BUILD_SRC_DIR
+BUILD_SRC_DIR = $(shell pwd)
+endif
+
+#
+# Set the source root directory.
+#
+ifndef BUILD_SRC_ROOT
+BUILD_SRC_ROOT = $(shell cd $(BUILD_SRC_DIR)/$(LEVEL); pwd)
+endif
+
+#
+# Determine the path of the source tree relative from $HOME (the mythical
+# home directory).
+#
+HOME_OBJ_ROOT := $(OBJ_ROOT)$(patsubst $(HOME)%,%,$(BUILD_SRC_ROOT))
+
+#
+# Set the object build directory. Its location depends upon the source path
+# and where object files should go.
+#
+ifndef BUILD_OBJ_DIR
+ifeq ($(OBJ_ROOT),.)
+BUILD_OBJ_DIR = $(BUILD_SRC_DIR)
+else
+BUILD_OBJ_DIR := $(HOME_OBJ_ROOT)$(patsubst $(BUILD_SRC_ROOT)%,%,$(BUILD_SRC_DIR))
+endif
+endif
+
+#
+# Set the root of the object directory.
+#
+ifndef BUILD_OBJ_ROOT
+ifeq ($(OBJ_ROOT),.)
+BUILD_OBJ_ROOT = $(BUILD_SRC_ROOT)
+else
+BUILD_OBJ_ROOT := $(HOME_OBJ_ROOT)
+endif
+endif
+
+#
+# Set the LLVM source directory.
+# It is typically the root directory of what we're compiling now.
+#
+ifndef LLVM_SRC_ROOT
+LLVM_SRC_ROOT = $(BUILD_SRC_ROOT)
+endif
+
+#
+# Set the LLVM object directory.
+#
+ifndef LLVM_OBJ_ROOT
+LLVM_OBJ_ROOT = $(BUILD_OBJ_ROOT)
+endif
+
+###########################################################################
+# Default Targets:
+# The following targets are the standard top level targets for
+# building.
+###########################################################################
+
+ifdef SHARED_LIBRARY
+# if SHARED_LIBRARY is specified, the default is to build the dynamic lib
+all:: dynamic
+endif