From 4dd30993bbc4ef5bc08bd76703ebe9a2310237f1 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 16 Dec 2004 17:38:56 +0000 Subject: [PATCH] Factor all of the .inc : .inc.tmp rules into one. llvm-svn: 18989 --- Makefile.rules | 46 ++++++++-------------------------------------- 1 file changed, 8 insertions(+), 38 deletions(-) diff --git a/Makefile.rules b/Makefile.rules index 8efd3e31db5..f509058f8d9 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 $(