Point to the correct cc1/cc1plus binaries
[oota-llvm.git] / Makefile.common
index 0ba5aadd828bb0f74dd9192d1341e87a8053ab58..2e85e70138168b04bacf9fe5b9484f15353526e3 100644 (file)
@@ -169,13 +169,24 @@ prdirs::
        echo "LLVM  Source Root: " $(LLVM_SRC_ROOT)
        echo "LLVM  Object Root: " $(LLVM_OBJ_ROOT)
 
+###########################################################################
+# Suffixes and implicit rules:
+#      Empty out the list of suffixes, generate a list that is only
+#      used by this Makefile, and cancel useless implicit rules.   This
+#      will hopefully speed up compilation a little bit.
+###########################################################################
+.SUFFIXES:
+.SUFFIXES: .c .cpp .h .hpp .y .l
+.SUFFIXES: .lo .o .a .so .bc
+.SUFFIXES: .ps .dot .d
+
 #
 # Mark all of these targets as phony.  This will hopefully speed up builds
 # slightly since GNU Make will not try to find implicit rules for targets
 # which are marked as Phony.
 #
 .PHONY: all dynamic bytecodelib bytecodelib-install
-.PHONY: clean distclean install test bytecode prdirs
+.PHONY: clean cleandeps distclean install test bytecode prdirs
 
 ###########################################################################
 # Miscellaneous paths and commands:
@@ -212,11 +223,6 @@ ifdef ENABLE_PROFILING
   PROFILE = -pg
 endif
 
-#
-# Suffixes for library compilation rules
-#
-.SUFFIXES: .so
-
 ###########################################################################
 # Library Locations:
 #      These variables describe various library locations:
@@ -314,9 +320,9 @@ TBLGEN  := $(LLVMTOOLCURRENT)/tblgen
 # The LLVM GCC front-end in C and C++ flavors
 #
 LLVMGCC := PATH=$(LLVMTOOLCURRENT):$(PATH) $(LLVMGCCDIR)/bin/gcc
-LCC1    := $(LLVMGCCDIR)/lib/gcc-lib/$(LLVMGCCARCH)/cc1
+LCC1    := $(LLVMGCCDIR)/libexec/gcc/$(LLVMGCCARCH)/cc1
 LLVMGXX := PATH=$(LLVMTOOLCURRENT):$(PATH) $(LLVMGCCDIR)/bin/g++
-LCC1XX  := $(LLVMGCCDIR)/lib/gcc-lib/$(LLVMGCCARCH)/cc1plus
+LCC1XX  := $(LLVMGCCDIR)/libexec/gcc/$(LLVMGCCARCH)/cc1plus
 
 #--------------------------------------------------------------------------
 # Some of the compiled LLVM tools which are used for compilation of runtime
@@ -380,9 +386,6 @@ LinkP    := $(Link) -O3 -L$(PROJLIBPROFILESOURCE) -L$(LLVMLIBPROFILESOURCE) $(PR
 
 # Create one .o file from a bunch of .o files...
 Relink := ${LIBTOOL} --mode=link $(CXX)
-ifndef SHARED_LIBRARY
-Relink += -only-static
-endif
 
 #
 # Configure where the item being compiled should go.
@@ -435,7 +438,7 @@ RObjectsG := $(addprefix $(BUILD_OBJ_DIR)/Debug/,$(RObjs))
 #---------------------------------------------------------
 
 ifdef DIRS
-all install clean test bytecode ::
+all install clean cleandeps test bytecode ::
        $(VERB) for dir in ${DIRS}; do \
                (cd $$dir; $(MAKE) $@) || exit 1; \
        done
@@ -446,16 +449,18 @@ ifdef PARALLEL_DIRS
 all      :: $(addsuffix /.makeall     , $(PARALLEL_DIRS))
 install  :: $(addsuffix /.makeinstall , $(PARALLEL_DIRS))
 clean    :: $(addsuffix /.makeclean   , $(PARALLEL_DIRS))
+cleandeps:: $(addsuffix /.makecleandeps, $(PARALLEL_DIRS))
 test     :: $(addsuffix /.maketest    , $(PARALLEL_DIRS))
 bytecode :: $(addsuffix /.makebytecode, $(PARALLEL_DIRS))
 
-%/.makeall %/.makeinstall %/.makeclean %/.maketest %/.makebytecode:
+%/.makeall %/.makeinstall %/.makeclean %/.makecleandeps %/.maketest \
+    %/.makebytecode:
        $(VERB) cd $(@D); $(MAKE) $(subst $(@D)/.make,,$@)
 endif
 
 # Handle directories that may or may not exist
 ifdef OPTIONAL_DIRS
-all install clean test bytecode ::
+all install clean cleandeps test bytecode ::
        $(VERB) for dir in ${OPTIONAL_DIRS}; do \
                if [ -d $$dir ]; \
                then\
@@ -831,8 +836,14 @@ $(BUILD_OBJ_DIR)/Depend/%.d: $(SourceDir)%.c $(BUILD_OBJ_DIR)/Depend/.dir
 #
 ifneq ($(MAKECMDGOALS),clean)
 ifneq ($(MAKECMDGOALS),distclean)
+ifneq ($(MAKECMDGOALS),cleandeps)
 ifneq ($(SourceDepend),)
 -include $(SourceDepend)
 endif
 endif
 endif
+endif
+
+cleandeps::
+       $(VERB) rm -f $(SourceDepend)
+