From b4d3f46ba2082136399c89551baee97e06bd72a1 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 30 Jul 2003 05:49:17 +0000 Subject: [PATCH] Only regenerate the .inc file if IT has changed, not just if the .td files have changed. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7414 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/SparcV9/Makefile | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/lib/Target/SparcV9/Makefile b/lib/Target/SparcV9/Makefile index f48f0cd6e9c..5c8532a6f4e 100644 --- a/lib/Target/SparcV9/Makefile +++ b/lib/Target/SparcV9/Makefile @@ -43,9 +43,18 @@ $(BUILD_OBJ_DIR)/Depend/Sparc.burm.d: $(BUILD_OBJ_DIR)/Depend/.dir SparcV9CodeEmitter.cpp: SparcV9CodeEmitter.inc -SparcV9CodeEmitter.inc: SparcV9.td SparcV9_F2.td SparcV9_F3.td SparcV9_F4.td SparcV9_Reg.td $(TBLGEN) - @${ECHO} "TableGen-erating $@" - $(CC) -E -xc -P SparcV9.td | $(TBLGEN) -gen-emitter -o $@ + +TARGET_NAME := SparcV9 + +TABLEGEN_FILES := $(wildcard *.td) + +$(TARGET_NAME)CodeEmitter.inc.tmp: $(TABLEGEN_FILES) $(TBLGEN) + @${ECHO} "TableGen-erating " $(TARGET_NAME) + $(CC) -E -xc -P $(TARGET_NAME).td | $(TBLGEN) -gen-emitter -o $@ + +$(TARGET_NAME)CodeEmitter.inc: $(TARGET_NAME)CodeEmitter.inc.tmp + $(VERB) # Only copy over the real .inc file if it has changed! + $(VERB) diff $@ $< > /dev/null || cp $< $@ clean:: - ${RM} -f SparcV9CodeEmitter.inc + ${RM} -f $(TARGET_NAME)CodeEmitter.inc $(TARGET_NAME)CodeEmitter.inc.tmp