+###########################################################################
+
+PWD := @BINPWD@
+# Set the project name to LLVM if its not defined
+ifndef PROJECT_NAME
+PROJECT_NAME := $(LLVMPackageName)
+endif
+
+PROJ_OBJ_DIR := $(shell $(PWD))
+PROJ_OBJ_ROOT := $(shell cd $(PROJ_OBJ_DIR)/$(LEVEL); $(PWD))
+
+ifeq ($(PROJECT_NAME),llvm)
+LLVM_SRC_ROOT := $(shell cd @abs_top_srcdir@; $(PWD))
+LLVM_OBJ_ROOT := $(shell cd @abs_top_builddir@; $(PWD))
+PROJ_SRC_ROOT := $(shell cd $(LLVM_SRC_ROOT); $(PWD))
+PROJ_SRC_DIR := $(shell cd $(LLVM_SRC_ROOT)/$(patsubst $(PROJ_OBJ_ROOT)%,%,$(PROJ_OBJ_DIR)); $(PWD))
+PROJ_prefix := @prefix@
+PROJ_bindir := @prefix@/bin
+PROJ_libdir := @prefix@/lib
+PROJ_datadir := @prefix@/share
+PROJ_docsdir := @prefix@/docs/llvm
+PROJ_etcdir := @prefix@/etc/llvm
+PROJ_includedir := @prefix@/include
+PROJ_infodir := @prefix@/info
+PROJ_mandir := @prefix@/man
+PROJ_VERSION := $(LLVMVersion)
+else
+ifndef PROJ_SRC_ROOT
+$(error Projects must define PROJ_SRC_ROOT)
+endif
+ifndef PROJ_OBJ_ROOT
+$(error Projects must define PROJ_OBJ_ROOT)
+endif
+ifndef PROJ_INSTALL_ROOT
+$(error Projects must define PROJ_INSTALL_ROOT)
+endif
+ifndef LLVM_SRC_ROOT
+$(error Projects must define LLVM_SRC_ROOT)
+endif
+ifndef LLVM_OBJ_ROOT
+$(error Projects must define LLVM_OBJ_ROOT)
+endif
+PROJ_SRC_DIR := $(shell cd $(PROJ_SRC_ROOT)/$(patsubst $(PROJ_OBJ_ROOT)%,%,$(PROJ_OBJ_DIR)); $(PWD))
+PROJ_prefix := $(PROJ_INSTALL_ROOT)
+PROJ_bindir := $(PROJ_INSTALL_ROOT)/bin
+PROJ_libdir := $(PROJ_INSTALL_ROOT)/lib
+PROJ_datadir := $(PROJ_INSTALL_ROOT)/share
+PROJ_docsdir := $(PROJ_INSTALL_ROOT)/docs/llvm
+PROJ_etcdir := $(PROJ_INSTALL_ROOT)/etc/llvm
+PROJ_includedir := $(PROJ_INSTALL_ROOT)/include
+PROJ_infodir := $(PROJ_INSTALL_ROOT)/info
+PROJ_mandir := $(PROJ_INSTALL_ROOT)/man
+ifndef PROJ_VERSION
+PROJ_VERSION := 1.0
+endif
+endif
+
+# Determine if we're on a unix type operating system
+LLVM_ON_UNIX:=@LLVM_ON_UNIX@
+LLVM_ON_WIN32:=@LLVM_ON_WIN32@
+
+# Target operating system for which LLVM will be compiled.