-# USED_LIBS_OPTIONS - Compute the options line that add -llib1 -llib2, etc.
-PROJ_LIBS_OPTIONS := $(patsubst %.a.o, -l%, $(addsuffix .o, $(USEDLIBS)))
-PROJ_LIBS_OPTIONS_G := $(patsubst %.o, $(PROJLIBDEBUGSOURCE)/%.o, $(PROJ_LIBS_OPTIONS))
-PROJ_LIBS_OPTIONS_O := $(patsubst %.o, $(PROJLIBRELEASESOURCE)/%.o,$(PROJ_LIBS_OPTIONS))
-PROJ_LIBS_OPTIONS_P := $(patsubst %.o, $(PROJLIBPROFILESOURCE)/%.o,$(PROJ_LIBS_OPTIONS))
-
-LLVM_LIBS_OPTIONS := $(patsubst %.a.o, -l%, $(addsuffix .o, $(LLVMLIBS)))
-LLVM_LIBS_OPTIONS_G := $(patsubst %.o, $(LLVMLIBDEBUGSOURCE)/%.o, $(LLVM_LIBS_OPTIONS))
-LLVM_LIBS_OPTIONS_O := $(patsubst %.o, $(LLVMLIBRELEASESOURCE)/%.o,$(LLVM_LIBS_OPTIONS))
-LLVM_LIBS_OPTIONS_P := $(patsubst %.o, $(LLVMLIBPROFILESOURCE)/%.o,$(LLVM_LIBS_OPTIONS))
-
-LIB_OPTS_G := $(LLVM_LIBS_OPTIONS_G) $(PROJ_LIBS_OPTIONS_G)
-LIB_OPTS_O := $(LLVM_LIBS_OPTIONS_O) $(PROJ_LIBS_OPTIONS_O)
-LIB_OPTS_P := $(LLVM_LIBS_OPTIONS_P) $(PROJ_LIBS_OPTIONS_P)
-
-# USED_LIB_PATHS - Compute the path of the libraries used so that tools are
-# rebuilt if libraries change. This has to make sure to handle .a/.so and .o
-# files seperately.
-#
-STATICUSEDLIBS := $(patsubst %.a.o, lib%.a, $(addsuffix .o, $(USEDLIBS)))
-USED_LIB_PATHS_G := $(addprefix $(DESTLIBDEBUG)/, $(STATICUSEDLIBS))
-USED_LIB_PATHS_O := $(addprefix $(DESTLIBRELEASE)/, $(STATICUSEDLIBS))
-USED_LIB_PATHS_P := $(addprefix $(DESTLIBPROFILE)/, $(STATICUSEDLIBS))
-LINK_OPTS := $(TOOLLINKOPTS) $(PLATFORMLINKOPTS)
-
-
-
-
-
-
-# Tell make that we need to rebuild subdirectories before we can link the tool.
-# This affects things like LLI which has library subdirectories.
-$(USED_LIB_PATHS_G) $(USED_LIB_PATHS_O) $(USED_LIB_PATHS_P): \
- $(addsuffix /.makeall, $(PARALLEL_DIRS))
-
-all:: $(TOOLEXENAMES)
-
-clean::
- $(VERB) rm -f $(TOOLEXENAMES)
-
-$(TOOLEXENAME_G): $(ObjectsG) $(USED_LIB_PATHS_G) $(DESTTOOLDEBUG)/.dir
- @echo ======= Linking $(TOOLNAME) debug executable $(STRIP_WARN_MSG)=======
- $(VERB) $(LinkG) -o $@ $(ObjectsG) $(LIB_OPTS_G) $(LINK_OPTS)
-
-$(TOOLEXENAME_O): $(ObjectsO) $(USED_LIB_PATHS_O) $(DESTTOOLRELEASE)/.dir
- @echo ======= Linking $(TOOLNAME) release executable =======
- $(VERB) $(LinkO) -o $@ $(ObjectsO) $(LIB_OPTS_O) $(LINK_OPTS)
-
-$(TOOLEXENAME_P): $(ObjectsP) $(USED_LIB_PATHS_P) $(DESTTOOLPROFILE)/.dir
- @echo ======= Linking $(TOOLNAME) profile executable =======
- $(VERB) $(LinkP) -o $@ $(ObjectsP) $(LIB_OPTS_P) $(LINK_OPTS)
-
-endif
-
-
-
-#---------------------------------------------------------
-.PRECIOUS: $(BUILD_OBJ_DIR)/Depend/.dir
-.PRECIOUS: $(BUILD_OBJ_DIR)/Debug/.dir $(BUILD_OBJ_DIR)/Release/.dir
-
-# Create .o files in the ObjectFiles directory from the .cpp and .c files...
-$(BUILD_OBJ_DIR)/Release/%.o: $(SourceDir)%.cpp $(BUILD_OBJ_DIR)/Release/.dir
- @echo "Compiling $<"
- $(VERB) $(CompileO) $< -o $@
-
-$(BUILD_OBJ_DIR)/Release/%.o: $(SourceDir)%.c $(BUILD_OBJ_DIR)/Release/.dir
- $(VERB) $(CompileCO) $< -o $@
-
-$(BUILD_OBJ_DIR)/Profile/%.o: $(SourceDir)%.cpp $(BUILD_OBJ_DIR)/Profile/.dir
- @echo "Compiling $<"
- $(VERB) $(CompileP) $< -o $@
-
-$(BUILD_OBJ_DIR)/Profile/%.o: $(SourceDir)%.c $(BUILD_OBJ_DIR)/Profile/.dir
- @echo "Compiling $<"
- $(VERB) $(CompileCP) $< -o $@
-
-$(BUILD_OBJ_DIR)/Debug/%.o: $(SourceDir)%.cpp $(BUILD_OBJ_DIR)/Debug/.dir
- @echo "Compiling $<"
- $(VERB) $(CompileG) $< -o $@
-
-$(BUILD_OBJ_DIR)/Debug/%.o: $(SourceDir)%.c $(BUILD_OBJ_DIR)/Debug/.dir
- $(VERB) $(CompileCG) $< -o $@
-
-#
-# Rules for building lex/yacc files
-#
-LEX_FILES = $(filter %.l, $(Source))
-LEX_OUTPUT = $(LEX_FILES:%.l=%.cpp)
-YACC_FILES = $(filter %.y, $(Source))
-YACC_OUTPUT = $(addprefix $(YACC_FILES:%.y=%), .h .cpp .output)
-.PRECIOUS: $(LEX_OUTPUT) $(YACC_OUTPUT)
-
-# Create a .cpp source file from a flex input file... this uses sed to cut down
-# on the warnings emited by GCC...
-#
-# The last line is a gross hack to work around flex aparently not being able to
-# resize the buffer on a large token input. Currently, for uninitialized string
-# buffers in LLVM we can generate very long tokens, so this is a hack around it.
-# FIXME. (f.e. char Buffer[10000]; )
-#
-%.cpp: %.l
- $(FLEX) -t $< | sed '/^find_rule/d' | \
- sed 's/void yyunput/inline void yyunput/' | \
- sed 's/void \*yy_flex_realloc/inline void *yy_flex_realloc/' | \
- sed 's/#define YY_BUF_SIZE 16384/#define YY_BUF_SIZE (16384*64)/' > $@
-
-# Rule for building the bison parsers...
-%.c: %.y # Cancel built-in rules for yacc
-%.h: %.y # Cancel built-in rules for yacc
-%.cpp %.h : %.y
- @echo Bison\'ing $<...
- $(VERB) $(BISON) -v -d -p $(<:%Parser.y=%) $*.y
- $(VERB) mv -f $*.tab.c $*.cpp
- $(VERB) mv -f $*.tab.h $*.h
-
-# To create the directories...
-%/.dir:
- $(VERB) mkdir -p $*
- @date > $@
-
-# To create postscript files from dot files...
-%.ps: %.dot
- dot -Tps < $< > $@
-
-# 'make clean' nukes the tree
-clean::
- $(VERB) rm -rf $(BUILD_OBJ_DIR)/Debug $(BUILD_OBJ_DIR)/Release $(BUILD_OBJ_DIR)/Profile $(BUILD_OBJ_DIR)/Depend
- $(VERB) rm -f core core.[0-9][0-9]* *.o *.d *.so *~ *.flc
- $(VERB) rm -f $(LEX_OUTPUT) $(YACC_OUTPUT)
-
-# If dependencies were generated for the file that included this file,
-# include the dependancies now...
-#
-SourceBaseNames := $(basename $(notdir $(filter-out Debug/%, $(Source))))
-SourceDepend := $(SourceBaseNames:%=$(BUILD_OBJ_DIR)/Depend/%.d)
-
-# Create dependencies for the *.cpp files...
-#$(SourceDepend): \x
-$(BUILD_OBJ_DIR)/Depend/%.d: $(SourceDir)%.cpp $(BUILD_OBJ_DIR)/Depend/.dir
- $(VERB) $(Depend) $< | sed 's|$*\.o *|$(BUILD_OBJ_DIR)/Release/& $(BUILD_OBJ_DIR)/Profile/& $(BUILD_OBJ_DIR)/Debug/& $(BUILD_OBJ_DIR)/Depend/$(@F)|g' > $@
-
-# Create dependencies for the *.c files...
-#$(SourceDepend): \x
-$(BUILD_OBJ_DIR)/Depend/%.d: $(SourceDir)%.c $(BUILD_OBJ_DIR)/Depend/.dir
- $(VERB) $(DependC) $< | sed 's|$*\.o *|Release/& Profile/& Debug/& Depend/$(@F)|g' > $@
-
-ifneq ($(SourceDepend),)
--include $(SourceDepend)
-endif