#
# Libtool is found in the current directory.
#
-LIBTOOL := $(LLVM_OBJ_ROOT)/mklib
+LIBTOOL := $(LLVM_OBJ_ROOT)/libtool
#
# If we're not building a shared library, use the disable-shared tag with
LLVMGXX := PATH=$(LLVMTOOLCURRENT):$(PATH) $(LLVMGCCDIR)/bin/g++
#--------------------------------------------------------------------------
-# Some of the compiled LLVM tools which are used for compilation of runtime
-# libraries.
+# The compiled LLVM tools
#
+
LLVMAS := $(LLVMTOOLCURRENT)/llvm-as$(EXEEXT)
+# Find the location of the platform specific LLVM GCC libraries
+LLVMGCCLIBDIR=$(dir $(shell $(LLVMGCC) -print-file-name=libgcc.a))
+# LLVM Tool Definitions (LLVMGCC, LLVMGXX, LLVMAS are provided by
+# Makefile.rules)
+LLI = $(LLVMTOOLCURRENT)/lli$(EXEEXT)
+LLC = $(LLVMTOOLCURRENT)/llc$(EXEEXT)
+LGCCAS = $(LLVMTOOLCURRENT)/gccas$(EXEEXT)
+LGCCLD = $(LGCCLDPROG) -L$(LLVMGCCLIBDIR) -L$(LLVMGCCDIR)/lib
+LDIS = $(LLVMTOOLCURRENT)/llvm-dis$(EXEEXT)
+LOPT = $(LLVMTOOLCURRENT)/opt$(EXEEXT)
+LLINK = $(LLVMTOOLCURRENT)/llvm-link$(EXEEXT)
+LPROF = $(LLVMTOOLCURRENT)/llvm-prof$(EXEEXT)
+LANALYZE = $(LLVMTOOLCURRENT)/analyze$(EXEEXT)
+LBUGPOINT = $(LLVMTOOLCURRENT)/bugpoint$(EXEEXT)
+LLVMC = $(LLVMTOOLCURRENT)/llvmc$(EXEEXT)
###########################################################################
# Pull in limit macros from stdint.h, even in C++:
CPPFLAGS += -D__STDC_LIMIT_MACROS
-### FIXME: this is GCC specific
-CPPFLAGS += -DATTR_DEPRECATED='__attribute__ ((deprecated))'
-
CompileCommonOpts := -Wall -W -Wwrite-strings -Wno-unused
CompileOptimizeOpts := -O3 -DNDEBUG -finline-functions
done
endif
+#---------------------------------------------------------
+# Handle the CONFIG_FILES options
+#---------------------------------------------------------
+ifdef CONFIG_FILES
+install:: install-config-files
+
+$(sysconfdir):
+ $(MKDIR) $(sysconfdir)
+
+install-config-files: $(sysconfdir) $(CONFIG_FILES)
+ $(VERB) echo Installing Configuration Files To $(sysconfdir)
+ $(VERB) for file in $(CONFIG_FILES); do \
+ $(INSTALL) $(SourceDir)/$${file} $(sysconfdir) ; \
+ done
+endif
+
###########################################################################
# Library Build Rules:
#
USED_LIB_PATHS_O := $(addprefix $(DESTLIBRELEASE)/, $(STATICUSEDLIBS))
USED_LIB_PATHS_P := $(addprefix $(DESTLIBPROFILE)/, $(STATICUSEDLIBS))
+LLVMSTATICUSEDLIBS := $(patsubst %.a.o, lib%.a, $(addsuffix .o, $(LLVMLIBS)))
+LLVM_LIB_PATHS_G := $(addprefix $(LLVMLIBDEBUGSOURCE)/, $(LLVMSTATICUSEDLIBS))
+LLVM_LIB_PATHS_O := $(addprefix $(LLVMLIBRELEASESOURCE)/, $(LLVMSTATICUSEDLIBS))
+LLVM_LIB_PATHS_P := $(addprefix $(LLVMLIBPROFILEOURCE)/, $(LLVMSTATICUSEDLIBS))
+
#
# Libtool link options:
# Ensure that all binaries have their symbols exported so that they can
clean::
$(VERB) $(RM) -f $(TOOLEXENAMES)
-$(TOOLEXENAME_G): $(ObjectsG) $(USED_LIB_PATHS_G) $(DESTTOOLDEBUG)/.dir
+$(TOOLEXENAME_G): $(ObjectsG) $(USED_LIB_PATHS_G) $(LLVM_LIB_PATHS_G) $(DESTTOOLDEBUG)/.dir
@${ECHO} Linking $(TOOLNAME) debug executable $(STRIP_WARN_MSG)
$(VERB) $(LinkG) -o $@ $(ObjectsG) $(LIB_OPTS_G) $(LINK_OPTS) $(LIBS)
@${ECHO} ======= Finished building $(TOOLNAME) debug executable $(STRIP_WARN_MSG) =======
-$(TOOLEXENAME_O): $(ObjectsO) $(USED_LIB_PATHS_O) $(DESTTOOLRELEASE)/.dir
+$(TOOLEXENAME_O): $(ObjectsO) $(USED_LIB_PATHS_O) $(LLVM_LIB_PATHS_O) $(DESTTOOLRELEASE)/.dir
@${ECHO} Linking $(TOOLNAME) release executable
$(VERB) $(LinkO) -o $@ $(ObjectsO) $(LIB_OPTS_O) $(LINK_OPTS) $(LIBS)
@${ECHO} ======= Finished building $(TOOLNAME) release executable =======
-$(TOOLEXENAME_P): $(ObjectsP) $(USED_LIB_PATHS_P) $(DESTTOOLPROFILE)/.dir
+$(TOOLEXENAME_P): $(ObjectsP) $(USED_LIB_PATHS_P) $(LLVM_LIB_PATHS_P) $(DESTTOOLPROFILE)/.dir
@${ECHO} Linking $(TOOLNAME) profile executable
$(VERB) $(LinkP) -o $@ $(ObjectsP) $(LIB_OPTS_P) $(LINK_OPTS) $(LIBS)
@${ECHO} ======= Finished building $(TOOLNAME) profile executable =======
#---------------------------------------------------------
.PRECIOUS: $(BUILD_OBJ_DIR)/Depend/.dir $(BUILD_OBJ_DIR)/BytecodeObj/.dir
.PRECIOUS: $(BUILD_OBJ_DIR)/Debug/.dir $(BUILD_OBJ_DIR)/Release/.dir
+.PRECIOUS: $(BUILD_OBJ_DIR)/Profile/.dir
# Create .lo files in the ObjectFiles directory from the .cpp and .c files...
$(BUILD_OBJ_DIR)/Release/%.lo: %.cpp $(BUILD_OBJ_DIR)/Release/.dir