-TOP_DIRECTORY := $(shell cd $(LEVEL); pwd)
-BUILD_ROOT_TOP := $(LLVM_OBJ_DIR)$(patsubst $(HOME)%,%,$(TOP_DIRECTORY))
-endif
-
-#--------------------------------------------------------------------
-# Variables derived from configuration options...
-#--------------------------------------------------------------------
-
-#BinInstDir=/usr/local/bin
-#LibInstDir=/usrl/local/lib/xxx
-#DocInstDir=/usr/doc/xxx
-
-BURG_OPTS = -I
-
-PURIFY := $(PURIFY) -cache-dir="$(BUILD_ROOT_TOP)/../purifycache" -chain-length="30" -messages=all
-
-# Shorthand for commonly accessed directories
-LIBDEBUG := $(BUILD_ROOT_TOP)/lib/Debug
-LIBRELEASE := $(BUILD_ROOT_TOP)/lib/Release
-TOOLDEBUG := $(BUILD_ROOT_TOP)/tools/Debug
-TOOLRELEASE := $(BUILD_ROOT_TOP)/tools/Release
-
-#---------------------------------------------------------
-# Compilation options...
-#---------------------------------------------------------
-
-# Special tools used while building
-RunBurg := $(BURG) $(BURG_OPTS)
-
-# Enable this for profiling support with 'gprof'
-ifdef ENABLE_PROFILING
-PROFILE = -pg
-else
-PROFILE =
-endif
-
-# -Wno-unused-parameter
-CompileCommonOpts := $(PROFILE) -Wall -W -Wwrite-strings -Wno-unused -I$(LEVEL)/include
-
-# Compile a file, don't link...
-Compile := $(CXX) -c $(CPPFLAGS) $(CXXFLAGS) $(CompileCommonOpts)
-CompileG := $(Compile) -g -D_DEBUG
-CompileO := $(Compile) -O3 -DNDEBUG -finline-functions -felide-constructors -fnonnull-objects -freg-struct-return -fshort-enums
-
-# Link final executable
-
-ifdef ENABLE_PURIFY # To enable purify, build with 'gmake ENABLE_PURIFY=1'
-Link := $(PURIFY) $(CXX) $(PROFILE) -static
-else
-Link := $(CXX) $(PROFILE)
-endif
-LinkG := $(Link) -g -L $(LIBDEBUG)
-LinkO := $(Link) -O3 -L $(LIBRELEASE)
-
-# Create a .so file from a .o files...
-#MakeSO := $(CXX) -shared $(PROFILE)
-MakeSO := $(CXX) -G $(PROFILE)
-MakeSOO := $(MakeSO) -O3
-
-# Create one .o file from a bunch of .o files...
-Relink = ld -r
-
-# Create dependancy file from CPP file, send to stdout.
-Depend := $(CXX) -MM -I$(LEVEL)/include $(CPPFLAGS)
-
-# Archive a bunch of .o files into a .a file...
-AR = ar cq
-
-#----------------------------------------------------------
-
-# Source includes all of the cpp files, and objects are derived from the
-# source files...
-# The local Makefile can list other Source files via ExtraSource = ...
-#
-Source := $(ExtraSource) $(wildcard *.cpp *.c *.y *.l)
-
-Objs := $(sort $(patsubst Debug/%.o, %.o, $(addsuffix .o,$(basename $(Source)))))
-ObjectsO = $(addprefix $(BUILD_ROOT)/Release/,$(Objs)))
-ObjectsG = $(addprefix $(BUILD_ROOT)/Debug/,$(Objs))
-
-
-#---------------------------------------------------------
-# Handle the DIRS option
-#---------------------------------------------------------
-
-ifdef DIRS # Only do this if we're using DIRS!
-
-all :: $(addsuffix /.makeall , $(DIRS))
-install :: $(addsuffix /.makeinstall, $(DIRS))
-clean :: $(addsuffix /.makeclean , $(DIRS))
-
-%/.makeall %/.makeclean %/.makeinstall:
- cd $(@D); $(MAKE) $(subst $(@D)/.make,,$@)
-endif
-
-#---------------------------------------------------------
-# Handle the LIBRARYNAME option - used when building libs...
-#---------------------------------------------------------