Subtarget feature can now set any variable to any value
[oota-llvm.git] / Makefile.rules
index 9f07c1ad6837f117ed359cfbff3d3878fca46d88..39c741a8838c196a294dbe5529bf000c352fe815 100644 (file)
@@ -108,6 +108,9 @@ spotless:
        else \
          $(EchoCmd) "make spotless" can only be run from $(PROJ_OBJ_ROOT); \
        fi
+else
+spotless:
+       $(EchoCmd) "spotless target not supported for objdir == srcdir"
 endif
 
 $(BUILT_SOURCES) : $(ObjMakefiles)
@@ -475,9 +478,9 @@ $(RecursiveTargets)::
        done
 endif
 
-#---------------------------------------------------------
+#-----------------------------------------------------------
 # Handle the PARALLEL_DIRS options for parallel construction
-#---------------------------------------------------------
+#-----------------------------------------------------------
 ifdef PARALLEL_DIRS
 
 SubDirs += $(PARALLEL_DIRS)
@@ -769,8 +772,10 @@ $(warning Bytecode libraries require llvm-gcc which could not be found ****)
 else
 
 # make the C and C++ compilers strip debug info out of bytecode libraries.
+ifndef DEBUG_RUNTIME
 BCCompile.C += -Wa,-strip-debug
 BCCompile.CXX += -Wa,-strip-debug
+endif
 
 all-local:: $(LibName.BCA)
 
@@ -1217,7 +1222,6 @@ $(LexObjs): $(ObjDir)/%.o : $(PROJ_SRC_DIR)/%.cpp
 
 clean-local::
        -$(Verb) $(RM) -f $(LexOutput)
-       $(Verb) $(RM) -f $(LexOutput)
 
 endif
 
@@ -1228,7 +1232,6 @@ endif
 
 YaccFiles  := $(filter %.y,$(Sources))
 ifneq ($(YaccFiles),)
-YaccOutput := $(addprefix $(patsubst %.y,%,$(YaccFiles)),.output)
 
 .PRECIOUS: $(YaccOutput)
 
@@ -1237,7 +1240,7 @@ YaccOutput := $(addprefix $(patsubst %.y,%,$(YaccFiles)),.output)
 %.cpp: %.y
 %.h: %.y
 
-# Rule for building the bison parsers...
+# Rule for building the bison based parsers...
 $(PROJ_SRC_DIR)/%.cpp $(PROJ_SRC_DIR)/%.h : $(PROJ_SRC_DIR)/%.y
        $(Echo) "Bisoning $*.y"
        $(Verb) $(BISON) -v -d -p $(<F:%Parser.y=%) -o $*.tab.c $<
@@ -1245,8 +1248,13 @@ $(PROJ_SRC_DIR)/%.cpp $(PROJ_SRC_DIR)/%.h : $(PROJ_SRC_DIR)/%.y
        $(Verb) $(MV) -f $*.tab.h $(PROJ_SRC_DIR)/$*.h
        $(Echo) "*** DON'T FORGET TO CHECK IN $*.cpp and $*.h (generated files)"
 
+YaccObjs   := $(patsubst %.y,$(ObjDir)/%.o,$(YaccFiles))
+$(YaccObjs): $(ObjDir)/%.o : $(PROJ_SRC_DIR)/%.cpp
+
+YaccOutput := $(addprefix $(patsubst %.y,%,$(YaccFiles)),.output)
+
 clean-local::
-       $(Verb) $(RM) -f $(YaccOutput)
+       -$(Verb) $(RM) -f $(YaccOutput)
 endif
 
 ###############################################################################
@@ -1560,12 +1568,14 @@ install-local::
            $(DataInstall) $$hdr $(PROJ_includedir)/$$hdr ; \
          done ; \
        fi
+ifneq ($(PROJ_SRC_ROOT),$(PROJ_OBJ_ROOT))
        $(Verb) if test -d "$(PROJ_OBJ_ROOT)/include" ; then \
          cd $(PROJ_OBJ_ROOT)/include && \
-         for hdr in `find . -type f -print` ; do \
+         for hdr in `find . -type f -print | grep -v CVS` ; do \
            $(DataInstall) $$hdr $(PROJ_includedir)/$$hdr ; \
          done ; \
        fi
+endif
 
 uninstall-local::
        $(Echo) Uninstalling include files