diff --git a/Makefile.rules b/Makefile.rules index e4b620b1ad5..4f4fb452a12 100644 --- a/Makefile.rules +++ b/Makefile.rules @@ -854,13 +854,13 @@ ifndef DISABLE_AUTO_DEPENDENCIES #--------------------------------------------------------- ifdef SHARED_LIBRARY -$(ObjDir)/%.lo $(ObjDir)/%.o: %.cpp $(ObjDir)/.dir +$(ObjDir)/%.lo $(ObjDir)/%.o: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES) $(Echo) "Compiling $*.cpp for $(BuildMode) build (PIC)" $(Verb) if $(LTCompile.CXX) -MD -MT $@ -MP -MF $(ObjDir)/$*.LACXXd $< -o $@ ; \ then $(MV) -f "$(ObjDir)/$*.LACXXd" "$(ObjDir)/$*.d"; \ else $(RM) -f "$(ObjDir)/$*.LACXXd"; exit 1; fi -$(ObjDir)/%.lo $(ObjDir)/%.o: %.c $(ObjDir)/.dir +$(ObjDir)/%.lo $(ObjDir)/%.o: %.c $(ObjDir)/.dir $(BUILT_SOURCES) $(Echo) "Compiling $*.c for $(BuildMode) build (PIC)" $(Verb) if $(LTCompile.C) -MD -MT $@ -MP -MF $(ObjDir)/$*.LACd $< -o $@ ; \ then $(MV) -f "$(ObjDir)/$*.LACd" "$(ObjDir)/$*.d"; \ @@ -871,13 +871,13 @@ $(ObjDir)/%.lo $(ObjDir)/%.o: %.c $(ObjDir)/.dir #--------------------------------------------------------- else -$(ObjDir)/%.o: %.cpp $(ObjDir)/.dir +$(ObjDir)/%.o: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES) $(Echo) "Compiling $*.cpp for $(BuildMode) build" $(Verb) if $(Compile.CXX) -MD -MT $@ -MP -MF $(ObjDir)/$*.CXXd $< -o $@ ; \ then $(MV) -f "$(ObjDir)/$*.CXXd" "$(ObjDir)/$*.d"; \ else $(RM) -f "$(ObjDir)/$*.CXXd"; exit 1; fi -$(ObjDir)/%.o: %.c $(ObjDir)/.dir +$(ObjDir)/%.o: %.c $(ObjDir)/.dir $(BUILT_SOURCES) $(Echo) "Compiling $*.c for $(BuildMode) build" $(Verb) if $(Compile.C) -MD -MT $@ -MP -MF $(ObjDir)/$*.Cd $< -o $@ ; \ then $(MV) -f "$(ObjDir)/$*.Cd" "$(ObjDir)/$*.d"; \ @@ -888,13 +888,13 @@ endif #--------------------------------------------------------- # Create .bc files in the ObjDir directory from .cpp and .c files... #--------------------------------------------------------- -$(ObjDir)/%.bc: %.cpp $(ObjDir)/.dir $(GCCAS) +$(ObjDir)/%.bc: %.cpp $(ObjDir)/.dir $(GCCAS) $(BUILT_SOURCES) $(Echo) "Compiling $*.cpp for $(BuildMode) build (bytecode)" $(Verb) if $(BCCompile.CXX) -MD -MT $@ -MP -MF "$(ObjDir)/$*.BCCXXd" $< -o $@ ; \ then $(MV) -f "$(ObjDir)/$*.BCCXXd" "$(ObjDir)/$*.d"; \ else $(RM) -f "$(ObjDir)/$*.BCCXXd"; exit 1; fi -$(ObjDir)/%.bc: %.c $(ObjDir)/.dir $(GCCAS) +$(ObjDir)/%.bc: %.c $(ObjDir)/.dir $(GCCAS) $(BUILT_SOURCES) $(Echo) "Compiling $*.c for $(BuildMode) build (bytecode)" $(Verb) if $(BCCompile.C) -MD -MT $@ -MP -MF "$(ObjDir)/$*.BCCd" $< -o $@ ; \ then $(MV) -f "$(ObjDir)/$*.BCCd" "$(ObjDir)/$*.d"; \ @@ -905,30 +905,30 @@ else ifdef SHARED_LIBRARY -$(ObjDir)/%.lo $(ObjDir)/%.o: %.cpp $(ObjDir)/.dir +$(ObjDir)/%.lo $(ObjDir)/%.o: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES) $(Echo) "Compiling $*.cpp for $(BuildMode) build (PIC)" $(LTCompile.CXX) $< -o $@ -$(ObjDir)/%.lo $(ObjDir)/%.o: %.c $(ObjDir)/.dir +$(ObjDir)/%.lo $(ObjDir)/%.o: %.c $(ObjDir)/.dir $(BUILT_SOURCES) $(Echo) "Compiling $*.cpp for $(BuildMode) build (PIC)" $(LTCompile.C) $< -o $@ else -$(ObjDir)/%.o: %.cpp $(ObjDir)/.dir +$(ObjDir)/%.o: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES) $(Echo) "Compiling $*.cpp for $(BuildMode) build" $(Compile.CXX) $< -o $@ -$(ObjDir)/%.o: %.c $(ObjDir)/.dir +$(ObjDir)/%.o: %.c $(ObjDir)/.dir $(BUILT_SOURCES) $(Echo) "Compiling $*.cpp for $(BuildMode) build" $(Compile.C) $< -o $@ endif -$(ObjDir)/%.bc: %.cpp $(ObjDir)/.dir $(GCCAS) +$(ObjDir)/%.bc: %.cpp $(ObjDir)/.dir $(GCCAS) $(BUILT_SOURCES) $(Echo) "Compiling $*.cpp for $(BuildMode) build (bytecode)" $(BCCompile.CXX) $< -o $@ -$(ObjDir)/%.bc: %.c $(ObjDir)/.dir $(GCCAS) +$(ObjDir)/%.bc: %.c $(ObjDir)/.dir $(GCCAS) $(BUILT_SOURCES) $(Echo) "Compiling $*.c for $(BuildMode) build (bytecode)" $(BCCompile.C) $< -o $@ @@ -950,49 +950,103 @@ ifdef TARGET TDFiles := $(strip $(wildcard $(BUILD_SRC_DIR)/*.td) $(LLVM_SRC_ROOT)/lib/Target/Target.td) INCFiles := $(filter %.inc,$(BUILT_SOURCES)) +INCTMPFiles := $(INCFiles:%=$(ObjDir)/%.tmp) +.PRECIOUS: $(INCTMPFiles) $(INCFiles) -$(INCFiles) : $(TBLGEN) $(TDFiles) +# All of these files depend on tblgen and the .td files. +$(INCTMPFiles) : $(TBLGEN) $(TDFiles) -%GenRegisterNames.inc : %.td + +$(TARGET:%=$(ObjDir)/%GenRegisterNames.inc.tmp): \ +$(ObjDir)/%GenRegisterNames.inc.tmp : %.td $(ObjDir)/.dir $(Echo) "Building $(