improved gcc build rule to avoid problems when files are removed from the repository, and to make it less likely that aborting a build leaves bad .d2 files around (thanks Willem!)

svn-id: r5369
This commit is contained in:
Max Horn 2002-11-01 20:28:51 +00:00
parent 797fc81597
commit a15e6df2bd

View File

@ -119,10 +119,7 @@ DEPFILES = $(wildcard $(patsubst %,%/$(DEPDIR)/*.d,$(MODULES)))
.cpp.o:
$(MKDIR) $(*D)/$(DEPDIR)
$(CXX) -Wp,-MMD,"$(*D)/$(DEPDIR)/$(*F).d2" $(CFLAGS) $(CPPFLAGS) -c $(<) -o $*.o
$(ECHO) "$(*D)/" > $(*D)/$(DEPDIR)/$(*F).d
$(CAT) "$(*D)/$(DEPDIR)/$(*F).d2" >> "$(*D)/$(DEPDIR)/$(*F).d"
$(RM) "$(*D)/$(DEPDIR)/$(*F).d2"
$(CXX) -Wp,-MMD,"$(*D)/$(DEPDIR)/$(*F).d",-MQ,"$@",-MP $(CFLAGS) $(CPPFLAGS) -c $(<) -o $*.o
-include $(DEPFILES) /dev/null