Print ConstantPoolSDNode offset field.
[oota-llvm.git] / Makefile.rules
index 33432b8cb514ebc99ccb22bc05f34772eb0d6c53..be2bafc30f20e0750dc7b044ffbc996bcc82f5e7 100644 (file)
@@ -951,6 +951,11 @@ endif
 # Object Build Rules: Build object files based on sources 
 ###############################################################################
 
+# FIXME: This should be checking for "if not GCC or ICC", not for "if HP-UX"
+ifeq ($(OS),HP-UX)
+  DISABLE_AUTO_DEPENDENCIES=1
+endif
+
 # Provide rule sets for when dependency generation is enabled
 ifndef DISABLE_AUTO_DEPENDENCIES
 
@@ -1226,7 +1231,7 @@ $(PROJ_SRC_DIR)/%.cpp: $(PROJ_SRC_DIR)/%.l
 # source location and building them.
 $(LexFiles:%.l=$(PROJ_SRC_DIR)/%.cpp.cvs): \
 $(PROJ_SRC_DIR)/%.cpp.cvs: $(PROJ_SRC_DIR)/%.cpp
-       $(Verb) $(CMP) -s $@ $< || \
+       $(Verb) $(CMP) -s $(PROJ_SRC_DIR)/$*.l $(PROJ_SRC_DIR)/$*.l.cvs || \
       ($(CP) $< $@; $(CP) $(PROJ_SRC_DIR)/$*.l $(PROJ_SRC_DIR)/$*.l.cvs)
 
 $(LexFiles:%.l=$(ObjDir)/%.o) : \
@@ -1247,6 +1252,8 @@ ifneq ($(YaccFiles),)
 
 .PRECIOUS: $(YaccOutput)
 
+all:: $(YaccFiles:%.y=$(PROJ_SRC_DIR)/%.cpp.cvs)
+
 # Cancel built-in rules for yacc
 %.c: %.y 
 %.cpp: %.y
@@ -1258,12 +1265,22 @@ $(PROJ_SRC_DIR)/%.cpp $(PROJ_SRC_DIR)/%.h : $(PROJ_SRC_DIR)/%.y
        $(Verb) $(BISON) -v -d -p $(<F:%Parser.y=%) -o $*.tab.c $<
        $(Verb) $(MV) -f $*.tab.c $(PROJ_SRC_DIR)/$*.cpp
        $(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
+# IFF the .y file has changed since it was last checked into CVS, copy the .y
+# file to .y.cvs and the generated .cpp/.h file to .cpp.cvs/.h.cvs.  We use this
+# mechanism so that people without flex can build LLVM by copying the .cvs files
+# to the source location and building them.
+$(YaccFiles:%.y=$(PROJ_SRC_DIR)/%.cpp.cvs): \
+$(PROJ_SRC_DIR)/%.cpp.cvs: $(PROJ_SRC_DIR)/%.cpp
+       $(Verb) $(CMP) -s $(PROJ_SRC_DIR)/$*.y $(PROJ_SRC_DIR)/$*.y.cvs || \
+      ($(CP) $< $@; \
+       $(CP) $(PROJ_SRC_DIR)/$*.y $(PROJ_SRC_DIR)/$*.y.cvs; \
+       $(CP) $(PROJ_SRC_DIR)/$*.h $(PROJ_SRC_DIR)/$*.h.cvs)
+
+
+$(YaccFiles:%.y=$(ObjDir)/%.o): $(ObjDir)/%.o : $(PROJ_SRC_DIR)/%.cpp
 
-YaccOutput := $(addprefix $(patsubst %.y,%,$(YaccFiles)),.output)
+YaccOutput := $(YaccFiles:%.y=%.output)
 
 clean-local::
        -$(Verb) $(RM) -f $(YaccOutput)