From 23ee79579dcb2860e04569b47e61482ef0ac8886 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 16 Dec 2004 17:38:56 +0000 Subject: Factor all of the .inc : .inc.tmp rules into one. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18989 91177308-0d34-0410-b5e6-96231b3b80d8 --- Makefile.rules | 46 ++++++++-------------------------------------- 1 file changed, 8 insertions(+), 38 deletions(-) diff --git a/Makefile.rules b/Makefile.rules index 8efd3e3..f509058 100644 --- a/Makefile.rules +++ b/Makefile.rules @@ -956,85 +956,55 @@ INCTMPFiles := $(INCFiles:%=$(ObjDir)/%.tmp) # All of these files depend on tblgen and the .td files. $(INCTMPFiles) : $(TBLGEN) $(TDFiles) +# INCFiles rule: All of the tblgen generated files are emitted to +# $(ObjDir)/%.inc.tmp, instead of emitting them directly to %.inc. This allows +# us to only "touch" the real file if the contents of it change. IOW, if +# tblgen is modified, all of the .inc.tmp files are regereated, but no +# dependencies of the .inc files are, unless the contents of the .inc file +# changes. +$(INCFiles) : %.inc : $(ObjDir)/%.inc.tmp + $(Verb) cmp -s $@ $< || cp $< $@ $(TARGET:%=$(ObjDir)/%GenRegisterNames.inc.tmp): \ $(ObjDir)/%GenRegisterNames.inc.tmp : %.td $(ObjDir)/.dir $(Echo) "Building $(