mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 04:30:23 +00:00
Factor out makefile dependency generation better.
Don't include system headers in the .d files. Don't use $@ in the makefile rules, as there are two possible targets it could resolve to: use the one that we need explicitly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45473 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
b027fa001f
commit
e43ba3dce7
@ -1079,23 +1079,28 @@ ifndef DISABLE_AUTO_DEPENDENCIES
|
|||||||
# Create .lo files in the ObjDir directory from the .cpp and .c files...
|
# Create .lo files in the ObjDir directory from the .cpp and .c files...
|
||||||
#---------------------------------------------------------
|
#---------------------------------------------------------
|
||||||
|
|
||||||
|
DEPEND_OPTIONS = -MMD -MP -MF "$(ObjDir)/$*.d.tmp" \
|
||||||
|
-MT "$(ObjDir)/$*.lo" -MT "$(ObjDir)/$*.o" -MT "$(ObjDir)/$*.d"
|
||||||
|
|
||||||
|
# If the build succeeded, move the dependency file over. If it failed, put an
|
||||||
|
# empty file there.
|
||||||
|
DEPEND_MOVEFILE = then $(MV) -f "$(ObjDir)/$*.d.tmp" "$(ObjDir)/$*.d"; \
|
||||||
|
else $(RM) "$(ObjDir)/$*.d.tmp"; exit 1; fi
|
||||||
|
|
||||||
$(ObjDir)/%.lo $(ObjDir)/%.o: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES)
|
$(ObjDir)/%.lo $(ObjDir)/%.o: %.cpp $(ObjDir)/.dir $(BUILT_SOURCES)
|
||||||
$(Echo) "Compiling $*.cpp for $(BuildMode) build " $(PIC_FLAG)
|
$(Echo) "Compiling $*.cpp for $(BuildMode) build " $(PIC_FLAG)
|
||||||
$(Verb) if $(MAYBE_PIC_Compile.CXX) -MD -MT $@ -MP -MF $(ObjDir)/$*.LACXXd $< -o $@ ;\
|
$(Verb) if $(MAYBE_PIC_Compile.CXX) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
|
||||||
then $(MV) -f "$(ObjDir)/$*.LACXXd" "$(ObjDir)/$*.d"; \
|
$(DEPEND_MOVEFILE)
|
||||||
else $(RM) -f "$(ObjDir)/$*.LACXXd"; exit 1; fi
|
|
||||||
|
|
||||||
$(ObjDir)/%.lo $(ObjDir)/%.o: %.cc $(ObjDir)/.dir $(BUILT_SOURCES)
|
$(ObjDir)/%.lo $(ObjDir)/%.o: %.cc $(ObjDir)/.dir $(BUILT_SOURCES)
|
||||||
$(Echo) "Compiling $*.cc for $(BuildMode) build" $(PIC_FLAG)
|
$(Echo) "Compiling $*.cc for $(BuildMode) build" $(PIC_FLAG)
|
||||||
$(Verb) if $(MAYBE_PIC_Compile.CXX) -MD -MT $@ -MP -MF $(ObjDir)/$*.LACXXd $< -o $@ ;\
|
$(Verb) if $(MAYBE_PIC_Compile.CXX) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
|
||||||
then $(MV) -f "$(ObjDir)/$*.LACXXd" "$(ObjDir)/$*.d"; \
|
$(DEPEND_MOVEFILE)
|
||||||
else $(RM) -f "$(ObjDir)/$*.LACXXd"; exit 1; fi
|
|
||||||
|
|
||||||
$(ObjDir)/%.lo $(ObjDir)/%.o: %.c $(ObjDir)/.dir $(BUILT_SOURCES)
|
$(ObjDir)/%.lo $(ObjDir)/%.o: %.c $(ObjDir)/.dir $(BUILT_SOURCES)
|
||||||
$(Echo) "Compiling $*.c for $(BuildMode) build" $(PIC_FLAG)
|
$(Echo) "Compiling $*.c for $(BuildMode) build" $(PIC_FLAG)
|
||||||
$(Verb) if $(MAYBE_PIC_Compile.C) -MD -MT $@ -MP -MF $(ObjDir)/$*.LACd $< -o $@ ; \
|
$(Verb) if $(MAYBE_PIC_Compile.C) $(DEPEND_OPTIONS) $< -o $(ObjDir)/$*.o ; \
|
||||||
then $(MV) -f "$(ObjDir)/$*.LACd" "$(ObjDir)/$*.d"; \
|
$(DEPEND_MOVEFILE)
|
||||||
else $(RM) -f "$(ObjDir)/$*.LACd"; exit 1; fi
|
|
||||||
|
|
||||||
#---------------------------------------------------------
|
#---------------------------------------------------------
|
||||||
# Create .bc files in the ObjDir directory from .cpp .cc and .c files...
|
# Create .bc files in the ObjDir directory from .cpp .cc and .c files...
|
||||||
|
Loading…
Reference in New Issue
Block a user